mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-10-29 23:47:22 +08:00
move dateutil into 2and3 (#1743)
These stubs are identical since #1735.
This commit is contained in:
1 parent
b41c6dafee
commit
0eb7083f0e
12 files changed
-247
No files matched your search
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Whitespace-only changes.
Vendored
-45
@@ -1,45 +0,0 @@
|
||||
from typing import List, Tuple, Optional, Callable, Union, IO, Any, Dict, Mapping, Text
|
||||
from datetime import datetime, tzinfo
|
||||
|
||||
_FileOrStr = Union[bytes, Text, IO[str], IO[Any]]
|
||||
|
||||
__all__ = ... # type: List[str]
|
||||
|
||||
class parserinfo(object):
|
||||
JUMP = ... # type: List[str]
|
||||
WEEKDAYS = ... # type: List[Tuple[str, str]]
|
||||
MONTHS = ... # type: List[Tuple[str, str]]
|
||||
HMS = ... # type: List[Tuple[str, str, str]]
|
||||
AMPM = ... # type: List[Tuple[str, str]]
|
||||
UTCZONE = ... # type: List[str]
|
||||
PERTAIN = ... # type: List[str]
|
||||
TZOFFSET = ... # type: Dict[str, int]
|
||||
|
||||
def __init__(self, dayfirst: bool=..., yearfirst: bool=...) -> None: ...
|
||||
def jump(self, name: Text) -> bool: ...
|
||||
def weekday(self, name: Text) -> Optional[int]: ...
|
||||
def month(self, name: Text) -> Optional[int]: ...
|
||||
def hms(self, name: Text) -> Optional[int]: ...
|
||||
def ampm(self, name: Text) -> Optional[int]: ...
|
||||
def pertain(self, name: Text) -> bool: ...
|
||||
def utczone(self, name: Text) -> bool: ...
|
||||
def tzoffset(self, name: Text) -> Optional[int]: ...
|
||||
def convertyear(self, year: int) -> int: ...
|
||||
def validate(self, res: datetime) -> bool: ...
|
||||
|
||||
class parser(object):
|
||||
def __init__(self, info: Optional[parserinfo] = ...) -> None: ...
|
||||
def parse(self, timestr: _FileOrStr,
|
||||
default: Optional[datetime] = ...,
|
||||
ignoretz: bool = ..., tzinfos: Optional[Mapping[Text, tzinfo]] = ...,
|
||||
**kwargs: Any) -> datetime: ...
|
||||
|
||||
DEFAULTPARSER = ... # type: parser
|
||||
def parse(timestr: _FileOrStr, parserinfo: Optional[parserinfo] = ..., **kwargs: Any) -> datetime: ...
|
||||
class _tzparser: ...
|
||||
|
||||
DEFAULTTZPARSER = ... # type: _tzparser
|
||||
|
||||
class InvalidDatetimeError(ValueError): ...
|
||||
class InvalidDateError(InvalidDatetimeError): ...
|
||||
class InvalidTimeError(InvalidDatetimeError): ...
|
||||
-83
@@ -1,83 +0,0 @@
|
||||
from typing import overload, Any, List, Optional, SupportsFloat, TypeVar, Union
|
||||
from datetime import date, datetime, timedelta
|
||||
|
||||
__all__ = ... # type: List[str]
|
||||
|
||||
_SelfT = TypeVar('_SelfT', bound=relativedelta)
|
||||
_DateT = TypeVar('_DateT', date, datetime)
|
||||
|
||||
|
||||
class weekday(object):
|
||||
def __init__(self, weekday: int, n: Optional[int]=...) -> None: ...
|
||||
|
||||
def __call__(self, n: int) -> 'weekday': ...
|
||||
|
||||
def __eq__(self, other) -> bool: ...
|
||||
|
||||
def __repr__(self) -> str: ...
|
||||
|
||||
weekday = ... # type: int
|
||||
n = ... # type: int
|
||||
|
||||
MO = ... # type: weekday
|
||||
TU = ... # type: weekday
|
||||
WE = ... # type: weekday
|
||||
TH = ... # type: weekday
|
||||
FR = ... # type: weekday
|
||||
SA = ... # type: weekday
|
||||
SU = ... # type: weekday
|
||||
|
||||
|
||||
class relativedelta(object):
|
||||
def __init__(self,
|
||||
dt1: Optional[date]=...,
|
||||
dt2: Optional[date]=...,
|
||||
years: Optional[int]=..., months: Optional[int]=...,
|
||||
days: Optional[int]=..., leapdays: Optional[int]=...,
|
||||
weeks: Optional[int]=...,
|
||||
hours: Optional[int]=..., minutes: Optional[int]=...,
|
||||
seconds: Optional[int]=..., microseconds: Optional[int]=...,
|
||||
year: Optional[int]=..., month: Optional[int]=...,
|
||||
day: Optional[int]=...,
|
||||
weekday: Optional[Union[int, weekday]]=...,
|
||||
yearday: Optional[int]=...,
|
||||
nlyearday: Optional[int]=...,
|
||||
hour: Optional[int]=..., minute: Optional[int]=...,
|
||||
second: Optional[int]=...,
|
||||
microsecond: Optional[int]=...) -> None: ...
|
||||
@property
|
||||
def weeks(self) -> int: ...
|
||||
@weeks.setter
|
||||
def weeks(self, value: int) -> None: ...
|
||||
def normalized(self: _SelfT) -> _SelfT: ...
|
||||
# TODO: use Union when mypy will handle it properly in overloaded operator
|
||||
# methods (#2129, #1442, #1264 in mypy)
|
||||
@overload
|
||||
def __add__(self: _SelfT, other: relativedelta) -> _SelfT: ...
|
||||
@overload
|
||||
def __add__(self: _SelfT, other: timedelta) -> _SelfT: ...
|
||||
@overload
|
||||
def __add__(self, other: _DateT) -> _DateT: ...
|
||||
@overload
|
||||
def __radd__(self: _SelfT, other: relativedelta) -> _SelfT: ...
|
||||
@overload
|
||||
def __radd__(self: _SelfT, other: timedelta) -> _SelfT: ...
|
||||
@overload
|
||||
def __radd__(self, other: _DateT) -> _DateT: ...
|
||||
@overload
|
||||
def __rsub__(self: _SelfT, other: relativedelta) -> _SelfT: ...
|
||||
@overload
|
||||
def __rsub__(self: _SelfT, other: timedelta) -> _SelfT: ...
|
||||
@overload
|
||||
def __rsub__(self, other: _DateT) -> _DateT: ...
|
||||
def __sub__(self: _SelfT, other: relativedelta) -> _SelfT: ...
|
||||
def __neg__(self: _SelfT) -> _SelfT: ...
|
||||
def __bool__(self) -> bool: ...
|
||||
def __nonzero__(self) -> bool: ...
|
||||
def __mul__(self: _SelfT, other: SupportsFloat) -> _SelfT: ...
|
||||
def __rmul__(self: _SelfT, other: SupportsFloat) -> _SelfT: ...
|
||||
def __eq__(self, other) -> bool: ...
|
||||
def __ne__(self, other: object) -> bool: ...
|
||||
def __div__(self: _SelfT, other: SupportsFloat) -> _SelfT: ...
|
||||
def __truediv__(self: _SelfT, other: SupportsFloat) -> _SelfT: ...
|
||||
def __repr__(self) -> str: ...
|
||||
-12
@@ -1,12 +0,0 @@
|
||||
from .tz import (
|
||||
tzutc as tzutc,
|
||||
tzoffset as tzoffset,
|
||||
tzlocal as tzlocal,
|
||||
tzfile as tzfile,
|
||||
tzrange as tzrange,
|
||||
tzstr as tzstr,
|
||||
tzical as tzical,
|
||||
gettz as gettz,
|
||||
datetime_exists as datetime_exists,
|
||||
datetime_ambiguous as datetime_ambiguous,
|
||||
)
|
||||
-24
@@ -1,24 +0,0 @@
|
||||
from typing import Any, Optional
|
||||
from datetime import datetime, tzinfo, timedelta
|
||||
|
||||
def tzname_in_python2(namefunc): ...
|
||||
def enfold(dt: datetime, fold: int = ...): ...
|
||||
|
||||
class _DatetimeWithFold(datetime):
|
||||
@property
|
||||
def fold(self): ...
|
||||
|
||||
class _tzinfo(tzinfo):
|
||||
def is_ambiguous(self, dt: datetime) -> bool: ...
|
||||
def fromutc(self, dt: datetime) -> datetime: ...
|
||||
|
||||
class tzrangebase(_tzinfo):
|
||||
def __init__(self) -> None: ...
|
||||
def utcoffset(self, dt: Optional[datetime]) -> Optional[timedelta]: ...
|
||||
def dst(self, dt: Optional[datetime]) -> Optional[timedelta]: ...
|
||||
def tzname(self, dt: Optional[datetime]) -> str: ...
|
||||
def fromutc(self, dt: datetime) -> datetime: ...
|
||||
def is_ambiguous(self, dt: datetime) -> bool: ...
|
||||
__hash__ = ... # type: Any
|
||||
def __ne__(self, other): ...
|
||||
__reduce__ = ... # type: Any
|
||||
Vendored
-83
@@ -1,83 +0,0 @@
|
||||
from typing import Any, Optional, Union, IO, Text, Tuple, List
|
||||
import datetime
|
||||
from ._common import tzname_in_python2 as tzname_in_python2, _tzinfo as _tzinfo
|
||||
from ._common import tzrangebase as tzrangebase, enfold as enfold
|
||||
from ..relativedelta import relativedelta
|
||||
|
||||
_FileObj = Union[str, Text, IO[str], IO[Text]]
|
||||
|
||||
ZERO = ... # type: datetime.timedelta
|
||||
EPOCH = ... # type: datetime.datetime
|
||||
EPOCHORDINAL = ... # type: int
|
||||
|
||||
class tzutc(datetime.tzinfo):
|
||||
def utcoffset(self, dt: Optional[datetime.datetime]) -> Optional[datetime.timedelta]: ...
|
||||
def dst(self, dt: Optional[datetime.datetime]) -> Optional[datetime.timedelta]: ...
|
||||
def tzname(self, dt: Optional[datetime.datetime]) -> str: ...
|
||||
def is_ambiguous(self, dt: Optional[datetime.datetime]) -> bool: ...
|
||||
def __eq__(self, other): ...
|
||||
__hash__ = ... # type: Any
|
||||
def __ne__(self, other): ...
|
||||
__reduce__ = ... # type: Any
|
||||
|
||||
class tzoffset(datetime.tzinfo):
|
||||
def __init__(self, name, offset) -> None: ...
|
||||
def utcoffset(self, dt: Optional[datetime.datetime]) -> Optional[datetime.timedelta]: ...
|
||||
def dst(self, dt: Optional[datetime.datetime]) -> Optional[datetime.timedelta]: ...
|
||||
def is_ambiguous(self, dt: Optional[datetime.datetime]) -> bool: ...
|
||||
def tzname(self, dt: Optional[datetime.datetime]) -> str: ...
|
||||
def __eq__(self, other): ...
|
||||
__hash__ = ... # type: Any
|
||||
def __ne__(self, other): ...
|
||||
__reduce__ = ... # type: Any
|
||||
|
||||
class tzlocal(_tzinfo):
|
||||
def __init__(self) -> None: ...
|
||||
def utcoffset(self, dt: Optional[datetime.datetime]) -> Optional[datetime.timedelta]: ...
|
||||
def dst(self, dt: Optional[datetime.datetime]) -> Optional[datetime.timedelta]: ...
|
||||
def tzname(self, dt: Optional[datetime.datetime]) -> str: ...
|
||||
def is_ambiguous(self, dt: Optional[datetime.datetime]) -> bool: ...
|
||||
def __eq__(self, other): ...
|
||||
__hash__ = ... # type: Any
|
||||
def __ne__(self, other): ...
|
||||
__reduce__ = ... # type: Any
|
||||
|
||||
class _ttinfo:
|
||||
def __init__(self) -> None: ...
|
||||
def __eq__(self, other): ...
|
||||
__hash__ = ... # type: Any
|
||||
def __ne__(self, other): ...
|
||||
|
||||
class tzfile(_tzinfo):
|
||||
def __init__(self, fileobj: _FileObj, filename: Optional[Text] = ...) -> None: ...
|
||||
def is_ambiguous(self, dt: Optional[datetime.datetime], idx: Optional[int] = ...) -> bool: ...
|
||||
def utcoffset(self, dt: Optional[datetime.datetime]) -> Optional[datetime.timedelta]: ...
|
||||
def dst(self, dt: Optional[datetime.datetime]) -> Optional[datetime.timedelta]: ...
|
||||
def tzname(self, dt: Optional[datetime.datetime]) -> str: ...
|
||||
def __eq__(self, other): ...
|
||||
__hash__ = ... # type: Any
|
||||
def __ne__(self, other): ...
|
||||
def __reduce__(self): ...
|
||||
def __reduce_ex__(self, protocol): ...
|
||||
|
||||
class tzrange(tzrangebase):
|
||||
hasdst = ... # type: bool
|
||||
def __init__(self, stdabbr: Text, stdoffset: Union[int, datetime.timedelta, None] = ..., dstabbr: Optional[Text] = ..., dstoffset: Union[int, datetime.timedelta, None] = ..., start: Optional[relativedelta] = ..., end: Optional[relativedelta] = ...) -> None: ...
|
||||
def transitions(self, year: int) -> Tuple[datetime.datetime, datetime.datetime]: ...
|
||||
def __eq__(self, other): ...
|
||||
|
||||
class tzstr(tzrange):
|
||||
hasdst = ... # type: bool
|
||||
def __init__(self, s: Union[bytes, _FileObj], posix_offset: bool = ...) -> None: ...
|
||||
|
||||
class tzical:
|
||||
def __init__(self, fileobj: _FileObj) -> None: ...
|
||||
def keys(self): ...
|
||||
def get(self, tzid: Optional[Any] = ...): ...
|
||||
|
||||
TZFILES = ... # type: List[str]
|
||||
TZPATHS = ... # type: 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: ...
|
||||
Reference in new issue
Block a user