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

Method _getstate

Lib/_pydatetime.py:1707–1718  ·  view source on GitHub ↗
(self, protocol=3)

Source from the content-addressed store, hash-verified

1705 # Pickle support.
1706
1707 def _getstate(self, protocol=3):
1708 us2, us3 = divmod(self._microsecond, 256)
1709 us1, us2 = divmod(us2, 256)
1710 h = self._hour
1711 if self._fold and protocol > 3:
1712 h += 128
1713 basestate = bytes([h, self._minute, self._second,
1714 us1, us2, us3])
1715 if self._tzinfo is None:
1716 return (basestate,)
1717 else:
1718 return (basestate, self._tzinfo)
1719
1720 def __setstate(self, string, tzinfo):
1721 if tzinfo is not None and not isinstance(tzinfo, _tzinfo_class):

Callers 1

__reduce_ex__Method · 0.95

Calls 1

divmodFunction · 0.50

Tested by

no test coverage detected