mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-15 08:17:07 +08:00
Add missing attributes to the dateutil/relativedelta stub (#2319)
I have deduced the types from docstring & source code of the relativedelta class. Fixes #2269.
This commit is contained in:
committed by
Jelle Zijlstra
parent
a38dbc6c1e
commit
cadacab088
34
third_party/2and3/dateutil/relativedelta.pyi
vendored
34
third_party/2and3/dateutil/relativedelta.pyi
vendored
@@ -6,17 +6,35 @@ from ._common import weekday
|
||||
|
||||
_SelfT = TypeVar('_SelfT', bound=relativedelta)
|
||||
_DateT = TypeVar('_DateT', date, datetime)
|
||||
# Work around attribute and type having the same name.
|
||||
_weekday = weekday
|
||||
|
||||
MO = ... # type: weekday
|
||||
TU = ... # type: weekday
|
||||
WE = ... # type: weekday
|
||||
TH = ... # type: weekday
|
||||
FR = ... # type: weekday
|
||||
SA = ... # type: weekday
|
||||
SU = ... # type: weekday
|
||||
MO: weekday
|
||||
TU: weekday
|
||||
WE: weekday
|
||||
TH: weekday
|
||||
FR: weekday
|
||||
SA: weekday
|
||||
SU: weekday
|
||||
|
||||
|
||||
class relativedelta(object):
|
||||
years: int
|
||||
months: int
|
||||
days: int
|
||||
leapdays: int
|
||||
hours: int
|
||||
minutes: int
|
||||
seconds: int
|
||||
microseconds: int
|
||||
year: Optional[int]
|
||||
month: Optional[int]
|
||||
weekday: Optional[_weekday]
|
||||
day: Optional[int]
|
||||
hour: Optional[int]
|
||||
minute: Optional[int]
|
||||
second: Optional[int]
|
||||
microsecond: Optional[int]
|
||||
def __init__(self,
|
||||
dt1: Optional[date]=...,
|
||||
dt2: Optional[date]=...,
|
||||
@@ -27,7 +45,7 @@ class relativedelta(object):
|
||||
seconds: Optional[int]=..., microseconds: Optional[int]=...,
|
||||
year: Optional[int]=..., month: Optional[int]=...,
|
||||
day: Optional[int]=...,
|
||||
weekday: Optional[Union[int, weekday]]=...,
|
||||
weekday: Optional[Union[int, _weekday]]=...,
|
||||
yearday: Optional[int]=...,
|
||||
nlyearday: Optional[int]=...,
|
||||
hour: Optional[int]=..., minute: Optional[int]=...,
|
||||
|
||||
Reference in New Issue
Block a user