Message354946
The proposed fix fixes a crash, but there is other bug in iterating shared dicts.
class A:
def __init__(self, x, y):
if x: self.x = x
if y: self.y = y
a = A(1, 2)
print(list(iter(a.__dict__)))
print(list(reversed(a.__dict__)))
b = A(1, 0)
print(list(iter(b.__dict__)))
print(list(reversed(b.__dict__)))
With PR 16846 the last print outputs [] instead of expected ['x']. It crashes without PR 16846, so this issue is not only about empty dicts. |
|
Date |
User |
Action |
Args |
2019-10-19 15:53:16 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, ned.deily, methane, ivb, corona10, pablogsal, remi.lapeyre, xtreak |
2019-10-19 15:53:16 | serhiy.storchaka | set | messageid: <1571500396.5.0.315458750211.issue38525@roundup.psfhosted.org> |
2019-10-19 15:53:16 | serhiy.storchaka | link | issue38525 messages |
2019-10-19 15:53:16 | serhiy.storchaka | create | |
|