Skip to content

Commit caaf0f1

Browse files
authored
datetime: add UTC alias (#7779)
1 parent b1ccd03 commit caaf0f1

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

stdlib/datetime.pyi

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ from time import struct_time
44
from typing import ClassVar, NamedTuple, NoReturn, SupportsAbs, TypeVar, overload
55
from typing_extensions import Literal, TypeAlias, final
66

7-
if sys.version_info >= (3, 9):
7+
if sys.version_info >= (3, 11):
8+
__all__ = ("date", "datetime", "time", "timedelta", "timezone", "tzinfo", "MINYEAR", "MAXYEAR", "UTC")
9+
elif sys.version_info >= (3, 9):
810
__all__ = ("date", "datetime", "time", "timedelta", "timezone", "tzinfo", "MINYEAR", "MAXYEAR")
911

1012
_D = TypeVar("_D", bound=date)
@@ -29,6 +31,9 @@ class timezone(tzinfo):
2931
def __init__(self, offset: timedelta, name: str = ...) -> None: ...
3032
def __hash__(self) -> int: ...
3133

34+
if sys.version_info >= (3, 11):
35+
UTC: timezone
36+
3237
if sys.version_info >= (3, 9):
3338
class _IsoCalendarDate(NamedTuple):
3439
year: int

0 commit comments

Comments
 (0)