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 abarnert
Recipients abarnert, abarry, curioswati, gvanrossum, r.david.murray, rhettinger, serhiy.storchaka, terry.reedy
Date 2015-12-26.23:32:13
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1451172733.46.0.245413628278.issue25864@psf.upfronthosting.co.za>
In-reply-to
Content
As mentioned in #25958, Guido pointed out on -ideas that `__hash__ = None` is already the standard way to declare a class unhashable, and it's recognized by `collections.abc.Hashable`.

Doing `__reversed__ = None` does make `reversed(m)` raise a `TypeError` (although with a description saying "'NoneType' is not callable", which isn't quite as nice a description, but probably good enough).

So, I think `Mapping` should set `__reversed__ = None`, rather than setting it to a method that raises `TypeError`. (If we need something more general, that's for #25958 and/or Serhiy's typechecking bug.)
History
Date User Action Args
2015-12-26 23:32:13abarnertsetrecipients: + abarnert, gvanrossum, rhettinger, terry.reedy, r.david.murray, serhiy.storchaka, abarry, curioswati
2015-12-26 23:32:13abarnertsetmessageid: <1451172733.46.0.245413628278.issue25864@psf.upfronthosting.co.za>
2015-12-26 23:32:13abarnertlinkissue25864 messages
2015-12-26 23:32:13abarnertcreate