[issue1109] Warning required when calling register() on an ABCMeta subclass
Mark Summerfield
report at bugs.python.org
Wed Sep 5 17:22:18 CEST 2007
New submission from Mark Summerfield:
GvR asked me to add this to the bug tracker.
If you do this:
class A(ABCMeta): pass
A.register(list)
you get this error message:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
RuntimeError: maximum recursion depth exceeded in __instancecheck__
This is not very helpful.
You probably meant to write:
class A(metaclass=ABCMeta): pass
Perhaps a warning message like this would be better:
"register() should not be called on an ABCMeta subclass; maybe you
forgot the metaclass keyword argument when declaring the class?"
----------
components: Interpreter Core
messages: 55663
nosy: mark
severity: normal
status: open
title: Warning required when calling register() on an ABCMeta subclass
type: behavior
versions: Python 3.0
__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue1109>
__________________________________
More information about the Python-bugs-list
mailing list