@@ -2,7 +2,7 @@ import sys
2
2
from abc import abstractmethod
3
3
from time import struct_time
4
4
from typing import ClassVar , NamedTuple , NoReturn , TypeVar , overload
5
- from typing_extensions import Literal , Self , TypeAlias , final
5
+ from typing_extensions import Literal , Self , SupportsIndex , TypeAlias , final
6
6
7
7
if sys .version_info >= (3 , 11 ):
8
8
__all__ = ("date" , "datetime" , "time" , "timedelta" , "timezone" , "tzinfo" , "MINYEAR" , "MAXYEAR" , "UTC" )
@@ -49,7 +49,7 @@ class date:
49
49
min : ClassVar [date ]
50
50
max : ClassVar [date ]
51
51
resolution : ClassVar [timedelta ]
52
- def __new__ (cls , year : int , month : int , day : int ) -> Self : ...
52
+ def __new__ (cls , year : SupportsIndex , month : SupportsIndex , day : SupportsIndex ) -> Self : ...
53
53
@classmethod
54
54
def fromtimestamp (cls , __timestamp : float ) -> Self : ...
55
55
@classmethod
@@ -81,7 +81,7 @@ class date:
81
81
def isoformat (self ) -> str : ...
82
82
def timetuple (self ) -> struct_time : ...
83
83
def toordinal (self ) -> int : ...
84
- def replace (self , year : int = ..., month : int = ..., day : int = ...) -> Self : ...
84
+ def replace (self , year : SupportsIndex = ..., month : SupportsIndex = ..., day : SupportsIndex = ...) -> Self : ...
85
85
def __le__ (self , __value : date ) -> bool : ...
86
86
def __lt__ (self , __value : date ) -> bool : ...
87
87
def __ge__ (self , __value : date ) -> bool : ...
@@ -119,10 +119,10 @@ class time:
119
119
resolution : ClassVar [timedelta ]
120
120
def __new__ (
121
121
cls ,
122
- hour : int = ...,
123
- minute : int = ...,
124
- second : int = ...,
125
- microsecond : int = ...,
122
+ hour : SupportsIndex = ...,
123
+ minute : SupportsIndex = ...,
124
+ second : SupportsIndex = ...,
125
+ microsecond : SupportsIndex = ...,
126
126
tzinfo : _TzInfo | None = ...,
127
127
* ,
128
128
fold : int = ...,
@@ -160,10 +160,10 @@ class time:
160
160
def dst (self ) -> timedelta | None : ...
161
161
def replace (
162
162
self ,
163
- hour : int = ...,
164
- minute : int = ...,
165
- second : int = ...,
166
- microsecond : int = ...,
163
+ hour : SupportsIndex = ...,
164
+ minute : SupportsIndex = ...,
165
+ second : SupportsIndex = ...,
166
+ microsecond : SupportsIndex = ...,
167
167
tzinfo : _TzInfo | None = ...,
168
168
* ,
169
169
fold : int = ...,
@@ -223,13 +223,13 @@ class datetime(date):
223
223
max : ClassVar [datetime ]
224
224
def __new__ (
225
225
cls ,
226
- year : int ,
227
- month : int ,
228
- day : int ,
229
- hour : int = ...,
230
- minute : int = ...,
231
- second : int = ...,
232
- microsecond : int = ...,
226
+ year : SupportsIndex ,
227
+ month : SupportsIndex ,
228
+ day : SupportsIndex ,
229
+ hour : SupportsIndex = ...,
230
+ minute : SupportsIndex = ...,
231
+ second : SupportsIndex = ...,
232
+ microsecond : SupportsIndex = ...,
233
233
tzinfo : _TzInfo | None = ...,
234
234
* ,
235
235
fold : int = ...,
@@ -280,13 +280,13 @@ class datetime(date):
280
280
def timetz (self ) -> _Time : ...
281
281
def replace (
282
282
self ,
283
- year : int = ...,
284
- month : int = ...,
285
- day : int = ...,
286
- hour : int = ...,
287
- minute : int = ...,
288
- second : int = ...,
289
- microsecond : int = ...,
283
+ year : SupportsIndex = ...,
284
+ month : SupportsIndex = ...,
285
+ day : SupportsIndex = ...,
286
+ hour : SupportsIndex = ...,
287
+ minute : SupportsIndex = ...,
288
+ second : SupportsIndex = ...,
289
+ microsecond : SupportsIndex = ...,
290
290
tzinfo : _TzInfo | None = ...,
291
291
* ,
292
292
fold : int = ...,
0 commit comments