MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / __setstate

Method __setstate

tools/python-3.11.9-amd64/Lib/datetime.py:1639–1650  ·  view source on GitHub ↗
(self, string, tzinfo)

Source from the content-addressed store, hash-verified

1637 return (basestate, self._tzinfo)
1638
1639 def __setstate(self, string, tzinfo):
1640 if tzinfo is not None and not isinstance(tzinfo, _tzinfo_class):
1641 raise TypeError("bad tzinfo state arg")
1642 h, self._minute, self._second, us1, us2, us3 = string
1643 if h > 127:
1644 self._fold = 1
1645 self._hour = h - 128
1646 else:
1647 self._fold = 0
1648 self._hour = h
1649 self._microsecond = (((us1 << 8) | us2) << 8) | us3
1650 self._tzinfo = tzinfo
1651
1652 def __reduce_ex__(self, protocol):
1653 return (self.__class__, self._getstate(protocol))

Callers 1

__new__Method · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected