MCPcopy
hub / github.com/cloudpipe/cloudpickle / _enum_getstate

Function _enum_getstate

cloudpickle/cloudpickle.py:795–812  ·  view source on GitHub ↗
(obj)

Source from the content-addressed store, hash-verified

793
794
795def _enum_getstate(obj):
796 clsdict, slotstate = _class_getstate(obj)
797
798 members = {e.name: e.value for e in obj}
799 # Cleanup the clsdict that will be passed to _make_skeleton_enum:
800 # Those attributes are already handled by the metaclass.
801 for attrname in [
802 "_generate_next_value_",
803 "_member_names_",
804 "_member_map_",
805 "_member_type_",
806 "_value2member_map_",
807 ]:
808 clsdict.pop(attrname, None)
809 for member in members:
810 clsdict.pop(member)
811 # Special handling of Enum subclasses
812 return clsdict, slotstate
813
814
815# COLLECTIONS OF OBJECTS REDUCERS

Callers 1

_dynamic_class_reduceFunction · 0.85

Calls 1

_class_getstateFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…