Author inada.naoki
Recipients inada.naoki, remi.lapeyre, rhettinger, selik, serhiy.storchaka
Date 2018-05-24.10:17:51
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1527157071.7.0.682650639539.issue33462@psf.upfronthosting.co.za>
In-reply-to
Content
> I think it's a reasonable expectation as a python user to be able to do reversed(dict(a=1, b=20) since the order is know defined in the specifications.

I agree about "reasonable expectation".  But I'm interested in is it really useful in real world?

> It seems inconsistent to have an order on dict, views and not have reversed work on them.

"Have an order" doesn't mean "reversible".  For example, single linked list is ordered, but not reversible.

While CPython implementation can provide efficient __reverse__, adding __reverse__ means **all** Python implementation is expected to provide it.
For example, some Python implementation may be able to implement dict with hashmap + single linked list.  If __reverse__ is added, it's not possible anymore.

"Preserve insertion order" is very useful for many people.  So it's guaranteed.
Then how useful "reversible" in real world, for many people?
History
Date User Action Args
2018-05-24 10:17:51inada.naokisetrecipients: + inada.naoki, rhettinger, serhiy.storchaka, selik, remi.lapeyre
2018-05-24 10:17:51inada.naokisetmessageid: <1527157071.7.0.682650639539.issue33462@psf.upfronthosting.co.za>
2018-05-24 10:17:51inada.naokilinkissue33462 messages
2018-05-24 10:17:51inada.naokicreate