My stupidity / strange inconsistency overriding class methods

andrew cooke andrew at
Wed Apr 20 08:11:42 EDT 2011

Thanks for finding that reference in the data model docs!  I was about to post a bug report because in PEP 3119 it says otherwise:

> The primary mechanism proposed here is to allow overloading the built-in 
> functions isinstance() and issubclass(). The overloading works as follows: 
> The call isinstance(x, C) first checks whether C.__instancecheck__ exists, 
> and if so, calls C.__instancecheck__(x) instead of its normal implementation.

But that's now what's implemented in Issue which behaves as you quoted (only on the metaclass).


More information about the Python-list mailing list