Package name with '.' in them: Python Bug ?

John Roth newsgroups at jhrothjr.com
Sat Mar 20 07:26:29 EST 2004


"Hung Jung Lu" <hungjunglu at yahoo.com> wrote in message
news:8ef9bea6.0403192150.57dbddef at posting.google.com...
> > "Yannick Patois" <patois at calvix.org> wrote in message
> > > Under some naming conditions of module files, it seems that python
lost
> > > class static variables values.
> ---------------------------------
> "John Roth" <newsgroups at jhrothjr.com> wrote in message
news:<105mmlt1ld7jvb9 at news.supernews.com>...
> > There is no such thing as a static variable in Python.
> ---------------------------------
> "Terry Reedy" <tjreedy at udel.edu> wrote in message
news:<mailman.163.1079717552.742.python-list at python.org>...
> > Since 'static variable' is not a Python concept, I do not know what you
> > mean.
> ---------------------------------
>
> A little hyphen would have made a whole world of difference. The
> original poster was referring to "class-static variable", and he did
> mention it explicitly.

Yes, he did.

> That's the standard jargon in languages like C++ or Java.

So what? This is Python, not C++, Java or any other language.

> "Static" here does not mean "function-static", which in
> C++ applies to a variable that belongs to the function's static scope
> instead of the dynamic scope (I.e., function-static variables are not
> destroyed: they keep their value upon exit of the function scope, and
> the next time you enter the function, you get the previous value.)
> "Class-static" means something else: it marks the ownership by a
> class, not by a particular instance.
>
> To be fair, the same jargon persists in Python when it comes to
> staticmethod(): staticmethod in Python 2.3 has nothing to do with
> "function staticity", but rather it refers to "class statiticity": a
> staticmethod belongs to the class. Given this terminology in Python, I
> think it is perfect natural to refer to class-level variables as
> "class-static" variables.
>
> "Static" is an meaning-overloaded word. The original poster did NOT
> make a mistake. I think the two people that replied simply skipped the
> word "class" in "class static variable".

Static generally means "something that does not change." The fact
that C++ in particular abuses the word has no relevance.

For the record, I knew exactly what he wrote, and I did not
ignore the fact that he wrote "class-static." An object bound to
an identifier in a class is **not** static; it can be changed and
it frequently is. There is no way in the language of making it
static.

The reason he's getting the flack he's getting is because of
attitude. The documentation (which I quoted) clearly states
that what he's trying to do isn't supported. His response to Terry's
original attempt to help him see what was going on was
both rude and sarcastic; that kind of behavior simply isn't
acceptable on this newsgroup.

John Roth
>
> Hung Jung





More information about the Python-list mailing list