Skip to content

[dateparser] Improve parse-related annotations #14199

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 31, 2025
Merged
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
4 changes: 3 additions & 1 deletion stubs/dateparser/dateparser/calendars/__init__.pyi
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
from _typeshed import Incomplete
from abc import abstractmethod
from typing import Any

from dateparser.conf import Settings
from dateparser.parser import _parser

class CalendarBase:
Expand All @@ -20,4 +22,4 @@ class non_gregorian_parser(_parser):
@abstractmethod
def handle_two_digit_year(self, year: int) -> int: ...
@classmethod
def parse(cls, datestring, settings): ...
def parse(cls, datestring: str, settings: Settings) -> tuple[Incomplete, Incomplete]: ... # type: ignore[override]
2 changes: 1 addition & 1 deletion stubs/dateparser/dateparser/parser.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class _parser:
ordered_num_directives: collections.OrderedDict[str, list[str]]
def __init__(self, tokens, settings: Settings): ...
@classmethod
def parse(cls, datestring: str, settings: Settings, tz: datetime.tzinfo | None = None): ...
def parse(cls, datestring: str, settings: Settings, tz: datetime.tzinfo | None = None) -> tuple[Incomplete, Incomplete]: ...

class tokenizer:
digits: Literal["0123456789:"]
Expand Down