MCPcopy Create free account
hub / github.com/ipython/traitlets / __getstate__

Method __getstate__

traitlets/traitlets.py:1406–1416  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1404 )
1405
1406 def __getstate__(self) -> dict[str, t.Any]:
1407 d = self.__dict__.copy()
1408 # event handlers stored on an instance are
1409 # expected to be reinstantiated during a
1410 # recall of instance_init during __setstate__
1411 d["_trait_notifiers"] = {}
1412 d["_trait_validators"] = {}
1413 d["_trait_values"] = self._trait_values.copy()
1414 d["_cross_validation_lock"] = False # FIXME: raise if cloning locked!
1415
1416 return d
1417
1418 def __setstate__(self, state: dict[str, t.Any]) -> None:
1419 self.__dict__ = state.copy()

Callers

nothing calls this directly

Calls 1

copyMethod · 0.80

Tested by

no test coverage detected