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

Method __new__

tools/python-3.11.9-amd64/Lib/datetime.py:2298–2311  ·  view source on GitHub ↗
(cls, offset, name=_Omitted)

Source from the content-addressed store, hash-verified

2296 # Sentinel value to disallow None
2297 _Omitted = object()
2298 def __new__(cls, offset, name=_Omitted):
2299 if not isinstance(offset, timedelta):
2300 raise TypeError("offset must be a timedelta")
2301 if name is cls._Omitted:
2302 if not offset:
2303 return cls.utc
2304 name = None
2305 elif not isinstance(name, str):
2306 raise TypeError("name must be a string")
2307 if not cls._minoffset <= offset <= cls._maxoffset:
2308 raise ValueError("offset must be a timedelta "
2309 "strictly between -timedelta(hours=24) and "
2310 "timedelta(hours=24).")
2311 return cls._create(offset, name)
2312
2313 @classmethod
2314 def _create(cls, offset, name=None):

Callers

nothing calls this directly

Calls 1

_createMethod · 0.45

Tested by

no test coverage detected