Message256922
Following code prints X([(1, 1), (3, 3)]) on 3.4 and X([(0, 0), (1, 1), (2, 2), (3, 3), (4, 4)]) on 3.5+.
from collections import OrderedDict
class X(OrderedDict):
def __iter__(self):
for k in OrderedDict.__iter__(self):
if k % 2:
yield k
od = X((i, i) for i in range(5))
print(od.copy()) |
|
Date |
User |
Action |
Args |
2015-12-23 16:16:15 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, rhettinger, python-dev, eric.snow |
2015-12-23 16:16:15 | serhiy.storchaka | set | messageid: <1450887375.03.0.48660180672.issue25410@psf.upfronthosting.co.za> |
2015-12-23 16:16:15 | serhiy.storchaka | link | issue25410 messages |
2015-12-23 16:16:14 | serhiy.storchaka | create | |
|