[python-dateutil] Add missing parameter annotations (#14996)

This commit is contained in:
lev-blit
2025-11-14 23:05:09 +02:00
committed by GitHub
parent 354b33a70c
commit e10d41451f
3 changed files with 17 additions and 7 deletions
@@ -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,
+5 -4
View File
@@ -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
@@ -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: ...