Class variables static by default?

Chris Rebert clp2 at rebertia.com
Sat Dec 19 23:28:07 EST 2009


On Sat, Dec 19, 2009 at 8:16 PM, Steven D'Aprano
<steve at remove-this-cybersource.com.au> wrote:
> On Sun, 20 Dec 2009 11:44:11 +1100, Lie Ryan wrote:
>
>> In python, 'class variable' is a variable that belongs to a class; not
>> to the instance and is shared by all instance that belong to the class.
>
> Surely, since string variables are strings, and float variables are
> floats, and bool variables are bools, and module variables are modules, a
> class variable will be a class and an instance variable will be an
> instance?

As they say, the exception proves the rule. :)

Cheers,
Chris
--
http://blog.rebertia.com



More information about the Python-list mailing list