Skip to content

Commit f1d1fe9

Browse files
committed
[python-dateutil] add some more missing paramater type annotations
1 parent e524443 commit f1d1fe9

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed

stubs/python-dateutil/dateutil/tz/_common.pyi

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
import abc
2+
from collections.abc import Callable
23
from datetime import datetime, timedelta, tzinfo
3-
from typing import ClassVar
4+
from typing import ClassVar, TypeVar
5+
from typing_extensions import ParamSpec
46

57
ZERO: timedelta
68

79
__all__ = ["tzname_in_python2", "enfold"]
810

9-
def tzname_in_python2(namefunc): ...
11+
_P = ParamSpec("_P")
12+
_R = TypeVar("_R")
13+
14+
def tzname_in_python2(namefunc: Callable[_P, _R]) -> Callable[_P, _R]: ...
1015
def enfold(dt: datetime, fold: int = 1): ...
1116

1217
# Doesn't actually have ABCMeta as the metaclass at runtime,

stubs/python-dateutil/dateutil/tz/win.pyi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ if sys.platform == "win32":
1818

1919
class tzres:
2020
p_wchar: ClassVar[type[_Pointer[c_wchar]]]
21-
def __init__(self, tzres_loc="tzres.dll"): ...
22-
def load_name(self, offset): ...
23-
def name_from_string(self, tzname_str: str): ...
21+
def __init__(self, tzres_loc: str = "tzres.dll") -> None: ...
22+
def load_name(self, offset: int) -> str: ...
23+
def name_from_string(self, tzname_str: str) -> str: ...
2424

2525
def picknthweekday(year: int, month: int, dayofweek: int, hour: int, minute: int, whichweek: int) -> datetime: ...
2626
def valuestodict(key: _KeyType) -> dict[str, Any]: ... # keys and values in dict are results of winreg.EnumValue() function
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
from _typeshed import StrOrBytesPath
22
from collections.abc import Iterable
3+
from typing import Any
34

4-
def rebuild(filename: StrOrBytesPath, tag=None, format: str = "gz", zonegroups: Iterable[str] = [], metadata=None) -> None: ...
5+
def rebuild(
6+
filename: StrOrBytesPath, tag=None, format: str = "gz", zonegroups: Iterable[str] = [], metadata: dict[str, Any] | None = None
7+
) -> None: ...

0 commit comments

Comments
 (0)