Message178724
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. |
|
Date |
User |
Action |
Args |
2013-01-01 03:21:37 | ncoghlan | set | recipients:
+ ncoghlan |
2013-01-01 03:21:37 | ncoghlan | set | messageid: <1357010497.63.0.917650591234.issue16831@psf.upfronthosting.co.za> |
2013-01-01 03:21:37 | ncoghlan | link | issue16831 messages |
2013-01-01 03:21:36 | ncoghlan | create | |
|