Update dateutil to 2.7.5 (#2694)

This is still missing the easter and tzinfo module, but includes newer
functions like today and isoparse.
This commit is contained in:
Simon Kohlmeyer
2019-05-13 16:58:43 +02:00
committed by Jelle Zijlstra
parent 897148073a
commit a868221347
6 changed files with 28 additions and 1 deletions

View File

@@ -9,5 +9,7 @@ class weekday(object):
def __repr__(self) -> str: ...
def __hash__(self) -> int: ...
weekday: int
n: int

View File

@@ -33,6 +33,8 @@ class parser(object):
ignoretz: bool = ..., tzinfos: Optional[Mapping[Text, tzinfo]] = ...,
**kwargs: Any) -> datetime: ...
def isoparse(dt_str: Union[str, bytes, IO[str], IO[bytes]]) -> datetime: ...
DEFAULTPARSER: parser
def parse(timestr: _FileOrStr, parserinfo: Optional[parserinfo] = ..., **kwargs: Any) -> datetime: ...
class _tzparser: ...

View File

@@ -87,3 +87,5 @@ class relativedelta(object):
def __div__(self: _SelfT, other: SupportsFloat) -> _SelfT: ...
def __truediv__(self: _SelfT, other: SupportsFloat) -> _SelfT: ...
def __repr__(self) -> str: ...
def __abs__(self: _SelfT) -> _SelfT: ...
def __hash__(self) -> int: ...

View File

@@ -9,6 +9,7 @@ from .tz import (
gettz as gettz,
datetime_exists as datetime_exists,
datetime_ambiguous as datetime_ambiguous,
resolve_imaginary as resolve_imaginary,
)
UTC: tzutc

View File

@@ -31,6 +31,9 @@ class tzoffset(datetime.tzinfo):
def __ne__(self, other): ...
__reduce__: Any
@classmethod
def instance(cls, name, offset) -> tzoffset: ...
class tzlocal(_tzinfo):
def __init__(self) -> None: ...
def utcoffset(self, dt: Optional[datetime.datetime]) -> Optional[datetime.timedelta]: ...
@@ -70,6 +73,9 @@ class tzstr(tzrange):
hasdst: bool
def __init__(self, s: Union[bytes, _FileObj], posix_offset: bool = ...) -> None: ...
@classmethod
def instance(cls, name, offset) -> tzoffset: ...
class tzical:
def __init__(self, fileobj: _FileObj) -> None: ...
def keys(self): ...
@@ -78,6 +84,13 @@ class tzical:
TZFILES: List[str]
TZPATHS: List[str]
def gettz(name: Optional[Text] = ...) -> Optional[datetime.tzinfo]: ...
def datetime_exists(dt: datetime.datetime, tz: Optional[datetime.tzinfo] = ...) -> bool: ...
def datetime_ambiguous(dt: datetime.datetime, tz: Optional[datetime.tzinfo] = ...) -> bool: ...
def resolve_imaginary(dt: datetime.datetime) -> datetime.datetime: ...
class _GetTZ:
def __call__(self, name: Optional[Text] = ...) -> Optional[datetime.tzinfo]: ...
def nocache(self, name: Optional[Text]) -> Optional[datetime.tzinfo]: ...
gettz: _GetTZ

7
third_party/2and3/dateutil/utils.pyi vendored Normal file
View File

@@ -0,0 +1,7 @@
from typing import Optional
from datetime import datetime, tzinfo, timedelta
def default_tzinfo(dt: datetime, tzinfo: tzinfo) -> datetime: ...
def today(tzinfo: Optional[tzinfo] = ...) -> datetime: ...
def within_delta(dt1: datetime, dt2: datetime, delta: timedelta) -> bool: ...