(cls, offset, name=_Omitted)
| 2404 | # Sentinel value to disallow None |
| 2405 | _Omitted = object() |
| 2406 | def __new__(cls, offset, name=_Omitted): |
| 2407 | if not isinstance(offset, timedelta): |
| 2408 | raise TypeError("offset must be a timedelta") |
| 2409 | if name is cls._Omitted: |
| 2410 | if not offset: |
| 2411 | return cls.utc |
| 2412 | name = None |
| 2413 | elif not isinstance(name, str): |
| 2414 | raise TypeError("name must be a string") |
| 2415 | if not cls._minoffset <= offset <= cls._maxoffset: |
| 2416 | raise ValueError("offset must be a timedelta " |
| 2417 | "strictly between -timedelta(hours=24) and " |
| 2418 | f"timedelta(hours=24), not {offset!r}") |
| 2419 | return cls._create(offset, name) |
| 2420 | |
| 2421 | def __init_subclass__(cls): |
| 2422 | raise TypeError("type 'datetime.timezone' is not an acceptable base type") |
nothing calls this directly
no test coverage detected