|
1 | 1 | import sys |
2 | 2 | from abc import abstractmethod |
3 | 3 | from time import struct_time |
4 | | -from typing import Any, ClassVar, Final, Generic, SupportsIndex, TypeAlias, TypeVar, final, overload, type_check_only |
| 4 | +from typing import Any, ClassVar, Final, Generic, Literal, SupportsIndex, TypeAlias, TypeVar, final, overload, type_check_only |
5 | 5 | from typing_extensions import CapsuleType, Never, Self, deprecated, disjoint_base |
6 | 6 |
|
7 | 7 | if sys.version_info >= (3, 11): |
@@ -158,7 +158,9 @@ class time: |
158 | 158 | def __gt__(self, value: time, /) -> bool: ... |
159 | 159 | def __eq__(self, value: object, /) -> bool: ... |
160 | 160 | def __hash__(self) -> int: ... |
161 | | - def isoformat(self, timespec: str = "auto") -> str: ... |
| 161 | + def isoformat( |
| 162 | + self, timespec: Literal["auto", "hours", "minutes", "seconds", "milliseconds", "microseconds"] = "auto" |
| 163 | + ) -> str: ... |
162 | 164 |
|
163 | 165 | if sys.version_info >= (3, 15): |
164 | 166 | @classmethod |
@@ -479,7 +481,9 @@ class datetime(date, Generic[_TzInfoT]): |
479 | 481 | ) -> datetime[None]: ... |
480 | 482 |
|
481 | 483 | def astimezone(self, tz: _TzInfo | None = None) -> datetime[_TzInfo]: ... |
482 | | - def isoformat(self, sep: str = "T", timespec: str = "auto") -> str: ... |
| 484 | + def isoformat( |
| 485 | + self, sep: str = "T", timespec: Literal["auto", "hours", "minutes", "seconds", "milliseconds", "microseconds"] = "auto" |
| 486 | + ) -> str: ... |
483 | 487 |
|
484 | 488 | if sys.version_info >= (3, 15): |
485 | 489 | @classmethod |
|
0 commit comments