I may not be the first to mistakenly write
class Foo(ABCMeta):
when I meant to write
class Foo(metaclass=ABCMeta):
but I'm sure I won't be the last.
Sorry for the mistake...
Maybe attempting to register an ABCMeta subclass might lead to a more
informative warning though?
---------- Forwarded Message ----------
Subject: Re: [Python-3000] abc docs
Date: 2007-09-05
From: Mark Summerfield <[EMAIL PROTECTED]>
To: [email protected]
[snip]
BTW When I tried a variation of one of the ABC examples from the PEP I
got this:
Python 3.0a1 (py3k, Sep 1 2007, 08:25:11)
[GCC 4.1.2 20070626 (Red Hat 4.1.2-13)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import abc
>>> class MyABC(abc.ABCMeta): pass
...
>>> MyABC.register(tuple)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
RuntimeError: maximum recursion depth exceeded in __instancecheck__
[snip]
I hope that the first one is a bug rather than intended.
--
Mark Summerfield, Qtrac Ltd., www.qtrac.eu
-------------------------------------------------------
--
Mark Summerfield, Qtrac Ltd., www.qtrac.eu
_______________________________________________
Python-3000 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe:
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com