MCPcopy Index your code
hub / github.com/RustPython/RustPython / __reduce__

Method __reduce__

Lib/collections/__init__.py:286–303  ·  view source on GitHub ↗

Return state information for pickling

(self)

Source from the content-addressed store, hash-verified

284 return '%s(%r)' % (self.__class__.__name__, dict(self.items()))
285
286 def __reduce__(self):
287 'Return state information for pickling'
288 state = self.__getstate__()
289 if state:
290 if isinstance(state, tuple):
291 state, slots = state
292 else:
293 slots = {}
294 state = state.copy()
295 slots = slots.copy()
296 for k in vars(OrderedDict()):
297 state.pop(k, None)
298 slots.pop(k, None)
299 if slots:
300 state = state, slots
301 else:
302 state = state or None
303 return self.__class__, (), state, None, iter(self.items())
304
305 def copy(self):
306 'od.copy() -> a shallow copy of od'

Callers 2

test_yaml_linkageMethod · 0.95

Calls 8

itemsMethod · 0.95
isinstanceFunction · 0.85
varsFunction · 0.85
iterFunction · 0.85
OrderedDictClass · 0.70
__getstate__Method · 0.45
copyMethod · 0.45
popMethod · 0.45

Tested by 2

test_yaml_linkageMethod · 0.76