basedpyright 1.40.1 → 1.40.2
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.
- package/dist/pyright-langserver.js +1 -1
- package/dist/pyright.js +1 -1
- package/dist/typeshed-fallback/stdlib/_blake2.pyi +1 -1
- package/dist/typeshed-fallback/stdlib/_curses.pyi +81 -54
- package/dist/typeshed-fallback/stdlib/_curses_panel.pyi +8 -1
- package/dist/typeshed-fallback/stdlib/_decimal.pyi +9 -6
- package/dist/typeshed-fallback/stdlib/_interpqueues.pyi +24 -36
- package/dist/typeshed-fallback/stdlib/_interpreters.pyi +26 -71
- package/dist/typeshed-fallback/stdlib/_json.pyi +15 -11
- package/dist/typeshed-fallback/stdlib/_remote_debugging.pyi +355 -72
- package/dist/typeshed-fallback/stdlib/_socket.pyi +21 -21
- package/dist/typeshed-fallback/stdlib/_sqlite3.pyi +0 -15
- package/dist/typeshed-fallback/stdlib/_struct.pyi +39 -42
- package/dist/typeshed-fallback/stdlib/_thread.pyi +18 -14
- package/dist/typeshed-fallback/stdlib/array.pyi +8 -4
- package/dist/typeshed-fallback/stdlib/ast.pyi +9 -3
- package/dist/typeshed-fallback/stdlib/binascii.pyi +113 -10
- package/dist/typeshed-fallback/stdlib/builtins.pyi +260 -43
- package/dist/typeshed-fallback/stdlib/collections/__init__.pyi +12 -4
- package/dist/typeshed-fallback/stdlib/dataclasses.pyi +3 -1
- package/dist/typeshed-fallback/stdlib/datetime.pyi +93 -25
- package/dist/typeshed-fallback/stdlib/decimal.pyi +272 -208
- package/dist/typeshed-fallback/stdlib/faulthandler.pyi +29 -4
- package/dist/typeshed-fallback/stdlib/fcntl.pyi +6 -12
- package/dist/typeshed-fallback/stdlib/importlib/metadata/__init__.pyi +2 -0
- package/dist/typeshed-fallback/stdlib/json/encoder.pyi +2 -10
- package/dist/typeshed-fallback/stdlib/marshal.pyi +33 -2
- package/dist/typeshed-fallback/stdlib/math/__init__.pyi +15 -7
- package/dist/typeshed-fallback/stdlib/math/integer.pyi +43 -8
- package/dist/typeshed-fallback/stdlib/mmap.pyi +1 -1
- package/dist/typeshed-fallback/stdlib/os/__init__.pyi +60 -4
- package/dist/typeshed-fallback/stdlib/posixpath.pyi +14 -2
- package/dist/typeshed-fallback/stdlib/profiling/__init__.pyi +3 -3
- package/dist/typeshed-fallback/stdlib/profiling/sampling/__init__.pyi +17 -17
- package/dist/typeshed-fallback/stdlib/profiling/sampling/collector.pyi +25 -25
- package/dist/typeshed-fallback/stdlib/profiling/sampling/gecko_collector.pyi +111 -111
- package/dist/typeshed-fallback/stdlib/profiling/sampling/heatmap_collector.pyi +24 -24
- package/dist/typeshed-fallback/stdlib/profiling/sampling/jsonl_collector.pyi +15 -15
- package/dist/typeshed-fallback/stdlib/profiling/sampling/pstats_collector.pyi +17 -17
- package/dist/typeshed-fallback/stdlib/profiling/sampling/stack_collector.pyi +39 -39
- package/dist/typeshed-fallback/stdlib/profiling/sampling/string_table.pyi +5 -5
- package/dist/typeshed-fallback/stdlib/profiling/tracing.pyi +9 -9
- package/dist/typeshed-fallback/stdlib/pyexpat/__init__.pyi +24 -18
- package/dist/typeshed-fallback/stdlib/re.pyi +18 -3
- package/dist/typeshed-fallback/stdlib/select.pyi +2 -2
- package/dist/typeshed-fallback/stdlib/signal.pyi +1 -1
- package/dist/typeshed-fallback/stdlib/sqlite3/__init__.pyi +28 -5
- package/dist/typeshed-fallback/stdlib/sys/__init__.pyi +42 -4
- package/dist/typeshed-fallback/stdlib/types.pyi +44 -14
- package/dist/typeshed-fallback/stdlib/unicodedata.pyi +27 -9
- package/dist/typeshed-fallback/stdlib/urllib/parse.pyi +132 -6
- package/dist/typeshed-fallback/stdlib/winreg.pyi +5 -0
- package/dist/typeshed-fallback/stdlib/xml/utils.pyi +2 -2
- package/dist/typeshed-fallback/stdlib/zlib.pyi +34 -2
- package/package.json +1 -1
|
@@ -86,16 +86,27 @@ class date:
|
|
|
86
86
|
...
|
|
87
87
|
@classmethod
|
|
88
88
|
def today(cls) -> Self:
|
|
89
|
-
"""
|
|
89
|
+
"""
|
|
90
|
+
Current date or datetime.
|
|
91
|
+
|
|
92
|
+
Equivalent to fromtimestamp(time.time()).
|
|
93
|
+
"""
|
|
90
94
|
...
|
|
91
95
|
@classmethod
|
|
92
96
|
def fromordinal(cls, n: int, /) -> Self:
|
|
93
|
-
"""
|
|
97
|
+
"""
|
|
98
|
+
Construct a date from a proleptic Gregorian ordinal.
|
|
99
|
+
|
|
100
|
+
January 1 of year 1 is day 1. Only the year, month and day are
|
|
101
|
+
non-zero in the result.
|
|
102
|
+
"""
|
|
94
103
|
...
|
|
95
104
|
|
|
96
105
|
if sys.version_info >= (3, 15):
|
|
97
106
|
@classmethod
|
|
98
|
-
def fromisoformat(cls, string: str, /) -> Self:
|
|
107
|
+
def fromisoformat(cls, string: str, /) -> Self:
|
|
108
|
+
"""Construct a date from a string in ISO 8601 format."""
|
|
109
|
+
...
|
|
99
110
|
else:
|
|
100
111
|
@classmethod
|
|
101
112
|
def fromisoformat(cls, date_string: str, /) -> Self:
|
|
@@ -105,9 +116,9 @@ class date:
|
|
|
105
116
|
@classmethod
|
|
106
117
|
def fromisocalendar(cls, year: int, week: int, day: int) -> Self:
|
|
107
118
|
"""
|
|
108
|
-
|
|
119
|
+
Construct a date from the ISO year, week number and weekday.
|
|
109
120
|
|
|
110
|
-
This is the inverse of the date.isocalendar() function
|
|
121
|
+
This is the inverse of the date.isocalendar() function.
|
|
111
122
|
"""
|
|
112
123
|
...
|
|
113
124
|
@property
|
|
@@ -123,7 +134,14 @@ class date:
|
|
|
123
134
|
if sys.version_info >= (3, 14):
|
|
124
135
|
if sys.version_info >= (3, 15):
|
|
125
136
|
@classmethod
|
|
126
|
-
def strptime(cls, string: str, format: str, /) -> Self:
|
|
137
|
+
def strptime(cls, string: str, format: str, /) -> Self:
|
|
138
|
+
"""
|
|
139
|
+
Parse string according to the given date format (like time.strptime()).
|
|
140
|
+
|
|
141
|
+
For a list of supported format codes, see the documentation:
|
|
142
|
+
https://docs.python.org/3/library/datetime.html#format-codes
|
|
143
|
+
"""
|
|
144
|
+
...
|
|
127
145
|
else:
|
|
128
146
|
@classmethod
|
|
129
147
|
def strptime(cls, date_string: str, format: str, /) -> Self:
|
|
@@ -135,7 +153,14 @@ class date:
|
|
|
135
153
|
# meaning it is only *safe* to pass it as a keyword argument on 3.12+
|
|
136
154
|
if sys.version_info >= (3, 12):
|
|
137
155
|
def strftime(self, format: str) -> str:
|
|
138
|
-
"""
|
|
156
|
+
"""
|
|
157
|
+
Format using strftime().
|
|
158
|
+
|
|
159
|
+
Example: "%d/%m/%Y, %H:%M:%S".
|
|
160
|
+
|
|
161
|
+
For a list of supported format codes, see the documentation:
|
|
162
|
+
https://docs.python.org/3/library/datetime.html#format-codes
|
|
163
|
+
"""
|
|
139
164
|
...
|
|
140
165
|
else:
|
|
141
166
|
def strftime(self, format: str, /) -> str:
|
|
@@ -263,17 +288,22 @@ class time:
|
|
|
263
288
|
...
|
|
264
289
|
def isoformat(self, timespec: str = "auto") -> str:
|
|
265
290
|
"""
|
|
266
|
-
Return
|
|
291
|
+
Return the time formatted according to ISO.
|
|
292
|
+
|
|
293
|
+
The full format is 'HH:MM:SS.mmmmmm+zz:zz'. By default, the
|
|
294
|
+
fractional part is omitted if self.microsecond == 0.
|
|
267
295
|
|
|
268
|
-
The optional argument timespec specifies the number of additional
|
|
269
|
-
of the time to include. Valid options are 'auto', 'hours',
|
|
270
|
-
'seconds', 'milliseconds' and 'microseconds'.
|
|
296
|
+
The optional argument timespec specifies the number of additional
|
|
297
|
+
terms of the time to include. Valid options are 'auto', 'hours',
|
|
298
|
+
'minutes', 'seconds', 'milliseconds' and 'microseconds'.
|
|
271
299
|
"""
|
|
272
300
|
...
|
|
273
301
|
|
|
274
302
|
if sys.version_info >= (3, 15):
|
|
275
303
|
@classmethod
|
|
276
|
-
def fromisoformat(cls, string: str, /) -> Self:
|
|
304
|
+
def fromisoformat(cls, string: str, /) -> Self:
|
|
305
|
+
"""Construct a time from a string in ISO 8601 format."""
|
|
306
|
+
...
|
|
277
307
|
else:
|
|
278
308
|
@classmethod
|
|
279
309
|
def fromisoformat(cls, time_string: str, /) -> Self:
|
|
@@ -283,7 +313,14 @@ class time:
|
|
|
283
313
|
if sys.version_info >= (3, 14):
|
|
284
314
|
if sys.version_info >= (3, 15):
|
|
285
315
|
@classmethod
|
|
286
|
-
def strptime(cls, string: str, format: str, /) -> Self:
|
|
316
|
+
def strptime(cls, string: str, format: str, /) -> Self:
|
|
317
|
+
"""
|
|
318
|
+
Parse string according to the given time format (like time.strptime()).
|
|
319
|
+
|
|
320
|
+
For a list of supported format codes, see the documentation:
|
|
321
|
+
https://docs.python.org/3/library/datetime.html#format-codes
|
|
322
|
+
"""
|
|
323
|
+
...
|
|
287
324
|
else:
|
|
288
325
|
@classmethod
|
|
289
326
|
def strptime(cls, date_string: str, format: str, /) -> Self:
|
|
@@ -295,7 +332,15 @@ class time:
|
|
|
295
332
|
# meaning it is only *safe* to pass it as a keyword argument on 3.12+
|
|
296
333
|
if sys.version_info >= (3, 12):
|
|
297
334
|
def strftime(self, format: str) -> str:
|
|
298
|
-
"""
|
|
335
|
+
"""
|
|
336
|
+
Format using strftime().
|
|
337
|
+
|
|
338
|
+
The date part of the timestamp passed to underlying strftime should
|
|
339
|
+
not be used.
|
|
340
|
+
|
|
341
|
+
For a list of supported format codes, see the documentation:
|
|
342
|
+
https://docs.python.org/3/library/datetime.html#format-codes
|
|
343
|
+
"""
|
|
299
344
|
...
|
|
300
345
|
else:
|
|
301
346
|
def strftime(self, format: str, /) -> str:
|
|
@@ -484,7 +529,12 @@ class datetime(date):
|
|
|
484
529
|
if sys.version_info >= (3, 12):
|
|
485
530
|
@classmethod
|
|
486
531
|
def fromtimestamp(cls, timestamp: float, tz: _TzInfo | None = None) -> Self:
|
|
487
|
-
"""
|
|
532
|
+
"""
|
|
533
|
+
Create a datetime from a POSIX timestamp.
|
|
534
|
+
|
|
535
|
+
The timestamp is a number, e.g. created via time.time(), that is
|
|
536
|
+
interpreted as local time.
|
|
537
|
+
"""
|
|
488
538
|
...
|
|
489
539
|
else:
|
|
490
540
|
@classmethod
|
|
@@ -495,7 +545,7 @@ class datetime(date):
|
|
|
495
545
|
@classmethod
|
|
496
546
|
@deprecated("Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .fromtimestamp(datetime.timezone.utc)")
|
|
497
547
|
def utcfromtimestamp(cls, t: float, /) -> Self:
|
|
498
|
-
"""
|
|
548
|
+
"""Create a naive UTC datetime from a POSIX timestamp."""
|
|
499
549
|
...
|
|
500
550
|
@classmethod
|
|
501
551
|
def now(cls, tz: _TzInfo | None = None) -> Self:
|
|
@@ -515,11 +565,13 @@ class datetime(date):
|
|
|
515
565
|
...
|
|
516
566
|
@classmethod
|
|
517
567
|
def combine(cls, date: _Date, time: _Time, tzinfo: _TzInfo | None = ...) -> Self:
|
|
518
|
-
"""
|
|
568
|
+
"""Construct a datetime from a given date and a given time."""
|
|
519
569
|
...
|
|
520
570
|
if sys.version_info >= (3, 15):
|
|
521
571
|
@classmethod
|
|
522
|
-
def fromisoformat(cls, string: str, /) -> Self:
|
|
572
|
+
def fromisoformat(cls, string: str, /) -> Self:
|
|
573
|
+
"""Construct a date from a string in ISO 8601 format."""
|
|
574
|
+
...
|
|
523
575
|
|
|
524
576
|
def timestamp(self) -> float:
|
|
525
577
|
"""Return POSIX timestamp as float."""
|
|
@@ -570,21 +622,37 @@ class datetime(date):
|
|
|
570
622
|
"""Return datetime with new specified fields."""
|
|
571
623
|
...
|
|
572
624
|
def astimezone(self, tz: _TzInfo | None = None) -> Self:
|
|
573
|
-
"""
|
|
625
|
+
"""Convert to local time in new timezone tz."""
|
|
574
626
|
...
|
|
575
627
|
def isoformat(self, sep: str = "T", timespec: str = "auto") -> str:
|
|
576
628
|
"""
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
The
|
|
580
|
-
|
|
581
|
-
|
|
629
|
+
Return the time formatted according to ISO.
|
|
630
|
+
|
|
631
|
+
The full format looks like 'YYYY-MM-DD HH:MM:SS.mmmmmm'.
|
|
632
|
+
By default, the fractional part is omitted if self.microsecond == 0.
|
|
633
|
+
|
|
634
|
+
If self.tzinfo is not None, the UTC offset is also attached, giving
|
|
635
|
+
a full format of 'YYYY-MM-DD HH:MM:SS.mmmmmm+HH:MM'.
|
|
636
|
+
|
|
637
|
+
Optional argument sep specifies the separator between date and
|
|
638
|
+
time, default 'T'.
|
|
639
|
+
|
|
640
|
+
The optional argument timespec specifies the number of additional
|
|
641
|
+
terms of the time to include. Valid options are 'auto', 'hours',
|
|
642
|
+
'minutes', 'seconds', 'milliseconds' and 'microseconds'.
|
|
582
643
|
"""
|
|
583
644
|
...
|
|
584
645
|
|
|
585
646
|
if sys.version_info >= (3, 15):
|
|
586
647
|
@classmethod
|
|
587
|
-
def strptime(cls, string: str, format: str, /) -> Self:
|
|
648
|
+
def strptime(cls, string: str, format: str, /) -> Self:
|
|
649
|
+
"""
|
|
650
|
+
Parse string according to the given date and time format (like time.strptime()).
|
|
651
|
+
|
|
652
|
+
For a list of supported format codes, see the documentation:
|
|
653
|
+
https://docs.python.org/3/library/datetime.html#format-codes
|
|
654
|
+
"""
|
|
655
|
+
...
|
|
588
656
|
else:
|
|
589
657
|
@classmethod
|
|
590
658
|
def strptime(cls, date_string: str, format: str, /) -> Self:
|