Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
1 change: 0 additions & 1 deletion pyrightconfig.stricter.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@
"stubs/pycurl",
"stubs/Pygments",
"stubs/PyMySQL",
"stubs/python-dateutil",
"stubs/python-jose",
"stubs/pywin32",
"stubs/PyYAML",
Expand Down
2 changes: 1 addition & 1 deletion stubs/python-dateutil/dateutil/parser/_parser.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ class _tzparser:
day: int | None
time: int | None

def __init__(self): ...
def __init__(self) -> None: ...

def parse(self, tzstr: str | re.Pattern[str]) -> _result | None: ...

Expand Down
2 changes: 1 addition & 1 deletion stubs/python-dateutil/dateutil/parser/isoparser.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ _TakesAscii: TypeAlias = str | bytes | _Readable
__all__ = ["isoparse", "isoparser"]

class isoparser:
def __init__(self, sep: str | bytes | None = None): ...
def __init__(self, sep: str | bytes | None = None) -> None: ...
def isoparse(self, dt_str: _TakesAscii) -> datetime: ...
def parse_isodate(self, datestr: _TakesAscii) -> date: ...
def parse_isotime(self, timestr: _TakesAscii) -> time: ...
Expand Down
4 changes: 2 additions & 2 deletions stubs/python-dateutil/dateutil/rrule.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ class rrulebase:
def __getitem__(self, item: int | slice) -> datetime.datetime: ...
def __contains__(self, item: datetime.datetime) -> bool: ...
def count(self) -> int | None: ...
def before(self, dt: datetime.datetime, inc: bool = False): ...
def after(self, dt: datetime.datetime, inc: bool = False): ...
def before(self, dt: datetime.datetime, inc: bool = False) -> datetime.datetime: ...
def after(self, dt: datetime.datetime, inc: bool = False) -> datetime.datetime: ...
Comment thread
donbarbos marked this conversation as resolved.
Outdated
def xafter(self, dt: datetime.datetime, count: int | None = None, inc: bool = False) -> Generator[datetime.datetime]: ...
def between(
self, after: datetime.datetime, before: datetime.datetime, inc: bool = False, count: int = 1
Expand Down
3 changes: 2 additions & 1 deletion stubs/python-dateutil/dateutil/tz/_common.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ __all__ = ["tzname_in_python2", "enfold"]

_P = ParamSpec("_P")
_R = TypeVar("_R")
_DateTimeT = TypeVar("_DateTimeT", bound=datetime)

def tzname_in_python2(namefunc: Callable[_P, _R]) -> Callable[_P, _R]: ...
def enfold(dt: datetime, fold: int = 1): ...
def enfold(dt: _DateTimeT, fold: int = 1) -> _DateTimeT: ...

# Doesn't actually have ABCMeta as the metaclass at runtime,
# but mypy complains if we don't have it in the stub.
Expand Down
8 changes: 4 additions & 4 deletions stubs/python-dateutil/dateutil/tz/tz.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ else:
tzwin: None
tzwinlocal: None

_DT = TypeVar("_DT", bound=datetime)
_DateTimeT = TypeVar("_DateTimeT", bound=datetime)

ZERO: timedelta
EPOCH: datetime
Expand All @@ -24,7 +24,7 @@ class tzutc(tzinfo):
def dst(self, dt: datetime | None) -> timedelta | None: ...
def tzname(self, dt: datetime | None) -> str: ...
def is_ambiguous(self, dt: datetime | None) -> bool: ...
def fromutc(self, dt: _DT) -> _DT: ...
def fromutc(self, dt: _DateTimeT) -> _DateTimeT: ...
def __eq__(self, other: object) -> bool: ...
__hash__: ClassVar[None] # type: ignore[assignment]
def __ne__(self, other: object) -> bool: ...
Expand All @@ -38,7 +38,7 @@ class tzoffset(tzinfo):
def dst(self, dt: datetime | None) -> timedelta | None: ...
def is_ambiguous(self, dt: datetime | None) -> bool: ...
def tzname(self, dt: datetime | None) -> str: ...
def fromutc(self, dt: _DT) -> _DT: ...
def fromutc(self, dt: _DateTimeT) -> _DateTimeT: ...
def __eq__(self, other: object) -> bool: ...
__hash__: ClassVar[None] # type: ignore[assignment]
def __ne__(self, other: object) -> bool: ...
Expand Down Expand Up @@ -126,7 +126,7 @@ TZPATHS: list[str]

def datetime_exists(dt: datetime, tz: tzinfo | None = None) -> bool: ...
def datetime_ambiguous(dt: datetime, tz: tzinfo | None = None) -> bool: ...
def resolve_imaginary(dt: datetime) -> datetime: ...
def resolve_imaginary(dt: _DateTimeT) -> _DateTimeT: ...

# Singleton type defined locally in a function. Calls itself "GettzFunc".
@type_check_only
Expand Down
5 changes: 4 additions & 1 deletion stubs/python-dateutil/dateutil/utils.pyi
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
from datetime import _TzInfo, datetime, timedelta
from typing import TypeVar

_DateTimeT = TypeVar("_DateTimeT", bound=datetime)

def today(tzinfo: _TzInfo | None = None) -> datetime: ...
def default_tzinfo(dt: datetime, tzinfo: _TzInfo) -> datetime: ...
def default_tzinfo(dt: _DateTimeT, tzinfo: _TzInfo) -> _DateTimeT: ...
def within_delta(dt1: datetime, dt2: datetime, delta: timedelta) -> bool: ...