MCPcopy Index your code
hub / github.com/cloudpipe/cloudpickle / _class_reduce

Function _class_reduce

cloudpickle/cloudpickle.py:1069–1081  ·  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

1067
1068
1069def _class_reduce(obj):
1070 """Select the reducer depending on the dynamic nature of the class obj."""
1071 if obj is type(None): # noqa
1072 return type, (None,)
1073 elif obj is type(Ellipsis):
1074 return type, (Ellipsis,)
1075 elif obj is type(NotImplemented):
1076 return type, (NotImplemented,)
1077 elif obj in _BUILTIN_TYPE_NAMES:
1078 return _builtin_type, (_BUILTIN_TYPE_NAMES[obj],)
1079 elif not _should_pickle_by_reference(obj):
1080 return _dynamic_class_reduce(obj)
1081 return NotImplemented
1082
1083
1084def _dict_keys_reduce(obj):

Callers 1

reducer_overrideMethod · 0.85

Calls 2

_dynamic_class_reduceFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…