Skip to content

TYP: use type annotations in timezones.pyi #41769

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 1, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 10 additions & 17 deletions pandas/_libs/tslibs/timezones.pyi
Original file line number Diff line number Diff line change
@@ -1,32 +1,25 @@
from __future__ import annotations

from datetime import (
datetime,
tzinfo,
)
from typing import (
Callable,
Optional,
Union,
)
from typing import Callable

import numpy as np

# imported from dateutil.tz
dateutil_gettz: Callable[[str], tzinfo]


def tz_standardize(tz: tzinfo) -> tzinfo: ...

def tz_compare(start: Optional[tzinfo], end: Optional[tzinfo]) -> bool: ...

def tz_compare(start: tzinfo | None, end: tzinfo | None) -> bool: ...
def infer_tzinfo(
start: Optional[datetime], end: Optional[datetime],
) -> Optional[tzinfo]: ...
start: datetime | None,
end: datetime | None,
) -> tzinfo | None: ...

# ndarrays returned are both int64_t
def get_dst_info(tz: tzinfo) -> tuple[np.ndarray, np.ndarray, str]: ...

def maybe_get_tz(tz: Optional[Union[str, int, np.int64, tzinfo]]) -> Optional[tzinfo]: ...

def get_timezone(tz: tzinfo) -> Union[tzinfo, str]: ...

def is_utc(tz: Optional[tzinfo]) -> bool: ...
def maybe_get_tz(tz: str | int | np.int64 | tzinfo | None) -> tzinfo | None: ...
def get_timezone(tz: tzinfo) -> tzinfo | str: ...
def is_utc(tz: tzinfo | None) -> bool: ...