> 
> Aha.  You're trying to fix up the metaclass after the fact, which is not
> the right way to do it.  If you change the class definitions to:
> 
__metaclass__ = whatever; # is python2.x syntax

> then you get the prints from MyMeta.__instancecheck__().  The
> isinstance() still returns True, though, and I don't know why.  Then
> again, your definition of MyMeta is really weird.

weird how..?
(I'm just trying to figure out what's going on with __instancecheck__ - 
no further higher purpose :p)

example, when we do: isinstance(x, (A, B, C))
you expect from the docs that
A.__instancecheck__(cls, x) is passed but x = []
also, B and C.__instancecheck__ is not called when I return False

Also if I interchange (Bar, Foo), expecting that Foo.__instancecheck__ 
will be called, it's completely bypassed
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to