Message 241640 - Python tracker

Message241640

Author r.david.murray
Recipients Claudiu.Popa, belopolsky, christian.heimes, eric.snow, ethan.furman, ionelmc, jedwards, llllllllll, r.david.murray, rhettinger, steven.daprano, terry.reedy
Date 2015-04-20.13:17:23
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1429535843.55.0.213420982223.issue23990@psf.upfronthosting.co.za>
In-reply-to
Content
The only 'consistency' fix that would make any sense, IMO, would be to disallow special methods to be descriptors.  We can't do that for backward compatibility reasons, so that's pretty much case closed.

Eric already mentioned one of the other 'capability' helpers:

rdmurray@pydev:~/python/p35>./python 
Python 3.5.0a3+ (default:5612dc5e6af9+, Apr 16 2015, 11:29:58) 
[GCC 4.8.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> class Foo:
...     @property
...     def __iter__(self):
...         raise AttributeError
... 
>>> f = Foo
>>> from collections.abc import Iterable
>>> issubclass(Foo, Iterable)
True
History
Date User Action Args
2015-04-20 13:17:23r.david.murraysetrecipients: + r.david.murray, rhettinger, terry.reedy, belopolsky, christian.heimes, ionelmc, steven.daprano, Claudiu.Popa, ethan.furman, eric.snow, llllllllll, jedwards
2015-04-20 13:17:23r.david.murraysetmessageid: <1429535843.55.0.213420982223.issue23990@psf.upfronthosting.co.za>
2015-04-20 13:17:23r.david.murraylinkissue23990 messages
2015-04-20 13:17:23r.david.murraycreate