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

Function _enum_getstate

cloudpickle/cloudpickle.py:802–819  ·  view source on GitHub ↗
(obj)

Source from the content-addressed store, hash-verified

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

Callers 1

_dynamic_class_reduceFunction · 0.85

Calls 1

_class_getstateFunction · 0.85

Tested by

no test coverage detected