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

Function _cell_reduce

cloudpickle/cloudpickle.py:952–959  ·  view source on GitHub ↗

Cell (containing values of a function's free variables) reducer.

(obj)

Source from the content-addressed store, hash-verified

950
951
952def _cell_reduce(obj):
953 """Cell (containing values of a function's free variables) reducer."""
954 try:
955 obj.cell_contents
956 except ValueError: # cell is empty
957 return _make_empty_cell, ()
958 else:
959 return _make_cell, (obj.cell_contents,)
960
961
962def _classmethod_reduce(obj):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected