Skip to content

KeysView doesn't raise RuntimeError when dict length changed. #203

@osoken

Description

@osoken

Expected behavior:

>>> import sqlitecollections as sc
>>> x =  sc.Dict({"A": 1, "B": 2, "C": 3})
>>> for k in x.keys():
...     print(k)
...     x["d"] = 12
... 
A
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
RuntimeError: dictionary changed size during iteration

Actual behavior on v0.9.5

>>> for k in x.keys():
...     print(k)
...     x["d"] = 12
... 
A
B
C
d
>>> 

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions