diff options
author | Benjamin Peterson <benjamin@python.org> | 2010-06-22 18:09:02 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2010-06-22 18:09:02 (GMT) |
commit | bde67df0cd4de5e034c2cf4bd43c0d5657649942 (patch) | |
tree | 33b1ad6217fdcc079f6463fdcff033f73bf0edb1 /Lib/abc.py | |
parent | 3ceab01cefa149ade3bed218e9c03ac791f0e8cc (diff) | |
download | cpython-bde67df0cd4de5e034c2cf4bd43c0d5657649942.zip cpython-bde67df0cd4de5e034c2cf4bd43c0d5657649942.tar.gz cpython-bde67df0cd4de5e034c2cf4bd43c0d5657649942.tar.bz2 |
keep UserDict an old-style class
Be generous in abc.py to allow this.
Diffstat (limited to 'Lib/abc.py')
-rw-r--r-- | Lib/abc.py | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -3,6 +3,8 @@ """Abstract Base Classes (ABCs) according to PEP 3119.""" +import types + # Instance of old-style class class _C: pass @@ -101,7 +103,7 @@ class ABCMeta(type): def register(cls, subclass): """Register a virtual subclass of an ABC.""" - if not isinstance(subclass, type): + if not isinstance(subclass, (type, types.ClassType)): raise TypeError("Can only register classes") if issubclass(subclass, cls): return # Already a subclass |