MCPcopy Create free account
hub / github.com/cloudpipe/cloudpickle / _class_reduce

Function _class_reduce

cloudpickle/cloudpickle.py:1083–1095  ·  view source on GitHub ↗

Select the reducer depending on the dynamic nature of the class obj.

(obj)

Source from the content-addressed store, hash-verified

1081
1082
1083def _class_reduce(obj):
1084 """Select the reducer depending on the dynamic nature of the class obj."""
1085 if obj is type(None): # noqa
1086 return type, (None,)
1087 elif obj is type(Ellipsis):
1088 return type, (Ellipsis,)
1089 elif obj is type(NotImplemented):
1090 return type, (NotImplemented,)
1091 elif obj in _BUILTIN_TYPE_NAMES:
1092 return _builtin_type, (_BUILTIN_TYPE_NAMES[obj],)
1093 elif not _should_pickle_by_reference(obj):
1094 return _dynamic_class_reduce(obj)
1095 return NotImplemented
1096
1097
1098def _dict_keys_reduce(obj):

Callers 1

reducer_overrideMethod · 0.85

Calls 2

_dynamic_class_reduceFunction · 0.85

Tested by

no test coverage detected