This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author moird
Recipients moird
Date 2019-07-18.21:55:14
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1563486914.84.0.86753245558.issue37625@roundup.psfhosted.org>
In-reply-to
Content
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
History
Date User Action Args
2019-07-18 21:55:14moirdsetrecipients: + moird
2019-07-18 21:55:14moirdsetmessageid: <1563486914.84.0.86753245558.issue37625@roundup.psfhosted.org>
2019-07-18 21:55:14moirdlinkissue37625 messages
2019-07-18 21:55:14moirdcreate