Skip to content

Commit 79f56c2

Browse files
committed
ENH: Further improvements to Timestamp
1 parent d86adfd commit 79f56c2

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

pandas-stubs/_libs/tslibs/timestamps.pyi

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@ from datetime import (
88
from time import struct_time
99
from typing import (
1010
ClassVar,
11+
Literal,
1112
TypeVar,
1213
overload,
1314
)
1415

16+
from dateutil.tz import tzfile
1517
import numpy as np
1618
from pandas import Index
1719
from pandas.core.series import (
@@ -38,9 +40,9 @@ class Timestamp(datetime):
3840
def __new__(
3941
cls: type[_DatetimeT],
4042
ts_input: np.integer | float | str | _date | datetime | np.datetime64 = ...,
41-
freq: int | str | BaseOffset | None = ...,
42-
tz: str | _tzinfo | int | None = ...,
43-
unit: str | int | None = ...,
43+
freq: str | BaseOffset | None = ...,
44+
tz: str | _tzinfo | tzfile | None = ...,
45+
unit: Literal["D", "h", "m", "s", "ms", "us", "ns"] | None = ...,
4446
year: int | None = ...,
4547
month: int | None = ...,
4648
day: int | None = ...,
@@ -51,7 +53,7 @@ class Timestamp(datetime):
5153
nanosecond: int | None = ...,
5254
tzinfo: _tzinfo | None = ...,
5355
*,
54-
fold: int | None = ...,
56+
fold: Literal[0, 1] | None = ...,
5557
) -> _DatetimeT: ...
5658
# GH 46171
5759
# While Timestamp can return pd.NaT, having the constructor return

0 commit comments

Comments
 (0)