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
asquimannequin opened this issue
Jun 6, 2020
· 5 comments
Labels
3.7 (EOL)end of life3.8only security fixes3.9only security fixes3.10only security fixesdocsDocumentation in the Doc dirtype-bugAn unexpected behavior, bug, or error
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=<Date2020-06-10.20:39:29.369>created_at=<Date2020-06-06.23:23:07.853>labels= ['type-bug', '3.8', '3.9', '3.10', '3.7', 'docs']
title='weakref documentation contains cautions about dictionary mutation problems that have been solved in the implementation'updated_at=<Date2020-06-10.20:39:29.365>user='https://github.com/asqui'
The doccumentation at https://docs.python.org/3.10/library/weakref.html cautions that the WeakKeyDictionary and WeakValueDictionary are susceptible to the problem of dictionary mutation during iteration.
These notes present the user with a problem that has no easy solution.
I dug into the implementation and found that fortunately, Antoine Pitrou already addressed this challenge (10 years ago!) by introducing an _IterationGuard context manager to the implementation, which delays mutation while an iteration is in progress.
3.7 (EOL)end of life3.8only security fixes3.9only security fixes3.10only security fixesdocsDocumentation in the Doc dirtype-bugAn unexpected behavior, bug, or error
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: