Skip to content
Open
Show file tree
Hide file tree
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
9 changes: 7 additions & 2 deletions stubs/python-dateutil/dateutil/tz/_common.pyi
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
9 changes: 5 additions & 4 deletions stubs/python-dateutil/dateutil/tz/win.pyi
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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
6 changes: 5 additions & 1 deletion stubs/python-dateutil/dateutil/zoneinfo/rebuild.pyi
Original file line number Diff line number Diff line change
@@ -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: ...