Message348130
Not sure if this is the desired behavior but wanted to bring it up anyways.
When you have a class and have a variable in like:
class TestClass(object):
variable = []
then you run it through a loop like:
for num in range(10):
test = TestClass()
test.variable.append(num)
even if you assign another variable to it or none like:
test = "blah"
test = None
then reassign the class:
test = TestClass()
print(test.variable)
will return all the numbers in the list.
also doesn't seem to matter if garbage collection was manually ran.
Attached is a small example code.
This was found on Macos and tested with both python 3.7 and 2.7 Subsequently same on ubuntu with python 3.5 and python 2.7 |
|
Date |
User |
Action |
Args |
2019-07-18 21:55:14 | moird | set | recipients:
+ moird |
2019-07-18 21:55:14 | moird | set | messageid: <1563486914.84.0.86753245558.issue37625@roundup.psfhosted.org> |
2019-07-18 21:55:14 | moird | link | issue37625 messages |
2019-07-18 21:55:14 | moird | create | |
|