This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author curioswati
Recipients abarnert, abarry, curioswati
Date 2015-12-15.04:44:20
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1450154661.27.0.259451194217.issue25864@psf.upfronthosting.co.za>
In-reply-to
Content
> 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.
History
Date User Action Args
2015-12-15 04:44:21curioswatisetrecipients: + curioswati, abarnert, abarry
2015-12-15 04:44:21curioswatisetmessageid: <1450154661.27.0.259451194217.issue25864@psf.upfronthosting.co.za>
2015-12-15 04:44:21curioswatilinkissue25864 messages
2015-12-15 04:44:20curioswaticreate