[Python-3000] abc docs (original) (raw)

Mark Summerfield mark at qtrac.eu
Wed Sep 5 13:40:43 CEST 2007


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 <mark at qtrac.eu> To: python-3000 at python.org

[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



More information about the Python-3000 mailing list