[2.2b2]: class variable and classmethod, subclass

Andreas Kostyrka andreas at mtg.co.at
Wed Nov 28 01:13:25 EST 2001


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

"{-- Rot13 - Hateme" <ungrzr2 at ubatxbat.pbz> writes:
> In 2.2B2
> Inside a class,I did a change to a class variable inside the class'
> classmethod. If the variable has not been changed in the subclass before,
> the class variable in the subclass of the class is also changed. Is this
> behavior intentional or a bug?

Well, it is the Pythonish way. Actually class variables in Python never had 
anywhere the semantics one might be used from other languages. (*grin* Never 
forget, Python is THE Lisp of Hashtables, instead of Cons cells ;) )

Andreas
- -- 
Andreas Kostyrka; Raiffeisenstr. 16/9; 2320 Zwölfaxing
Tel: +43/676/4091256; Fax: +43/1/7065299
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE8BICLHJdudm4KnO0RAgR8AJ4q/uMP08wx5dMHA2gcjJ+L5xY7ZQCfWDmH
YBaXdW3ZnkVz68rbRPsoFps=
=LBY0
-----END PGP SIGNATURE-----




More information about the Python-list mailing list