Skip to content

Commit e4727df

Browse files
committed
pyright unhappy
1 parent de538e8 commit e4727df

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

pandas-stubs/_libs/tslibs/timestamps.pyi

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ from datetime import (
77
tzinfo as _tzinfo,
88
)
99
from datetime import _IsoCalendarDate # pyright: ignore[reportPrivateUsage]
10+
import sys
1011
from time import struct_time
1112
from typing import (
1213
ClassVar,
@@ -96,10 +97,15 @@ class Timestamp(datetime, SupportsIndex):
9697
def tz(self) -> _tzinfo | None: ...
9798
@property
9899
def fold(self) -> int: ...
99-
@classmethod
100-
def fromtimestamp( # pyright: ignore[reportIncompatibleMethodOverride]
101-
cls, t: float, tz: _tzinfo | str | None = ...
102-
) -> Self: ...
100+
if sys.version_info >= (3, 12):
101+
@classmethod
102+
def fromtimestamp( # pyright: ignore[reportIncompatibleMethodOverride]
103+
cls, t: float, tz: _tzinfo | str | None = ...
104+
) -> Self: ...
105+
else:
106+
@classmethod
107+
def fromtimestamp(cls, t: float, tz: _tzinfo | str | None = ...) -> Self: ...
108+
103109
@classmethod
104110
def utcfromtimestamp(cls, ts: float) -> Self: ...
105111
@classmethod

0 commit comments

Comments
 (0)