MCPcopy Create free account
hub / github.com/grantjenks/python-sortedcontainers / __reduce__

Method __reduce__

sortedcontainers/sorteddict.py:579–587  ·  view source on GitHub ↗

Support for pickle. The tricks played with caching references in :func:`SortedDict.__init__` confuse pickle so customize the reducer.

(self)

Source from the content-addressed store, hash-verified

577
578
579 def __reduce__(self):
580 """Support for pickle.
581
582 The tricks played with caching references in
583 :func:`SortedDict.__init__` confuse pickle so customize the reducer.
584
585 """
586 items = dict.copy(self)
587 return (type(self), (self._key, items))
588
589
590 @recursive_repr()

Callers

nothing calls this directly

Calls 1

copyMethod · 0.45

Tested by

no test coverage detected