@@ -210,7 +210,7 @@ class timedelta:
210210 def __bool__ (self ) -> bool : ...
211211 def __hash__ (self ) -> int : ...
212212
213- _TzInfoT = TypeVar ("_TzInfoT" , bound = tzinfo | None , default = tzinfo | None , covariant = True )
213+ _TzInfoT = TypeVar ("_TzInfoT" , bound = tzinfo | None , default = Any )
214214
215215class datetime (date , Generic [_TzInfoT ]):
216216 min : ClassVar [datetime ]
@@ -391,36 +391,48 @@ class datetime(date, Generic[_TzInfoT]):
391391 def tzname (self ) -> str | None : ...
392392 def dst (self ) -> timedelta | None : ...
393393 @overload # type: ignore[override]
394- def __le__ (self : datetime [_TzInfo ], value : datetime [None ], / ) -> NoReturn : ... # type: ignore[misc]
394+ def __le__ (
395+ self : datetime [_TzInfo ] | datetime [_TzInfo | None ], value : datetime [_TzInfo ] | datetime [_TzInfo | None ], /
396+ ) -> bool : ... # type: ignore[misc]
395397 @overload
396- def __le__ (self : datetime [None ], value : datetime [_TzInfo ], / ) -> NoReturn : ... # type: ignore[misc]
398+ def __le__ (self : datetime [None ] | datetime [ _TzInfo | None ] , value : datetime [None ] | datetime [ _TzInfo | None ], / ) -> bool : ... # type: ignore[misc]
397399 @overload
398- def __le__ (self : datetime [Any ], value : datetime [Any ], / ) -> bool : ...
400+ def __le__ (self : datetime [Any ], value : datetime [Any ], / ) -> NoReturn : ...
399401 @overload # type: ignore[override]
400- def __lt__ (self : datetime [_TzInfo ], value : datetime [None ], / ) -> NoReturn : ... # type: ignore[misc]
402+ def __lt__ (
403+ self : datetime [_TzInfo ] | datetime [_TzInfo | None ], value : datetime [_TzInfo ] | datetime [_TzInfo | None ], /
404+ ) -> bool : ... # type: ignore[misc]
401405 @overload
402- def __lt__ (self : datetime [None ], value : datetime [_TzInfo ], / ) -> NoReturn : ... # type: ignore[misc]
406+ def __lt__ (self : datetime [None ] | datetime [ _TzInfo | None ] , value : datetime [None ] | datetime [ _TzInfo | None ], / ) -> bool : ... # type: ignore[misc]
403407 @overload
404- def __lt__ (self : datetime [Any ], value : datetime [Any ], / ) -> bool : ...
408+ def __lt__ (self : datetime [Any ], value : datetime [Any ], / ) -> NoReturn : ...
405409 @overload # type: ignore[override]
406- def __ge__ (self : datetime [_TzInfo ], value : datetime [None ], / ) -> NoReturn : ... # type: ignore[misc]
410+ def __ge__ (
411+ self : datetime [_TzInfo ] | datetime [_TzInfo | None ], value : datetime [_TzInfo ] | datetime [_TzInfo | None ], /
412+ ) -> bool : ... # type: ignore[misc]
407413 @overload
408- def __ge__ (self : datetime [None ], value : datetime [_TzInfo ], / ) -> NoReturn : ... # type: ignore[misc]
414+ def __ge__ (self : datetime [None ] | datetime [ _TzInfo | None ] , value : datetime [None ] | datetime [ _TzInfo | None ], / ) -> bool : ... # type: ignore[misc]
409415 @overload
410- def __ge__ (self : datetime [Any ], value : datetime [Any ], / ) -> bool : ...
416+ def __ge__ (self : datetime [Any ], value : datetime [Any ], / ) -> NoReturn : ...
411417 @overload # type: ignore[override]
412- def __gt__ (self : datetime [_TzInfo ], value : datetime [None ], / ) -> NoReturn : ... # type: ignore[misc]
418+ def __gt__ (
419+ self : datetime [_TzInfo ] | datetime [_TzInfo | None ], value : datetime [_TzInfo ] | datetime [_TzInfo | None ], /
420+ ) -> bool : ... # type: ignore[misc]
413421 @overload
414- def __gt__ (self : datetime [None ], value : datetime [_TzInfo ], / ) -> NoReturn : ... # type: ignore[misc]
422+ def __gt__ (self : datetime [None ] | datetime [ _TzInfo | None ] , value : datetime [None ] | datetime [ _TzInfo | None ], / ) -> bool : ... # type: ignore[misc]
415423 @overload
416- def __gt__ (self : datetime [Any ], value : datetime [Any ], / ) -> bool : ...
424+ def __gt__ (self : datetime [Any ], value : datetime [Any ], / ) -> NoReturn : ...
417425 def __eq__ (self , value : object , / ) -> bool : ...
418426 def __hash__ (self ) -> int : ...
419427 @overload # type: ignore[override]
420- def __sub__ (self : datetime [_TzInfo ], value : datetime [None ], / ) -> NoReturn : ...
428+ def __sub__ (
429+ self : datetime [_TzInfo ] | datetime [_TzInfo | None ], value : datetime [_TzInfo ] | datetime [_TzInfo | None ], /
430+ ) -> timedelta : ...
421431 @overload
422- def __sub__ (self : datetime [None ], value : datetime [_TzInfo ], / ) -> NoReturn : ...
432+ def __sub__ (
433+ self : datetime [None ] | datetime [_TzInfo | None ], value : datetime [None ] | datetime [_TzInfo | None ], /
434+ ) -> timedelta : ...
423435 @overload
424- def __sub__ (self : datetime [Any ], value : datetime [Any ], / ) -> timedelta : ...
436+ def __sub__ (self : datetime [Any ], value : datetime [Any ], / ) -> NoReturn : ...
425437 @overload
426438 def __sub__ (self , value : timedelta , / ) -> Self : ...
0 commit comments