Save a class that can't be referenced as a module attribute. This method is used to serialize classes that are defined inside functions, or that otherwise can't be serialized as attribute lookups from importable modules.
(obj)
| 1040 | |
| 1041 | |
| 1042 | def _dynamic_class_reduce(obj): |
| 1043 | """Save a class that can't be referenced as a module attribute. |
| 1044 | |
| 1045 | This method is used to serialize classes that are defined inside |
| 1046 | functions, or that otherwise can't be serialized as attribute lookups |
| 1047 | from importable modules. |
| 1048 | """ |
| 1049 | if Enum is not None and issubclass(obj, Enum): |
| 1050 | return ( |
| 1051 | _make_skeleton_enum, |
| 1052 | _enum_getnewargs(obj), |
| 1053 | _enum_getstate(obj), |
| 1054 | None, |
| 1055 | None, |
| 1056 | _class_setstate, |
| 1057 | ) |
| 1058 | else: |
| 1059 | return ( |
| 1060 | _make_skeleton_class, |
| 1061 | _class_getnewargs(obj), |
| 1062 | _class_getstate(obj), |
| 1063 | None, |
| 1064 | None, |
| 1065 | _class_setstate, |
| 1066 | ) |
| 1067 | |
| 1068 | |
| 1069 | def _class_reduce(obj): |
no test coverage detected
searching dependent graphs…