"""A more or less complete user-defined wrapper around dictionary objects."""
-class UserDict(object):
+class UserDict:
def __init__(self, dict=None, **kwargs):
self.data = {}
if dict is not None:
"""Abstract Base Classes (ABCs) according to PEP 3119."""
+import types
+
# Instance of old-style class
class _C: pass
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
position to the given argument, which goes against the tradition of
ftruncate() and other truncation APIs. Patch by Pascal Chambon.
-- UserDict is now a new-style class.
-
- Issue #7610: Reworked implementation of the internal ``zipfile.ZipExtFile``
class used to represent files stored inside an archive. The new
implementation is significantly faster and can be wrapped in a