Message256437
> If you do `reversed(d)`, you get a nice `TypeError: argument to reversed() must be a sequence`. But if you do `reversed(m)`, you get a reversed` iterator. And when you iterate it, presumably expecting to get 0 and 1 in some arbitrary order, you instead get 3, and then a KeyError:0`.
I got 2 instead of 3.
What are we exactly expecting here? How can a dictionary be reversed?
> I can't imagine this would break any working code. If it did, the workaround would be simple: just implement `def __reversed__(self): return (self[k] for k in reversed(range(len(self))))`.
This seems to make no difference. I still got the KeyError. |
|
Date |
User |
Action |
Args |
2015-12-15 04:44:21 | curioswati | set | recipients:
+ curioswati, abarnert, abarry |
2015-12-15 04:44:21 | curioswati | set | messageid: <1450154661.27.0.259451194217.issue25864@psf.upfronthosting.co.za> |
2015-12-15 04:44:21 | curioswati | link | issue25864 messages |
2015-12-15 04:44:20 | curioswati | create | |
|