Skip to content

Commit d86adfd

Browse files
committed
ENH: Improve Timedelta
1 parent c4dca27 commit d86adfd

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

pandas-stubs/_libs/tslibs/timedeltas.pyi

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,19 @@ class Timedelta(timedelta):
8686
min: ClassVar[Timedelta]
8787
max: ClassVar[Timedelta]
8888
resolution: ClassVar[Timedelta]
89-
value: int # np.int64
89+
value: int
9090
def __new__(
9191
cls: type[_S],
92-
value=...,
93-
unit: str = ...,
94-
**kwargs: float | np.integer | np.floating,
92+
value: str | int | Timedelta | timedelta | np.timedelta64 = ...,
93+
unit: TimeDeltaUnitChoices = ...,
94+
*,
95+
days: float | np.integer | np.floating = ...,
96+
seconds: float | np.integer | np.floating = ...,
97+
microseconds: float | np.integer | np.floating = ...,
98+
milliseconds: float | np.integer | np.floating = ...,
99+
minutes: float | np.integer | np.floating = ...,
100+
hours: float | np.integer | np.floating = ...,
101+
weeks: float | np.integer | np.floating = ...,
95102
) -> _S: ...
96103
# GH 46171
97104
# While Timedelta can return pd.NaT, having the constructor return
@@ -154,3 +161,7 @@ class Timedelta(timedelta):
154161
def __hash__(self) -> int: ...
155162
def isoformat(self) -> str: ...
156163
def to_numpy(self) -> np.timedelta64: ...
164+
@property
165+
def freq(self) -> None: ...
166+
@property
167+
def is_populated(self) -> bool: ...

0 commit comments

Comments
 (0)