H
Henry 'Pi' James
I've just found out that a subclass shares the class variables of its
superclass until it's instantiated for the first time, but not any
more afterwards:
Python 3.1 (r31:73574, Jun 26 2009, 20:21:35) [MSC v.1500 32 bit
(Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information..... n = 0
.... def __init__(self):
.... type(self).n += 1((5, 5, 4), (6, 6, 4), (5, 6, 5))
This makes no sense to me at all. Could it possibly be a bug?
superclass until it's instantiated for the first time, but not any
more afterwards:
Python 3.1 (r31:73574, Jun 26 2009, 20:21:35) [MSC v.1500 32 bit
(Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information..... n = 0
.... def __init__(self):
.... type(self).n += 1((5, 5, 4), (6, 6, 4), (5, 6, 5))
This makes no sense to me at all. Could it possibly be a bug?