homepage

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
Date 2015年12月26日.23:28:34
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1451172514.85.0.291744732201.issue25958@psf.upfronthosting.co.za>
In-reply-to
Content
As Guido pointed out on -ideas, hashing already uses the convention of `__hash__ is None` to declare a type unhashable, and `collections.abc.Hashable.__subclasshook__` already checks for that.
Meanwhile, setting `__iter__` and `__reversed__` to `None` already raises a `TypeError` on `iter` and `reversed` (although not with the most helpful description).
So, maybe that should be documented as the standard way to unimplement `__iter__` and `__reversed__`, and `collections.abc.Iterable` should check that the looked-up `__iter__` is not `None` (and presumably typecheckers doing the equivalent for both `Iterable` and `Reversible`)?
History
Date User Action Args
2015年12月26日 23:28:34abarnertsetrecipients: + abarnert
2015年12月26日 23:28:34abarnertsetmessageid: <1451172514.85.0.291744732201.issue25958@psf.upfronthosting.co.za>
2015年12月26日 23:28:34abarnertlinkissue25958 messages
2015年12月26日 23:28:34abarnertcreate

AltStyle によって変換されたページ (->オリジナル) /