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 ncoghlan
Recipients ncoghlan
Date 2013-01-01.03:21:36
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1357010497.63.0.917650591234.issue16831@psf.upfronthosting.co.za>
In-reply-to
Content
Authors of __subclasshook__ methods need to decide between returning True, False and NotImplemented in various cases. Making that decision requires a clear understanding that the checks in ABCMeta.__subclasscheck__ occur in the following order:

- explicit registrations
- the __subclasshook__ call
- ordinary inheritance

So, returning False from __subclasshook__ allows you to override normal rules of inheritance, while returning NotImplemented lets normal inheritance rules apply. Explicit registrations take precedence regardless.
History
Date User Action Args
2013-01-01 03:21:37ncoghlansetrecipients: + ncoghlan
2013-01-01 03:21:37ncoghlansetmessageid: <1357010497.63.0.917650591234.issue16831@psf.upfronthosting.co.za>
2013-01-01 03:21:37ncoghlanlinkissue16831 messages
2013-01-01 03:21:36ncoghlancreate