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 NeilGirdhar
Recipients NeilGirdhar, brett.cannon, gvanrossum, levkivskyi, rhettinger, srkunze
Date 2016-08-18.06:08:46
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1471500527.37.0.142635123325.issue27598@psf.upfronthosting.co.za>
In-reply-to
Content
@gvanrossum is there any reason that subclasshook is implemented by overriding instead of cooperation?  E.g.,:

class Sized(metaclass=ABCMeta):

    @classmethod
    def __subclasshook__(cls, C):
        return (super().__subclasshook__(C) and 
                any("__len__" in B.__dict__ for B in C.__mro__))


etc.  And then Collection does not need to implement subclasshook since its base classes cooperate?
History
Date User Action Args
2016-08-18 06:08:47NeilGirdharsetrecipients: + NeilGirdhar, gvanrossum, brett.cannon, rhettinger, levkivskyi, srkunze
2016-08-18 06:08:47NeilGirdharsetmessageid: <1471500527.37.0.142635123325.issue27598@psf.upfronthosting.co.za>
2016-08-18 06:08:47NeilGirdharlinkissue27598 messages
2016-08-18 06:08:46NeilGirdharcreate