Christian Heimes added the comment:
Are you fine with the error message or do you have a better one?
Index: Lib/abc.py
===================================================================
--- Lib/abc.py (Revision 59228)
+++ Lib/abc.py (Arbeitskopie)
@@ -137,8 +137,12 @@
cls._abc_negative_cache_version = ABCMeta._abc_invalidation_counter
return cls
- def register(cls, subclass):
+ def register(cls, subclass=None):
"""Register a virtual subclass of an ABC."""
+ if subclass is None:
+ raise TypeError("register() cannot be called on an ABCMeta "
+ "subclass. Maybe you forgot the metaclass keyword
argument "
+ "when declaring the class?")
if not isinstance(cls, type):
raise TypeError("Can only register classes")
if issubclass(subclass, cls):
----------
components: +Library (Lib) -Interpreter Core
keywords: +patch, py3k
nosy: +tiran
__________________________________
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue1109>
__________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com