Message414582
When iterating over __dict__ inside a classmethod, accessing __annotations causses RuntimeError: dictionary changed size during iteration.
This only seems to affect Python 3.10.x on a Ubuntu system.
The following can be used to reproduce this issue:
class ExampleCls:
@classmethod
def iter_cls(cls):
for name, val in cls.__dict__.items():
print(cls.__annotations__)
This can be fixed for this Example by calling _ = cls.__annotations__ before iterating over the __dict__ |
|
Date |
User |
Action |
Args |
2022-03-05 15:33:42 | PythonF | set | recipients:
+ PythonF |
2022-03-05 15:33:42 | PythonF | set | messageid: <1646494422.15.0.024229074835.issue46930@roundup.psfhosted.org> |
2022-03-05 15:33:42 | PythonF | link | issue46930 messages |
2022-03-05 15:33:42 | PythonF | create | |
|