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

Hung Jung Lu hungjunglu at yahoo.com
Sat Mar 20 00:50:34 EST 2004


> "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. That's the standard jargon in languages like
C++ or Java. "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".

Hung Jung



More information about the Python-list mailing list