MCPcopy Index your code
hub / github.com/python/cpython / __setstate

Method __setstate

Lib/_pydatetime.py:2406–2419  ·  view source on GitHub ↗
(self, string, tzinfo)

Source from the content-addressed store, hash-verified

2404 return (basestate, self._tzinfo)
2405
2406 def __setstate(self, string, tzinfo):
2407 if tzinfo is not None and not isinstance(tzinfo, _tzinfo_class):
2408 raise TypeError("bad tzinfo state arg")
2409 (yhi, ylo, m, self._day, self._hour,
2410 self._minute, self._second, us1, us2, us3) = string
2411 if m > 127:
2412 self._fold = 1
2413 self._month = m - 128
2414 else:
2415 self._fold = 0
2416 self._month = m
2417 self._year = yhi * 256 + ylo
2418 self._microsecond = (((us1 << 8) | us2) << 8) | us3
2419 self._tzinfo = tzinfo
2420
2421 def __reduce_ex__(self, protocol):
2422 return (self.__class__, self._getstate(protocol))

Callers 1

__new__Method · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected