diff --git a/stubs/python-dateutil/dateutil/tz/_common.pyi b/stubs/python-dateutil/dateutil/tz/_common.pyi index 430dabab3a7e..23bce452e8bb 100644 --- a/stubs/python-dateutil/dateutil/tz/_common.pyi +++ b/stubs/python-dateutil/dateutil/tz/_common.pyi @@ -1,12 +1,17 @@ import abc +from collections.abc import Callable from datetime import datetime, timedelta, tzinfo -from typing import ClassVar +from typing import ClassVar, TypeVar +from typing_extensions import ParamSpec ZERO: timedelta __all__ = ["tzname_in_python2", "enfold"] -def tzname_in_python2(namefunc): ... +_P = ParamSpec("_P") +_R = TypeVar("_R") + +def tzname_in_python2(namefunc: Callable[_P, _R]) -> Callable[_P, _R]: ... def enfold(dt: datetime, fold: int = 1): ... # Doesn't actually have ABCMeta as the metaclass at runtime, diff --git a/stubs/python-dateutil/dateutil/tz/win.pyi b/stubs/python-dateutil/dateutil/tz/win.pyi index bae9c4e9956a..8d02d23acb01 100644 --- a/stubs/python-dateutil/dateutil/tz/win.pyi +++ b/stubs/python-dateutil/dateutil/tz/win.pyi @@ -1,5 +1,5 @@ import sys -from ctypes import _Pointer, c_wchar +from ctypes import _NameTypes, _Pointer, c_wchar from datetime import datetime, timedelta from typing import Any, ClassVar, Final @@ -18,9 +18,10 @@ if sys.platform == "win32": class tzres: p_wchar: ClassVar[type[_Pointer[c_wchar]]] - def __init__(self, tzres_loc="tzres.dll"): ... - def load_name(self, offset): ... - def name_from_string(self, tzname_str: str): ... + tzres_loc: _NameTypes + def __init__(self, tzres_loc: _NameTypes = "tzres.dll") -> None: ... + def load_name(self, offset: int) -> str: ... + def name_from_string(self, tzname_str: str) -> str: ... def picknthweekday(year: int, month: int, dayofweek: int, hour: int, minute: int, whichweek: int) -> datetime: ... def valuestodict(key: _KeyType) -> dict[str, Any]: ... # keys and values in dict are results of winreg.EnumValue() function diff --git a/stubs/python-dateutil/dateutil/zoneinfo/rebuild.pyi b/stubs/python-dateutil/dateutil/zoneinfo/rebuild.pyi index 9aae2bdcba44..a8a8655b214d 100644 --- a/stubs/python-dateutil/dateutil/zoneinfo/rebuild.pyi +++ b/stubs/python-dateutil/dateutil/zoneinfo/rebuild.pyi @@ -1,4 +1,8 @@ from _typeshed import StrOrBytesPath from collections.abc import Iterable -def rebuild(filename: StrOrBytesPath, tag=None, format: str = "gz", zonegroups: Iterable[str] = [], metadata=None) -> None: ... +from ..zoneinfo import _MetadataType + +def rebuild( + filename: StrOrBytesPath, tag=None, format: str = "gz", zonegroups: Iterable[str] = [], metadata: _MetadataType | None = None +) -> None: ...