@@ -2,9 +2,9 @@ import datetime
22import enum
33import sys
44from _typeshed import Unused
5- from collections .abc import Iterable , Sequence
5+ from collections .abc import Iterable
66from time import struct_time
7- from typing import ClassVar , Final , TypeAlias
7+ from typing import ClassVar , Final , TypeAlias , overload
88
99__all__ = [
1010 "FRIDAY" ,
@@ -160,10 +160,28 @@ def formatstring(cols: Iterable[str], colwidth: int = 20, spacing: int = 6) -> s
160160def timegm (tuple : tuple [int , ...] | struct_time ) -> int : ...
161161
162162# Data attributes
163- day_name : Sequence [str ]
164- day_abbr : Sequence [str ]
165- month_name : Sequence [str ]
166- month_abbr : Sequence [str ]
163+ class _localized_month :
164+ format : str
165+ def __init__ (self , format : str ) -> None : ...
166+ @overload
167+ def __getitem__ (self , i : int ) -> str : ...
168+ @overload
169+ def __getitem__ (self , i : slice ) -> list [str ]: ...
170+ def __len__ (self ) -> int : ...
171+
172+ class _localized_day :
173+ format : str
174+ def __init__ (self , format : str ) -> None : ...
175+ @overload
176+ def __getitem__ (self , i : int ) -> str : ...
177+ @overload
178+ def __getitem__ (self , i : slice ) -> list [str ]: ...
179+ def __len__ (self ) -> int : ...
180+
181+ day_name : _localized_day
182+ day_abbr : _localized_day
183+ month_name : _localized_month
184+ month_abbr : _localized_month
167185
168186if sys .version_info >= (3 , 12 ):
169187 class Month (enum .IntEnum ):
@@ -221,5 +239,5 @@ else:
221239EPOCH : Final = 1970
222240
223241if sys .version_info >= (3 , 15 ):
224- standalone_month_name : Sequence [ str ]
225- standalone_month_abbr : Sequence [ str ]
242+ standalone_month_name : _localized_month
243+ standalone_month_abbr : _localized_month
0 commit comments