basedpyright 1.12.6 → 1.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/dist/pyright-langserver.js +1 -1
  2. package/dist/pyright-langserver.js.map +1 -1
  3. package/dist/pyright.js +1 -1
  4. package/dist/pyright.js.map +1 -1
  5. package/dist/typeshed-fallback/stdlib/_ast.pyi +279 -42
  6. package/dist/typeshed-fallback/stdlib/_bisect.pyi +149 -12
  7. package/dist/typeshed-fallback/stdlib/_codecs.pyi +125 -14
  8. package/dist/typeshed-fallback/stdlib/_csv.pyi +130 -7
  9. package/dist/typeshed-fallback/stdlib/_ctypes.pyi +72 -17
  10. package/dist/typeshed-fallback/stdlib/_curses.pyi +626 -78
  11. package/dist/typeshed-fallback/stdlib/_decimal.pyi +775 -153
  12. package/dist/typeshed-fallback/stdlib/_heapq.pyi +61 -5
  13. package/dist/typeshed-fallback/stdlib/_imp.pyi +70 -15
  14. package/dist/typeshed-fallback/stdlib/_json.pyi +55 -12
  15. package/dist/typeshed-fallback/stdlib/_locale.pyi +63 -12
  16. package/dist/typeshed-fallback/stdlib/_lsprof.pyi +61 -4
  17. package/dist/typeshed-fallback/stdlib/_operator.pyi +238 -62
  18. package/dist/typeshed-fallback/stdlib/_posixsubprocess.pyi +25 -1
  19. package/dist/typeshed-fallback/stdlib/_random.pyi +23 -5
  20. package/dist/typeshed-fallback/stdlib/_socket.pyi +618 -63
  21. package/dist/typeshed-fallback/stdlib/_stat.pyi +140 -13
  22. package/dist/typeshed-fallback/stdlib/_thread.pyi +215 -22
  23. package/dist/typeshed-fallback/stdlib/_tkinter.pyi +44 -11
  24. package/dist/typeshed-fallback/stdlib/_tracemalloc.pyi +71 -10
  25. package/dist/typeshed-fallback/stdlib/_warnings.pyi +53 -6
  26. package/dist/typeshed-fallback/stdlib/_weakref.pyi +43 -10
  27. package/dist/typeshed-fallback/stdlib/_winapi.pyi +255 -255
  28. package/dist/typeshed-fallback/stdlib/array.pyi +233 -44
  29. package/dist/typeshed-fallback/stdlib/atexit.pyi +50 -5
  30. package/dist/typeshed-fallback/stdlib/audioop.pyi +78 -26
  31. package/dist/typeshed-fallback/stdlib/binascii.pyi +105 -18
  32. package/dist/typeshed-fallback/stdlib/builtins.pyi +5254 -829
  33. package/dist/typeshed-fallback/stdlib/cmath.pyi +99 -23
  34. package/dist/typeshed-fallback/stdlib/errno.pyi +15 -0
  35. package/dist/typeshed-fallback/stdlib/faulthandler.pyi +33 -8
  36. package/dist/typeshed-fallback/stdlib/fcntl.pyi +199 -8
  37. package/dist/typeshed-fallback/stdlib/gc.pyi +130 -18
  38. package/dist/typeshed-fallback/stdlib/grp.pyi +58 -7
  39. package/dist/typeshed-fallback/stdlib/itertools.pyi +281 -42
  40. package/dist/typeshed-fallback/stdlib/marshal.pyi +82 -4
  41. package/dist/typeshed-fallback/stdlib/math.pyi +357 -61
  42. package/dist/typeshed-fallback/stdlib/mmap.pyi +47 -8
  43. package/dist/typeshed-fallback/stdlib/msvcrt.pyi +32 -32
  44. package/dist/typeshed-fallback/stdlib/nt.pyi +118 -111
  45. package/dist/typeshed-fallback/stdlib/parser.pyi +55 -24
  46. package/dist/typeshed-fallback/stdlib/posix.pyi +7 -0
  47. package/dist/typeshed-fallback/stdlib/pwd.pyi +60 -10
  48. package/dist/typeshed-fallback/stdlib/pyexpat/__init__.pyi +61 -12
  49. package/dist/typeshed-fallback/stdlib/readline.pyi +184 -27
  50. package/dist/typeshed-fallback/stdlib/resource.pyi +56 -16
  51. package/dist/typeshed-fallback/stdlib/select.pyi +97 -5
  52. package/dist/typeshed-fallback/stdlib/spwd.pyi +60 -11
  53. package/dist/typeshed-fallback/stdlib/sys/__init__.pyi +386 -48
  54. package/dist/typeshed-fallback/stdlib/syslog.pyi +27 -7
  55. package/dist/typeshed-fallback/stdlib/termios.pyi +88 -8
  56. package/dist/typeshed-fallback/stdlib/time.pyi +314 -37
  57. package/dist/typeshed-fallback/stdlib/unicodedata.pyi +264 -34
  58. package/dist/typeshed-fallback/stdlib/winreg.pyi +172 -132
  59. package/dist/typeshed-fallback/stdlib/zlib.pyi +108 -7
  60. package/package.json +1 -1
@@ -1,3 +1,28 @@
1
+ """
2
+ This module provides various functions to manipulate time values.
3
+
4
+ There are two standard representations of time. One is the number
5
+ of seconds since the Epoch, in UTC (a.k.a. GMT). It may be an integer
6
+ or a floating point number (to represent fractions of seconds).
7
+ The Epoch is system-defined; on Unix, it is generally January 1st, 1970.
8
+ The actual value can be retrieved by calling gmtime(0).
9
+
10
+ The other representation is a tuple of 9 integers giving local time.
11
+ The tuple items are:
12
+ year (including century, e.g. 1998)
13
+ month (1-12)
14
+ day (1-31)
15
+ hours (0-23)
16
+ minutes (0-59)
17
+ seconds (0-59)
18
+ weekday (0-6, Monday is 0)
19
+ Julian day (day in the year, 1-366)
20
+ DST (Daylight Savings Time) flag (-1, 0 or 1)
21
+ If the DST flag is 0, the time is given in the regular time zone;
22
+ if it is 1, the time is given in the DST time zone;
23
+ if it is -1, mktime() should guess based on the date and time.
24
+ """
25
+
1
26
  import sys
2
27
  from _typeshed import structseq
3
28
  from typing import Any, Final, Literal, Protocol, final
@@ -40,45 +65,205 @@ if sys.version_info >= (3, 9) and sys.platform == "linux":
40
65
  # https://github.com/python/typeshed/pull/6560#discussion_r767162532
41
66
  @final
42
67
  class struct_time(structseq[Any | int], _TimeTuple):
68
+ """
69
+ The time value as returned by gmtime(), localtime(), and strptime(), and
70
+ accepted by asctime(), mktime() and strftime(). May be considered as a
71
+ sequence of 9 integers.
72
+
73
+ Note that several fields' values are not the same as those defined by
74
+ the C language standard for struct tm. For example, the value of the
75
+ field tm_year is the actual year, not year - 1900. See individual
76
+ fields' descriptions for details.
77
+ """
43
78
  if sys.version_info >= (3, 10):
44
79
  __match_args__: Final = ("tm_year", "tm_mon", "tm_mday", "tm_hour", "tm_min", "tm_sec", "tm_wday", "tm_yday", "tm_isdst")
45
80
 
46
81
  @property
47
- def tm_year(self) -> int: ...
82
+ def tm_year(self) -> int:
83
+ """year, for example, 1993"""
84
+ ...
48
85
  @property
49
- def tm_mon(self) -> int: ...
86
+ def tm_mon(self) -> int:
87
+ """month of year, range [1, 12]"""
88
+ ...
50
89
  @property
51
- def tm_mday(self) -> int: ...
90
+ def tm_mday(self) -> int:
91
+ """day of month, range [1, 31]"""
92
+ ...
52
93
  @property
53
- def tm_hour(self) -> int: ...
94
+ def tm_hour(self) -> int:
95
+ """hours, range [0, 23]"""
96
+ ...
54
97
  @property
55
- def tm_min(self) -> int: ...
98
+ def tm_min(self) -> int:
99
+ """minutes, range [0, 59]"""
100
+ ...
56
101
  @property
57
- def tm_sec(self) -> int: ...
102
+ def tm_sec(self) -> int:
103
+ """seconds, range [0, 61])"""
104
+ ...
58
105
  @property
59
- def tm_wday(self) -> int: ...
106
+ def tm_wday(self) -> int:
107
+ """day of week, range [0, 6], Monday is 0"""
108
+ ...
60
109
  @property
61
- def tm_yday(self) -> int: ...
110
+ def tm_yday(self) -> int:
111
+ """day of year, range [1, 366]"""
112
+ ...
62
113
  @property
63
- def tm_isdst(self) -> int: ...
114
+ def tm_isdst(self) -> int:
115
+ """1 if summer time is in effect, 0 if not, and -1 if unknown"""
116
+ ...
64
117
  # These final two properties only exist if a 10- or 11-item sequence was passed to the constructor.
65
118
  @property
66
- def tm_zone(self) -> str: ...
119
+ def tm_zone(self) -> str:
120
+ """abbreviation of timezone name"""
121
+ ...
67
122
  @property
68
- def tm_gmtoff(self) -> int: ...
69
-
70
- def asctime(time_tuple: _TimeTuple | struct_time = ..., /) -> str: ...
71
- def ctime(seconds: float | None = None, /) -> str: ...
72
- def gmtime(seconds: float | None = None, /) -> struct_time: ...
73
- def localtime(seconds: float | None = None, /) -> struct_time: ...
74
- def mktime(time_tuple: _TimeTuple | struct_time, /) -> float: ...
75
- def sleep(seconds: float, /) -> None: ...
76
- def strftime(format: str, time_tuple: _TimeTuple | struct_time = ..., /) -> str: ...
77
- def strptime(data_string: str, format: str = "%a %b %d %H:%M:%S %Y", /) -> struct_time: ...
78
- def time() -> float: ...
123
+ def tm_gmtoff(self) -> int:
124
+ """offset from UTC in seconds"""
125
+ ...
126
+
127
+ def asctime(time_tuple: _TimeTuple | struct_time = ..., /) -> str:
128
+ """
129
+ asctime([tuple]) -> string
130
+
131
+ Convert a time tuple to a string, e.g. 'Sat Jun 06 16:26:11 1998'.
132
+ When the time tuple is not present, current time as returned by localtime()
133
+ is used.
134
+ """
135
+ ...
136
+ def ctime(seconds: float | None = None, /) -> str:
137
+ """
138
+ ctime(seconds) -> string
139
+
140
+ Convert a time in seconds since the Epoch to a string in local time.
141
+ This is equivalent to asctime(localtime(seconds)). When the time tuple is
142
+ not present, current time as returned by localtime() is used.
143
+ """
144
+ ...
145
+ def gmtime(seconds: float | None = None, /) -> struct_time:
146
+ """
147
+ gmtime([seconds]) -> (tm_year, tm_mon, tm_mday, tm_hour, tm_min,
148
+ tm_sec, tm_wday, tm_yday, tm_isdst)
149
+
150
+ Convert seconds since the Epoch to a time tuple expressing UTC (a.k.a.
151
+ GMT). When 'seconds' is not passed in, convert the current time instead.
152
+
153
+ If the platform supports the tm_gmtoff and tm_zone, they are available as
154
+ attributes only.
155
+ """
156
+ ...
157
+ def localtime(seconds: float | None = None, /) -> struct_time:
158
+ """
159
+ localtime([seconds]) -> (tm_year,tm_mon,tm_mday,tm_hour,tm_min,
160
+ tm_sec,tm_wday,tm_yday,tm_isdst)
161
+
162
+ Convert seconds since the Epoch to a time tuple expressing local time.
163
+ When 'seconds' is not passed in, convert the current time instead.
164
+ """
165
+ ...
166
+ def mktime(time_tuple: _TimeTuple | struct_time, /) -> float:
167
+ """
168
+ mktime(tuple) -> floating point number
169
+
170
+ Convert a time tuple in local time to seconds since the Epoch.
171
+ Note that mktime(gmtime(0)) will not generally return zero for most
172
+ time zones; instead the returned value will either be equal to that
173
+ of the timezone or altzone attributes on the time module.
174
+ """
175
+ ...
176
+ def sleep(seconds: float, /) -> None:
177
+ """
178
+ sleep(seconds)
179
+
180
+ Delay execution for a given number of seconds. The argument may be
181
+ a floating point number for subsecond precision.
182
+ """
183
+ ...
184
+ def strftime(format: str, time_tuple: _TimeTuple | struct_time = ..., /) -> str:
185
+ """
186
+ strftime(format[, tuple]) -> string
187
+
188
+ Convert a time tuple to a string according to a format specification.
189
+ See the library reference manual for formatting codes. When the time tuple
190
+ is not present, current time as returned by localtime() is used.
191
+
192
+ Commonly used format codes:
193
+
194
+ %Y Year with century as a decimal number.
195
+ %m Month as a decimal number [01,12].
196
+ %d Day of the month as a decimal number [01,31].
197
+ %H Hour (24-hour clock) as a decimal number [00,23].
198
+ %M Minute as a decimal number [00,59].
199
+ %S Second as a decimal number [00,61].
200
+ %z Time zone offset from UTC.
201
+ %a Locale's abbreviated weekday name.
202
+ %A Locale's full weekday name.
203
+ %b Locale's abbreviated month name.
204
+ %B Locale's full month name.
205
+ %c Locale's appropriate date and time representation.
206
+ %I Hour (12-hour clock) as a decimal number [01,12].
207
+ %p Locale's equivalent of either AM or PM.
208
+
209
+ Other codes may be available on your platform. See documentation for
210
+ the C library strftime function.
211
+ """
212
+ ...
213
+ def strptime(data_string: str, format: str = "%a %b %d %H:%M:%S %Y", /) -> struct_time:
214
+ """
215
+ strptime(string, format) -> struct_time
216
+
217
+ Parse a string to a time tuple according to a format specification.
218
+ See the library reference manual for formatting codes (same as
219
+ strftime()).
220
+
221
+ Commonly used format codes:
222
+
223
+ %Y Year with century as a decimal number.
224
+ %m Month as a decimal number [01,12].
225
+ %d Day of the month as a decimal number [01,31].
226
+ %H Hour (24-hour clock) as a decimal number [00,23].
227
+ %M Minute as a decimal number [00,59].
228
+ %S Second as a decimal number [00,61].
229
+ %z Time zone offset from UTC.
230
+ %a Locale's abbreviated weekday name.
231
+ %A Locale's full weekday name.
232
+ %b Locale's abbreviated month name.
233
+ %B Locale's full month name.
234
+ %c Locale's appropriate date and time representation.
235
+ %I Hour (12-hour clock) as a decimal number [01,12].
236
+ %p Locale's equivalent of either AM or PM.
237
+
238
+ Other codes may be available on your platform. See documentation for
239
+ the C library strftime function.
240
+ """
241
+ ...
242
+ def time() -> float:
243
+ """
244
+ time() -> floating point number
245
+
246
+ Return the current time in seconds since the Epoch.
247
+ Fractions of a second may be present if the system clock provides them.
248
+ """
249
+ ...
79
250
 
80
251
  if sys.platform != "win32":
81
- def tzset() -> None: ... # Unix only
252
+ def tzset() -> None:
253
+ """
254
+ tzset()
255
+
256
+ Initialize, or reinitialize, the local timezone to the value stored in
257
+ os.environ['TZ']. The TZ environment variable should be specified in
258
+ standard Unix timezone format as documented in the tzset man page
259
+ (eg. 'US/Eastern', 'Europe/Amsterdam'). Unknown timezones will silently
260
+ fall back to UTC. If the TZ environment variable is not set, the local
261
+ timezone is set to the systems best guess of wallclock time.
262
+ Changing the TZ environment variable without calling tzset *may* change
263
+ the local timezone used by methods such as localtime, but this behaviour
264
+ should not be relied on.
265
+ """
266
+ ...
82
267
 
83
268
  class _ClockInfo(Protocol):
84
269
  adjustable: bool
@@ -86,26 +271,118 @@ class _ClockInfo(Protocol):
86
271
  monotonic: bool
87
272
  resolution: float
88
273
 
89
- def get_clock_info(name: Literal["monotonic", "perf_counter", "process_time", "time", "thread_time"], /) -> _ClockInfo: ...
90
- def monotonic() -> float: ...
91
- def perf_counter() -> float: ...
92
- def process_time() -> float: ...
274
+ def get_clock_info(name: Literal["monotonic", "perf_counter", "process_time", "time", "thread_time"], /) -> _ClockInfo:
275
+ """
276
+ get_clock_info(name: str) -> dict
277
+
278
+ Get information of the specified clock.
279
+ """
280
+ ...
281
+ def monotonic() -> float:
282
+ """
283
+ monotonic() -> float
284
+
285
+ Monotonic clock, cannot go backward.
286
+ """
287
+ ...
288
+ def perf_counter() -> float:
289
+ """
290
+ perf_counter() -> float
291
+
292
+ Performance counter for benchmarking.
293
+ """
294
+ ...
295
+ def process_time() -> float:
296
+ """
297
+ process_time() -> float
298
+
299
+ Process time for profiling: sum of the kernel and user-space CPU time.
300
+ """
301
+ ...
93
302
 
94
303
  if sys.platform != "win32":
95
- def clock_getres(clk_id: int, /) -> float: ... # Unix only
96
- def clock_gettime(clk_id: int, /) -> float: ... # Unix only
97
- def clock_settime(clk_id: int, time: float, /) -> None: ... # Unix only
304
+ def clock_getres(clk_id: int, /) -> float:
305
+ """
306
+ clock_getres(clk_id) -> floating point number
307
+
308
+ Return the resolution (precision) of the specified clock clk_id.
309
+ """
310
+ ...
311
+ def clock_gettime(clk_id: int, /) -> float:
312
+ """
313
+ clock_gettime(clk_id) -> float
314
+
315
+ Return the time of the specified clock clk_id.
316
+ """
317
+ ...
318
+ def clock_settime(clk_id: int, time: float, /) -> None:
319
+ """
320
+ clock_settime(clk_id, time)
321
+
322
+ Set the time of the specified clock clk_id.
323
+ """
324
+ ...
98
325
 
99
326
  if sys.platform != "win32":
100
- def clock_gettime_ns(clk_id: int, /) -> int: ...
101
- def clock_settime_ns(clock_id: int, time: int, /) -> int: ...
327
+ def clock_gettime_ns(clk_id: int, /) -> int:
328
+ """
329
+ clock_gettime_ns(clk_id) -> int
330
+
331
+ Return the time of the specified clock clk_id as nanoseconds.
332
+ """
333
+ ...
334
+ def clock_settime_ns(clock_id: int, time: int, /) -> int:
335
+ """
336
+ clock_settime_ns(clk_id, time)
337
+
338
+ Set the time of the specified clock clk_id with nanoseconds.
339
+ """
340
+ ...
102
341
 
103
342
  if sys.platform == "linux":
104
343
  def pthread_getcpuclockid(thread_id: int, /) -> int: ...
105
344
 
106
- def monotonic_ns() -> int: ...
107
- def perf_counter_ns() -> int: ...
108
- def process_time_ns() -> int: ...
109
- def time_ns() -> int: ...
110
- def thread_time() -> float: ...
111
- def thread_time_ns() -> int: ...
345
+ def monotonic_ns() -> int:
346
+ """
347
+ monotonic_ns() -> int
348
+
349
+ Monotonic clock, cannot go backward, as nanoseconds.
350
+ """
351
+ ...
352
+ def perf_counter_ns() -> int:
353
+ """
354
+ perf_counter_ns() -> int
355
+
356
+ Performance counter for benchmarking as nanoseconds.
357
+ """
358
+ ...
359
+ def process_time_ns() -> int:
360
+ """
361
+ process_time() -> int
362
+
363
+ Process time for profiling as nanoseconds:
364
+ sum of the kernel and user-space CPU time.
365
+ """
366
+ ...
367
+ def time_ns() -> int:
368
+ """
369
+ time_ns() -> int
370
+
371
+ Return the current time in nanoseconds since the Epoch.
372
+ """
373
+ ...
374
+ def thread_time() -> float:
375
+ """
376
+ thread_time() -> float
377
+
378
+ Thread time for profiling: sum of the kernel and user-space CPU time.
379
+ """
380
+ ...
381
+ def thread_time_ns() -> int:
382
+ """
383
+ thread_time() -> int
384
+
385
+ Thread time for profiling as nanoseconds:
386
+ sum of the kernel and user-space CPU time.
387
+ """
388
+ ...