Message348132
Because variable belongs to the class, and not any instance of the class, you can duplicate this behavior without creating any instances at all:
>>> class TestClass(object):
... variable = []
...
>>> TestClass.variable.append(1)
>>> TestClass.variable
[1]
And then when you create an instance t, t.variable still refers to the class:
>>> t = TestClass()
>>> t.variable
[1]
>>>
This is expected behavior. |
|
Date |
User |
Action |
Args |
2019-07-19 01:21:02 | eric.smith | set | recipients:
+ eric.smith, miedzinski, moird |
2019-07-19 01:21:02 | eric.smith | set | messageid: <1563499262.01.0.789576577972.issue37625@roundup.psfhosted.org> |
2019-07-19 01:21:01 | eric.smith | link | issue37625 messages |
2019-07-19 01:21:01 | eric.smith | create | |
|