Add stubs for dateutil.relativedelta (#421)

This commit is contained in:
Roy Williams
2016-08-03 18:39:12 -04:00
committed by Matthias Kramm
parent 2e560d38dc
commit 07bf49f55a
2 changed files with 172 additions and 0 deletions

View File

@@ -0,0 +1,86 @@
from typing import Any, Optional, Union
from datetime import date, datetime, timedelta
__all__ = ... # type: List[str]
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) -> 'relativedelta': ...
def __add__(
self,
other: Union['relativedelta', timedelta, date, datetime]) -> 'relativedelta': ...
def __radd__(
self,
other: Any) -> 'relativedelta': ...
def __rsub__(
self,
other: Any) -> 'relativedelta': ...
def __sub__(self, other: 'relativedelta') -> 'relativedelta': ...
def __neg__(self) -> 'relativedelta': ...
def __bool__(self) -> bool: ...
def __nonzero__(self) -> bool: ...
def __mul__(self, other: float) -> 'relativedelta': ...
def __rmul__(self, other: float) -> 'relativedelta': ...
def __eq__(self, other) -> bool: ...
def __ne__(self, other: object) -> bool: ...
def __div__(self, other: float) -> 'relativedelta': ...
def __truediv__(self, other: float) -> 'relativedelta': ...
def __repr__(self) -> str: ...

View File

@@ -0,0 +1,86 @@
from typing import Any, Optional, Union
from datetime import date, datetime, timedelta
__all__ = ... # type: List[str]
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) -> 'relativedelta': ...
def __add__(
self,
other: Union['relativedelta', timedelta, date, datetime]) -> 'relativedelta': ...
def __radd__(
self,
other: Any) -> 'relativedelta': ...
def __rsub__(
self,
other: Any) -> 'relativedelta': ...
def __sub__(self, other: 'relativedelta') -> 'relativedelta': ...
def __neg__(self) -> 'relativedelta': ...
def __bool__(self) -> bool: ...
def __nonzero__(self) -> bool: ...
def __mul__(self, other: float) -> 'relativedelta': ...
def __rmul__(self, other: float) -> 'relativedelta': ...
def __eq__(self, other) -> bool: ...
def __ne__(self, other: object) -> bool: ...
def __div__(self, other: float) -> 'relativedelta': ...
def __truediv__(self, other: float) -> 'relativedelta': ...
def __repr__(self) -> str: ...