I didn't phrase that very well. I do see the point about this being "an
instance lookup on a class"...
--
http://mail.python.org/mailman/listinfo/python-list
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 i
On Tue, Apr 19, 2011 at 4:52 PM, andrew cooke wrote:
> Hi,
>
> I've been staring at this problem, in various forms, all day. Am I missing
> something obvious, or is there some strange hardwiring of isinstance? This
> is with Python 3.2.
>
> class A(metaclass=ABCMeta):
> @clas
OK, sorry, I see the mistake. I'm confusing __class__ on the instance and on
te class (the latter being the metaclass). Sorry again, Andrew
--
http://mail.python.org/mailman/listinfo/python-list
Also, there's something strange about the number of arguments (they're not
consistent between the two examples - the "A" to __instancecheck__ should not
be needed). Yet it compiles and runs like that. Very confused :o(
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
I've been staring at this problem, in various forms, all day. Am I missing
something obvious, or is there some strange hardwiring of isinstance? This is
with Python 3.2.
class A(metaclass=ABCMeta):
@classmethod
def __instancecheck__(cls, instance): return F