[issue47143] Add functools.copy_class() which updates closures

STINNER Victor report at bugs.python.org
Mon Mar 28 11:58:01 EDT 2022


STINNER Victor <vstinner at python.org> added the comment:

More recent copy.copy() change: commit 5c1c3b4f197c57952760be37d77d73669284a607 of bpo-11480:

    Issue #11480: Fixed copy.copy to work with classes with custom metaclasses.

+    try:
+        issc = issubclass(cls, type)
+    except TypeError: # cls is not a class
+        issc = False
+    if issc:
+        # treat it as a regular class:
+        return _copy_immutable(x)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue47143>
_______________________________________


More information about the Python-bugs-list mailing list