Message318241
I observed a strange behaviour while working on a module.
This bug is present in multiple python version so seems it is related to core-interpreter.
Behaviour can be reproduced by:
1. Create an object and in __init__ of class, we define a dictionary attribute to that object.
2. After that we change that attribute, like assign any key-value(s) to that attribute.
3. Delete the object.
4. recreate the object.
5. If you check, this new object's same attribute(dictionary) is same old attribute which was pointed by the older object.
This is a behavioural bug, as once delete is performed on an object the whole object and it's (attributes') references must be removed.
I can demonstrate this using a test from unittest, in which I put instance creation in setUp phase, instance deletion in tearDown phase and run same test multiple times. The result is different each time.
The zip file contains ngraph.py which defines a class and test_util.py which runs test against it.
Unzip and execute as:
python test_util.py #2.7.10
python3 test_util.py #3.6.3 |
|
Date |
User |
Action |
Args |
2018-05-31 04:18:48 | Nitin Bhojwani | set | recipients:
+ Nitin Bhojwani |
2018-05-31 04:18:48 | Nitin Bhojwani | set | messageid: <1527740328.11.0.682650639539.issue33703@psf.upfronthosting.co.za> |
2018-05-31 04:18:47 | Nitin Bhojwani | link | issue33703 messages |
2018-05-31 04:18:47 | Nitin Bhojwani | create | |
|