mirror of
https://github.com/python/cpython.git
synced 2025-11-20 02:50:14 +00:00
bpo-36473: add maximum iteration check for dict .values() and .items() (GH-12619)
This commit is contained in:
parent
04694a306b
commit
b8311cf5e5
3 changed files with 36 additions and 2 deletions
|
|
@ -1 +1,5 @@
|
|||
Changing `dict` keys during iteration will now be detected in certain corner cases where the number of keys isn't changed (but they keys themselves are), and a `RuntimeError` will be raised.
|
||||
Changing ``dict`` keys during iteration of the dict itself, ``keys()``,
|
||||
``values()``, or ``items()`` will now be detected in certain corner cases where
|
||||
keys are deleted/added so that the number of keys isn't changed.
|
||||
A `RuntimeError` will be raised after ``len(dict)`` iterations.
|
||||
Contributed by Thomas Perl.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue