@@ -7,7 +7,6 @@ from datetime import (
77 tzinfo as _tzinfo ,
88)
99from datetime import _IsoCalendarDate # pyright: ignore[reportPrivateUsage]
10- import sys
1110from time import struct_time
1211from typing import (
1312 ClassVar ,
@@ -99,16 +98,10 @@ class Timestamp(datetime, SupportsIndex):
9998 def tz (self ) -> _tzinfo | None : ...
10099 @property
101100 def fold (self ) -> int : ...
102-
103- if sys .version_info >= (3 , 12 ):
104- @classmethod
105- def fromtimestamp ( # pyright: ignore[reportIncompatibleMethodOverride] # pyrefly: ignore
106- cls , t : float , tz : _tzinfo | str | None = ...
107- ) -> Self : ...
108- else :
109- @classmethod
110- def fromtimestamp (cls , t : float , tz : _tzinfo | str | None = ...) -> Self : ...
111-
101+ @classmethod
102+ def fromtimestamp ( # pyright: ignore[reportIncompatibleMethodOverride]
103+ cls , t : float , tz : _tzinfo | str | None = ...
104+ ) -> Self : ...
112105 @classmethod
113106 def utcfromtimestamp (cls , ts : float ) -> Self : ...
114107 @classmethod
@@ -175,7 +168,7 @@ class Timestamp(datetime, SupportsIndex):
175168 # Mypy complains Forward operator "<inequality op>" is not callable, so ignore misc
176169 # for le, lt ge and gt
177170 @overload # type: ignore[override]
178- def __le__ (self , other : Timestamp | datetime | np .datetime64 ) -> bool : ...
171+ def __le__ (self , other : datetime | np .datetime64 | Self ) -> bool : ...
179172 @overload
180173 def __le__ (self , other : DatetimeIndex ) -> np_1darray [np .bool ]: ...
181174 @overload
@@ -185,7 +178,7 @@ class Timestamp(datetime, SupportsIndex):
185178 @overload
186179 def __le__ (self , other : Series [Timestamp ]) -> Series [bool ]: ...
187180 @overload # type: ignore[override]
188- def __lt__ (self , other : Timestamp | datetime | np .datetime64 ) -> bool : ...
181+ def __lt__ (self , other : datetime | np .datetime64 | Self ) -> bool : ...
189182 @overload
190183 def __lt__ (self , other : DatetimeIndex ) -> np_1darray [np .bool ]: ...
191184 @overload
@@ -195,7 +188,7 @@ class Timestamp(datetime, SupportsIndex):
195188 @overload
196189 def __lt__ (self , other : Series [Timestamp ]) -> Series [bool ]: ...
197190 @overload # type: ignore[override]
198- def __ge__ (self , other : Timestamp | datetime | np .datetime64 ) -> bool : ...
191+ def __ge__ (self , other : datetime | np .datetime64 | Self ) -> bool : ...
199192 @overload
200193 def __ge__ (self , other : DatetimeIndex ) -> np_1darray [np .bool ]: ...
201194 @overload
@@ -205,7 +198,7 @@ class Timestamp(datetime, SupportsIndex):
205198 @overload
206199 def __ge__ (self , other : Series [Timestamp ]) -> Series [bool ]: ...
207200 @overload # type: ignore[override]
208- def __gt__ (self , other : Timestamp | datetime | np .datetime64 ) -> bool : ...
201+ def __gt__ (self , other : datetime | np .datetime64 | Self ) -> bool : ...
209202 @overload
210203 def __gt__ (self , other : DatetimeIndex ) -> np_1darray [np .bool ]: ...
211204 @overload
@@ -243,7 +236,7 @@ class Timestamp(datetime, SupportsIndex):
243236 self , other : np_ndarray [ShapeT , np .timedelta64 ]
244237 ) -> np_ndarray [ShapeT , np .datetime64 ]: ...
245238 @overload
246- def __eq__ (self , other : Timestamp | datetime | np .datetime64 ) -> bool : ... # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
239+ def __eq__ (self , other : datetime | np .datetime64 | Self ) -> bool : ... # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
247240 @overload
248241 def __eq__ (self , other : Series [Timestamp ]) -> Series [bool ]: ... # type: ignore[overload-overlap]
249242 @overload
@@ -253,7 +246,7 @@ class Timestamp(datetime, SupportsIndex):
253246 @overload
254247 def __eq__ (self , other : object ) -> Literal [False ]: ...
255248 @overload
256- def __ne__ (self , other : Timestamp | datetime | np .datetime64 ) -> bool : ... # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
249+ def __ne__ (self , other : datetime | np .datetime64 | Self ) -> bool : ... # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
257250 @overload
258251 def __ne__ (self , other : Series [Timestamp ]) -> Series [bool ]: ... # type: ignore[overload-overlap]
259252 @overload
0 commit comments