From fe67f034f23c52709cba7ba9708ea28aa10eeeaa Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Tue, 4 Apr 2023 13:33:54 +0100 Subject: [PATCH] Various improvements to `dateutil.rrule` stubs (#10009) --- stubs/python-dateutil/dateutil/rrule.pyi | 57 ++++++++++++------------ 1 file changed, 28 insertions(+), 29 deletions(-) diff --git a/stubs/python-dateutil/dateutil/rrule.pyi b/stubs/python-dateutil/dateutil/rrule.pyi index cef65be06..f091cfbd6 100644 --- a/stubs/python-dateutil/dateutil/rrule.pyi +++ b/stubs/python-dateutil/dateutil/rrule.pyi @@ -1,7 +1,6 @@ import datetime from _typeshed import Incomplete -from collections.abc import Iterable, Iterator -from typing import Any +from collections.abc import Iterable, Iterator, Sequence from typing_extensions import TypeAlias from ._common import weekday as weekdaybase @@ -59,23 +58,25 @@ class rrule(rrulebase): ) -> None: ... def replace(self, **kwargs): ... +_RRule: TypeAlias = rrule + class _iterinfo: - rrule: Any = ... - def __init__(self, rrule) -> None: ... - yearlen: int = ... - nextyearlen: int = ... - yearordinal: int = ... - yearweekday: int = ... - mmask: Any = ... - mdaymask: Any = ... - nmdaymask: Any = ... - wdaymask: Any = ... - mrange: Any = ... - wnomask: Any = ... - nwdaymask: Any = ... - eastermask: Any = ... - lastyear: int = ... - lastmonth: int = ... + rrule: _RRule + def __init__(self, rrule: _RRule) -> None: ... + yearlen: int | None + nextyearlen: int | None + yearordinal: int | None + yearweekday: int | None + mmask: Sequence[int] | None + mdaymask: Sequence[int] | None + nmdaymask: Sequence[int] | None + wdaymask: Sequence[int] | None + mrange: Sequence[int] | None + wnomask: Sequence[int] | None + nwdaymask: Sequence[int] | None + eastermask: Sequence[int] | None + lastyear: int | None + lastmonth: int | None def rebuild(self, year, month): ... def ydayset(self, year, month, day): ... def mdayset(self, year, month, day): ... @@ -85,20 +86,18 @@ class _iterinfo: def mtimeset(self, hour, minute, second): ... def stimeset(self, hour, minute, second): ... -_RRule: TypeAlias = rrule - class rruleset(rrulebase): class _genitem: - dt: Any = ... - genlist: Any = ... - gen: Any = ... + dt: Incomplete + genlist: list[Incomplete] + gen: Incomplete def __init__(self, genlist, gen) -> None: ... - def __next__(self): ... - next: Any = ... - def __lt__(self, other): ... - def __gt__(self, other): ... - def __eq__(self, other): ... - def __ne__(self, other): ... + def __next__(self) -> None: ... + next = __next__ + def __lt__(self, other) -> bool: ... + def __gt__(self, other) -> bool: ... + def __eq__(self, other) -> bool: ... + def __ne__(self, other) -> bool: ... def __init__(self, cache: bool = False) -> None: ... def rrule(self, rrule: _RRule): ...