You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thank you for this great library, it is of great help for event-driven apps 😊
Calling again saferef.safeRef(object, newOnDeleteCallback) results in setting the BoundMethodWeakref.deletionMethods to [newOnDeleteCallback] instead of [oldOnDeleteCallback, newOnDeleteCallback].
I think this is caused by a wrong usage of __new__. Objects returned by __new__ are consequently passed to __init__.
Therefore, __init__ is re-run when another reference is created, which is not the intended behaviour as the code is written.
Thank you for this great library, it is of great help for event-driven apps 😊
Calling again
saferef.safeRef(object, newOnDeleteCallback)
results in setting theBoundMethodWeakref.deletionMethods
to[newOnDeleteCallback]
instead of[oldOnDeleteCallback, newOnDeleteCallback]
.I think this is caused by a wrong usage of
__new__
. Objects returned by__new__
are consequently passed to__init__
.Therefore,
__init__
is re-run when another reference is created, which is not the intended behaviour as the code is written.pydispatcher/pydispatch/saferef.py
Line 70 in 5119d46
A simple solution would be to check if the instance has already been initialised in
__init__
:Also, another change I would add is:
Thank you for your time and great help!
The text was updated successfully, but these errors were encountered: