DateTimeRange: complete stubs (#8168)

Co-authored-by: hauntsaninja <>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
This commit is contained in:
Shantanu
2022-06-26 15:21:00 +05:30
committed by GitHub
parent a81c695cd6
commit bef4a5ff65
2 changed files with 14 additions and 1 deletions

View File

@@ -1,2 +1,5 @@
version = "1.2.*"
requires = ["types-python-dateutil"]
[tool.stubtest]
ignore_missing_stub = false

View File

@@ -1,11 +1,15 @@
import datetime
from _typeshed import Self
from collections.abc import Iterable
from typing import ClassVar
from dateutil.relativedelta import relativedelta
__license__: str
__email__: str
class DateTimeRange:
NOT_A_TIME_STR: str
NOT_A_TIME_STR: ClassVar[str]
start_time_format: str
end_time_format: str
is_output_elapse: bool
@@ -17,6 +21,10 @@ class DateTimeRange:
start_time_format: str = ...,
end_time_format: str = ...,
) -> None: ...
@classmethod
def from_range_text(
cls, range_text: str, separator: str = ..., start_time_format: str | None = ..., end_time_format: str | None = ...
) -> DateTimeRange: ...
def __eq__(self, other: object) -> bool: ...
def __ne__(self, other: object) -> bool: ...
def __add__(self, other: datetime.timedelta) -> DateTimeRange: ...
@@ -44,3 +52,5 @@ class DateTimeRange:
def intersection(self, x: DateTimeRange) -> DateTimeRange: ...
def encompass(self, x: DateTimeRange) -> DateTimeRange: ...
def truncate(self, percentage: float) -> None: ...
def split(self, separator: str | datetime.datetime) -> list[DateTimeRange]: ...
def subtract(self, x: DateTimeRange) -> DateTimeRange: ...