Author neil.g
Recipients brett.cannon, gvanrossum, levkivskyi, neil.g, 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:47neil.gsetrecipients: + neil.g, gvanrossum, brett.cannon, rhettinger, levkivskyi, srkunze
2016-08-18 06:08:47neil.gsetmessageid: <1471500527.37.0.142635123325.issue27598@psf.upfronthosting.co.za>
2016-08-18 06:08:47neil.glinkissue27598 messages
2016-08-18 06:08:46neil.gcreate