massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / coc-python-data / languageServer.0.5.59 / Typeshed / stdlib / 2and3 / datetime.pyi
1 import sys\r
2 from time import struct_time\r
3 from typing import (\r
4     AnyStr, Optional, SupportsAbs, Tuple, Union, overload,\r
5     ClassVar,\r
6 )\r
7 \r
8 if sys.version_info >= (3,):\r
9     _Text = str\r
10 else:\r
11     _Text = Union[str, unicode]\r
12 \r
13 MINYEAR: int\r
14 MAXYEAR: int\r
15 \r
16 class tzinfo:\r
17     def tzname(self, dt: Optional[datetime]) -> Optional[str]: ...\r
18     def utcoffset(self, dt: Optional[datetime]) -> Optional[timedelta]: ...\r
19     def dst(self, dt: Optional[datetime]) -> Optional[timedelta]: ...\r
20     def fromutc(self, dt: datetime) -> datetime: ...\r
21 \r
22 if sys.version_info >= (3, 2):\r
23     class timezone(tzinfo):\r
24         utc: ClassVar[timezone]\r
25         min: ClassVar[timezone]\r
26         max: ClassVar[timezone]\r
27 \r
28         def __init__(self, offset: timedelta, name: str = ...) -> None: ...\r
29         def __hash__(self) -> int: ...\r
30 \r
31 _tzinfo = tzinfo\r
32 \r
33 class date:\r
34     min: ClassVar[date]\r
35     max: ClassVar[date]\r
36     resolution: ClassVar[timedelta]\r
37 \r
38     def __init__(self, year: int, month: int, day: int) -> None: ...\r
39 \r
40     @classmethod\r
41     def fromtimestamp(cls, t: float) -> date: ...\r
42     @classmethod\r
43     def today(cls) -> date: ...\r
44     @classmethod\r
45     def fromordinal(cls, n: int) -> date: ...\r
46 \r
47     @property\r
48     def year(self) -> int: ...\r
49     @property\r
50     def month(self) -> int: ...\r
51     @property\r
52     def day(self) -> int: ...\r
53 \r
54     def ctime(self) -> str: ...\r
55     def strftime(self, fmt: _Text) -> str: ...\r
56     if sys.version_info >= (3,):\r
57         def __format__(self, fmt: str) -> str: ...\r
58     else:\r
59         def __format__(self, fmt: AnyStr) -> AnyStr: ...\r
60     def isoformat(self) -> str: ...\r
61     def timetuple(self) -> struct_time: ...\r
62     def toordinal(self) -> int: ...\r
63     def replace(self, year: int = ..., month: int = ..., day: int = ...) -> date: ...\r
64     def __le__(self, other: date) -> bool: ...\r
65     def __lt__(self, other: date) -> bool: ...\r
66     def __ge__(self, other: date) -> bool: ...\r
67     def __gt__(self, other: date) -> bool: ...\r
68     def __add__(self, other: timedelta) -> date: ...\r
69     @overload\r
70     def __sub__(self, other: timedelta) -> date: ...\r
71     @overload\r
72     def __sub__(self, other: date) -> timedelta: ...\r
73     def __hash__(self) -> int: ...\r
74     def weekday(self) -> int: ...\r
75     def isoweekday(self) -> int: ...\r
76     def isocalendar(self) -> Tuple[int, int, int]: ...\r
77 \r
78 class time:\r
79     min: ClassVar[time]\r
80     max: ClassVar[time]\r
81     resolution: ClassVar[timedelta]\r
82 \r
83     def __init__(self, hour: int = ..., minute: int = ..., second: int = ..., microsecond: int = ...,\r
84                  tzinfo: Optional[tzinfo] = ...) -> None: ...\r
85 \r
86     @property\r
87     def hour(self) -> int: ...\r
88     @property\r
89     def minute(self) -> int: ...\r
90     @property\r
91     def second(self) -> int: ...\r
92     @property\r
93     def microsecond(self) -> int: ...\r
94     @property\r
95     def tzinfo(self) -> Optional[_tzinfo]: ...\r
96     if sys.version_info >= (3, 6):\r
97         @property\r
98         def fold(self) -> int: ...\r
99 \r
100     def __le__(self, other: time) -> bool: ...\r
101     def __lt__(self, other: time) -> bool: ...\r
102     def __ge__(self, other: time) -> bool: ...\r
103     def __gt__(self, other: time) -> bool: ...\r
104     def __hash__(self) -> int: ...\r
105     def isoformat(self) -> str: ...\r
106     def strftime(self, fmt: _Text) -> str: ...\r
107     if sys.version_info >= (3,):\r
108         def __format__(self, fmt: str) -> str: ...\r
109     else:\r
110         def __format__(self, fmt: AnyStr) -> AnyStr: ...\r
111     def utcoffset(self) -> Optional[timedelta]: ...\r
112     def tzname(self) -> Optional[str]: ...\r
113     def dst(self) -> Optional[int]: ...\r
114     if sys.version_info >= (3, 6):\r
115         def replace(self, hour: int = ..., minute: int = ..., second: int = ...,\r
116                     microsecond: int = ..., tzinfo: Optional[_tzinfo] = ...,\r
117                     *, fold: int = ...) -> time: ...\r
118     else:\r
119         def replace(self, hour: int = ..., minute: int = ..., second: int = ...,\r
120                     microsecond: int = ..., tzinfo: Optional[_tzinfo] = ...) -> time: ...\r
121 \r
122 _date = date\r
123 _time = time\r
124 \r
125 class timedelta(SupportsAbs[timedelta]):\r
126     min: ClassVar[timedelta]\r
127     max: ClassVar[timedelta]\r
128     resolution: ClassVar[timedelta]\r
129 \r
130     def __init__(self, days: float = ..., seconds: float = ..., microseconds: float = ...,\r
131                  milliseconds: float = ..., minutes: float = ..., hours: float = ...,\r
132                  weeks: float = ...) -> None: ...\r
133 \r
134     @property\r
135     def days(self) -> int: ...\r
136     @property\r
137     def seconds(self) -> int: ...\r
138     @property\r
139     def microseconds(self) -> int: ...\r
140 \r
141     def total_seconds(self) -> float: ...\r
142     def __add__(self, other: timedelta) -> timedelta: ...\r
143     def __radd__(self, other: timedelta) -> timedelta: ...\r
144     def __sub__(self, other: timedelta) -> timedelta: ...\r
145     def __rsub__(self, other: timedelta) -> timedelta: ...\r
146     def __neg__(self) -> timedelta: ...\r
147     def __pos__(self) -> timedelta: ...\r
148     def __abs__(self) -> timedelta: ...\r
149     def __mul__(self, other: float) -> timedelta: ...\r
150     def __rmul__(self, other: float) -> timedelta: ...\r
151     @overload\r
152     def __floordiv__(self, other: timedelta) -> int: ...\r
153     @overload\r
154     def __floordiv__(self, other: int) -> timedelta: ...\r
155     if sys.version_info >= (3,):\r
156         @overload\r
157         def __truediv__(self, other: timedelta) -> float: ...\r
158         @overload\r
159         def __truediv__(self, other: float) -> timedelta: ...\r
160         def __mod__(self, other: timedelta) -> timedelta: ...\r
161         def __divmod__(self, other: timedelta) -> Tuple[int, timedelta]: ...\r
162     else:\r
163         @overload\r
164         def __div__(self, other: timedelta) -> float: ...\r
165         @overload\r
166         def __div__(self, other: float) -> timedelta: ...\r
167     def __le__(self, other: timedelta) -> bool: ...\r
168     def __lt__(self, other: timedelta) -> bool: ...\r
169     def __ge__(self, other: timedelta) -> bool: ...\r
170     def __gt__(self, other: timedelta) -> bool: ...\r
171     def __hash__(self) -> int: ...\r
172 \r
173 class datetime:\r
174     # TODO: Is a subclass of date, but this would make some types incompatible.\r
175     min: ClassVar[datetime]\r
176     max: ClassVar[datetime]\r
177     resolution: ClassVar[timedelta]\r
178 \r
179     if sys.version_info >= (3, 6):\r
180         def __init__(self, year: int, month: int, day: int, hour: int = ...,\r
181                      minute: int = ..., second: int = ..., microsecond: int = ...,\r
182                      tzinfo: Optional[tzinfo] = ..., *, fold: int = ...) -> None: ...\r
183     else:\r
184         def __init__(self, year: int, month: int, day: int, hour: int = ...,\r
185                      minute: int = ..., second: int = ..., microsecond: int = ...,\r
186                      tzinfo: Optional[tzinfo] = ...) -> None: ...\r
187 \r
188     @property\r
189     def year(self) -> int: ...\r
190     @property\r
191     def month(self) -> int: ...\r
192     @property\r
193     def day(self) -> int: ...\r
194     @property\r
195     def hour(self) -> int: ...\r
196     @property\r
197     def minute(self) -> int: ...\r
198     @property\r
199     def second(self) -> int: ...\r
200     @property\r
201     def microsecond(self) -> int: ...\r
202     @property\r
203     def tzinfo(self) -> Optional[_tzinfo]: ...\r
204     if sys.version_info >= (3, 6):\r
205         @property\r
206         def fold(self) -> int: ...\r
207 \r
208     @classmethod\r
209     def fromtimestamp(cls, t: float, tz: Optional[_tzinfo] = ...) -> datetime: ...\r
210     @classmethod\r
211     def utcfromtimestamp(cls, t: float) -> datetime: ...\r
212     @classmethod\r
213     def today(cls) -> datetime: ...\r
214     @classmethod\r
215     def fromordinal(cls, n: int) -> datetime: ...\r
216     @classmethod\r
217     def now(cls, tz: Optional[_tzinfo] = ...) -> datetime: ...\r
218     @classmethod\r
219     def utcnow(cls) -> datetime: ...\r
220     if sys.version_info >= (3, 6):\r
221         @classmethod\r
222         def combine(cls, date: date, time: time, tzinfo: Optional[_tzinfo] = ...) -> datetime: ...\r
223     else:\r
224         @classmethod\r
225         def combine(cls, date: date, time: time) -> datetime: ...\r
226     if sys.version_info >= (3, 7):\r
227         @classmethod\r
228         def fromisoformat(cls, date_string: str) -> datetime: ...\r
229     def strftime(self, fmt: _Text) -> str: ...\r
230     if sys.version_info >= (3,):\r
231         def __format__(self, fmt: str) -> str: ...\r
232     else:\r
233         def __format__(self, fmt: AnyStr) -> AnyStr: ...\r
234     def toordinal(self) -> int: ...\r
235     def timetuple(self) -> struct_time: ...\r
236     if sys.version_info >= (3, 3):\r
237         def timestamp(self) -> float: ...\r
238     def utctimetuple(self) -> struct_time: ...\r
239     def date(self) -> _date: ...\r
240     def time(self) -> _time: ...\r
241     def timetz(self) -> _time: ...\r
242     if sys.version_info >= (3, 6):\r
243         def replace(self, year: int = ..., month: int = ..., day: int = ..., hour: int = ...,\r
244                     minute: int = ..., second: int = ..., microsecond: int = ..., tzinfo:\r
245                     Optional[_tzinfo] = ..., *, fold: int = ...) -> datetime: ...\r
246     else:\r
247         def replace(self, year: int = ..., month: int = ..., day: int = ..., hour: int = ...,\r
248                     minute: int = ..., second: int = ..., microsecond: int = ..., tzinfo:\r
249                     Optional[_tzinfo] = ...) -> datetime: ...\r
250     if sys.version_info >= (3, 3):\r
251         def astimezone(self, tz: Optional[_tzinfo] = ...) -> datetime: ...\r
252     else:\r
253         def astimezone(self, tz: _tzinfo) -> datetime: ...\r
254     def ctime(self) -> str: ...\r
255     if sys.version_info >= (3, 6):\r
256         def isoformat(self, sep: str = ..., timespec: str = ...) -> str: ...\r
257     else:\r
258         def isoformat(self, sep: str = ...) -> str: ...\r
259     @classmethod\r
260     def strptime(cls, date_string: _Text, format: _Text) -> datetime: ...\r
261     def utcoffset(self) -> Optional[timedelta]: ...\r
262     def tzname(self) -> Optional[str]: ...\r
263     def dst(self) -> Optional[int]: ...\r
264     def __le__(self, other: datetime) -> bool: ...\r
265     def __lt__(self, other: datetime) -> bool: ...\r
266     def __ge__(self, other: datetime) -> bool: ...\r
267     def __gt__(self, other: datetime) -> bool: ...\r
268     def __add__(self, other: timedelta) -> datetime: ...\r
269     @overload\r
270     def __sub__(self, other: datetime) -> timedelta: ...\r
271     @overload\r
272     def __sub__(self, other: timedelta) -> datetime: ...\r
273     def __hash__(self) -> int: ...\r
274     def weekday(self) -> int: ...\r
275     def isoweekday(self) -> int: ...\r
276     def isocalendar(self) -> Tuple[int, int, int]: ...\r