Message404779
I concur, this is not a bug. The contract of the weakref is that the callback will be triggered when the object is destroyed, but here the object is not destroyed because is owned by the frame in the traceback.
As Mark correctly mentions, the object should die when the try/except/finally ends.
I am not sure if it makes sense to document this because this does not really relate to weak reference, but why an object is alive. This is by far not the only weird way that can keep the object alive and maintain the behaviour so I don't know if it makes sense to document this because there are many many other confusing scenarios.
For now, I am marking this as "not a bug" but keeping it open in case we want to improve the docs. |
|
Date |
User |
Action |
Args |
2021-10-22 14:52:17 | pablogsal | set | recipients:
+ pablogsal, nascheme, mark.dickinson, nanjekyejoannah, guijarro |
2021-10-22 14:52:17 | pablogsal | set | messageid: <1634914337.11.0.542228961027.issue45555@roundup.psfhosted.org> |
2021-10-22 14:52:17 | pablogsal | link | issue45555 messages |
2021-10-22 14:52:17 | pablogsal | create | |
|