basedpyright 1.15.2 → 1.16.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 (46) 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/_bisect.pyi +16 -8
  6. package/dist/typeshed-fallback/stdlib/_csv.pyi +13 -4
  7. package/dist/typeshed-fallback/stdlib/_curses.pyi +1 -1
  8. package/dist/typeshed-fallback/stdlib/_decimal.pyi +19 -1
  9. package/dist/typeshed-fallback/stdlib/_imp.pyi +1 -1
  10. package/dist/typeshed-fallback/stdlib/_locale.pyi +11 -28
  11. package/dist/typeshed-fallback/stdlib/_lsprof.pyi +2 -0
  12. package/dist/typeshed-fallback/stdlib/_operator.pyi +1 -1
  13. package/dist/typeshed-fallback/stdlib/_posixsubprocess.pyi +10 -8
  14. package/dist/typeshed-fallback/stdlib/_socket.pyi +3 -15
  15. package/dist/typeshed-fallback/stdlib/_thread.pyi +6 -2
  16. package/dist/typeshed-fallback/stdlib/_warnings.pyi +2 -2
  17. package/dist/typeshed-fallback/stdlib/_weakref.pyi +9 -10
  18. package/dist/typeshed-fallback/stdlib/array.pyi +1 -1
  19. package/dist/typeshed-fallback/stdlib/atexit.pyi +4 -1
  20. package/dist/typeshed-fallback/stdlib/builtins.pyi +214 -203
  21. package/dist/typeshed-fallback/stdlib/cmath.pyi +1 -1
  22. package/dist/typeshed-fallback/stdlib/collections/__init__.pyi +15 -12
  23. package/dist/typeshed-fallback/stdlib/datetime.pyi +3 -3
  24. package/dist/typeshed-fallback/stdlib/faulthandler.pyi +8 -12
  25. package/dist/typeshed-fallback/stdlib/functools.pyi +18 -13
  26. package/dist/typeshed-fallback/stdlib/gc.pyi +1 -0
  27. package/dist/typeshed-fallback/stdlib/importlib/metadata/__init__.pyi +6 -5
  28. package/dist/typeshed-fallback/stdlib/io.pyi +48 -42
  29. package/dist/typeshed-fallback/stdlib/ipaddress.pyi +2 -2
  30. package/dist/typeshed-fallback/stdlib/itertools.pyi +6 -4
  31. package/dist/typeshed-fallback/stdlib/math.pyi +17 -5
  32. package/dist/typeshed-fallback/stdlib/multiprocessing/shared_memory.pyi +1 -1
  33. package/dist/typeshed-fallback/stdlib/os/__init__.pyi +22 -14
  34. package/dist/typeshed-fallback/stdlib/readline.pyi +29 -83
  35. package/dist/typeshed-fallback/stdlib/signal.pyi +4 -4
  36. package/dist/typeshed-fallback/stdlib/sqlite3/dbapi2.pyi +65 -55
  37. package/dist/typeshed-fallback/stdlib/ssl.pyi +1 -1
  38. package/dist/typeshed-fallback/stdlib/struct.pyi +1 -8
  39. package/dist/typeshed-fallback/stdlib/sys/__init__.pyi +7 -5
  40. package/dist/typeshed-fallback/stdlib/termios.pyi +14 -23
  41. package/dist/typeshed-fallback/stdlib/time.pyi +2 -2
  42. package/dist/typeshed-fallback/stdlib/types.pyi +49 -25
  43. package/dist/typeshed-fallback/stdlib/typing.pyi +25 -225
  44. package/dist/typeshed-fallback/stdlib/unicodedata.pyi +2 -2
  45. package/dist/typeshed-fallback/stdlib/zlib.pyi +1 -1
  46. package/package.json +2 -2
@@ -73,7 +73,7 @@ def log(x: _C, base: _C = ..., /) -> complex:
73
73
  """
74
74
  log(z[, base]) -> the logarithm of z to the given base.
75
75
 
76
- If the base not specified, returns the natural logarithm (base e) of z.
76
+ If the base is not specified, returns the natural logarithm (base e) of z.
77
77
  """
78
78
  ...
79
79
  def log10(z: _C, /) -> complex:
@@ -253,7 +253,7 @@ class deque(MutableSequence[_T]):
253
253
  """Return a shallow copy of a deque."""
254
254
  ...
255
255
  def count(self, x: _T, /) -> int:
256
- """D.count(value) -> integer -- return number of occurrences of value"""
256
+ """D.count(value) -- return number of occurrences of value"""
257
257
  ...
258
258
  def extend(self, iterable: Iterable[_T], /) -> None:
259
259
  """Extend the right side of the deque with elements from the iterable"""
@@ -266,7 +266,7 @@ class deque(MutableSequence[_T]):
266
266
  ...
267
267
  def index(self, x: _T, start: int = 0, stop: int = ..., /) -> int:
268
268
  """
269
- D.index(value, [start, [stop]]) -> integer -- return first index of value.
269
+ D.index(value, [start, [stop]]) -- return first index of value.
270
270
  Raises ValueError if the value is not present.
271
271
  """
272
272
  ...
@@ -299,7 +299,7 @@ class deque(MutableSequence[_T]):
299
299
  """Delete self[key]."""
300
300
  ...
301
301
  def __contains__(self, key: object, /) -> bool:
302
- """Return key in self."""
302
+ """Return bool(key in self)."""
303
303
  ...
304
304
  def __reduce__(self) -> tuple[type[Self], tuple[()], None, Iterator[_T]]:
305
305
  """Return state information for pickling."""
@@ -477,25 +477,28 @@ class OrderedDict(dict[_KT, _VT], Reversible[_KT], Generic[_KT, _VT]):
477
477
  @overload
478
478
  def pop(self, key: _KT) -> _VT:
479
479
  """
480
- od.pop(k[,d]) -> v, remove specified key and return the corresponding
481
- value. If key is not found, d is returned if given, otherwise KeyError
482
- is raised.
480
+ od.pop(key[,default]) -> v, remove specified key and return the corresponding value.
481
+
482
+ If the key is not found, return the default if given; otherwise,
483
+ raise a KeyError.
483
484
  """
484
485
  ...
485
486
  @overload
486
487
  def pop(self, key: _KT, default: _VT) -> _VT:
487
488
  """
488
- od.pop(k[,d]) -> v, remove specified key and return the corresponding
489
- value. If key is not found, d is returned if given, otherwise KeyError
490
- is raised.
489
+ od.pop(key[,default]) -> v, remove specified key and return the corresponding value.
490
+
491
+ If the key is not found, return the default if given; otherwise,
492
+ raise a KeyError.
491
493
  """
492
494
  ...
493
495
  @overload
494
496
  def pop(self, key: _KT, default: _T) -> _VT | _T:
495
497
  """
496
- od.pop(k[,d]) -> v, remove specified key and return the corresponding
497
- value. If key is not found, d is returned if given, otherwise KeyError
498
- is raised.
498
+ od.pop(key[,default]) -> v, remove specified key and return the corresponding value.
499
+
500
+ If the key is not found, return the default if given; otherwise,
501
+ raise a KeyError.
499
502
  """
500
503
  ...
501
504
  def __eq__(self, value: object, /) -> bool:
@@ -87,7 +87,7 @@ class date:
87
87
  ...
88
88
  @classmethod
89
89
  def fromisoformat(cls, date_string: str, /) -> Self:
90
- """str -> Construct a date from the output of date.isoformat()"""
90
+ """str -> Construct a date from a string in ISO 8601 format."""
91
91
  ...
92
92
  @classmethod
93
93
  def fromisocalendar(cls, year: int, week: int, day: int) -> Self:
@@ -248,7 +248,7 @@ class time:
248
248
  ...
249
249
  @classmethod
250
250
  def fromisoformat(cls, time_string: str, /) -> Self:
251
- """string -> time from time.isoformat() output"""
251
+ """string -> time from a string in ISO 8601 format"""
252
252
  ...
253
253
  # On <3.12, the name of the parameter in the pure-Python implementation
254
254
  # didn't match the name in the C implementation,
@@ -397,7 +397,7 @@ class timedelta:
397
397
  """Return self==value."""
398
398
  ...
399
399
  def __bool__(self) -> bool:
400
- """self != 0"""
400
+ """True if self else False"""
401
401
  ...
402
402
  def __hash__(self) -> int:
403
403
  """Return hash(self)."""
@@ -4,35 +4,31 @@ import sys
4
4
  from _typeshed import FileDescriptorLike
5
5
 
6
6
  def cancel_dump_traceback_later() -> None:
7
- """
8
- cancel_dump_traceback_later():
9
- cancel the previous call to dump_traceback_later().
10
- """
7
+ """Cancel the previous call to dump_traceback_later()."""
11
8
  ...
12
9
  def disable() -> None:
13
- """disable(): disable the fault handler"""
10
+ """Disable the fault handler."""
14
11
  ...
15
12
  def dump_traceback(file: FileDescriptorLike = ..., all_threads: bool = ...) -> None:
16
- """dump_traceback(file=sys.stderr, all_threads=True): dump the traceback of the current thread, or of all threads if all_threads is True, into file"""
13
+ """Dump the traceback of the current thread, or of all threads if all_threads is True, into file."""
17
14
  ...
18
15
  def dump_traceback_later(timeout: float, repeat: bool = ..., file: FileDescriptorLike = ..., exit: bool = ...) -> None:
19
16
  """
20
- dump_traceback_later(timeout, repeat=False, file=sys.stderrn, exit=False):
21
- dump the traceback of all threads in timeout seconds,
17
+ Dump the traceback of all threads in timeout seconds,
22
18
  or each timeout seconds if repeat is True. If exit is True, call _exit(1) which is not safe.
23
19
  """
24
20
  ...
25
21
  def enable(file: FileDescriptorLike = ..., all_threads: bool = ...) -> None:
26
- """enable(file=sys.stderr, all_threads=True): enable the fault handler"""
22
+ """Enable the fault handler."""
27
23
  ...
28
24
  def is_enabled() -> bool:
29
- """is_enabled()->bool: check if the handler is enabled"""
25
+ """Check if the handler is enabled."""
30
26
  ...
31
27
 
32
28
  if sys.platform != "win32":
33
29
  def register(signum: int, file: FileDescriptorLike = ..., all_threads: bool = ..., chain: bool = ...) -> None:
34
- """register(signum, file=sys.stderr, all_threads=True, chain=False): register a handler for the signal 'signum': dump the traceback of the current thread, or of all threads if all_threads is True, into file"""
30
+ """Register a handler for the signal 'signum': dump the traceback of the current thread, or of all threads if all_threads is True, into file."""
35
31
  ...
36
32
  def unregister(signum: int, /) -> None:
37
- """unregister(signum): unregister the handler of the signal 'signum' registered by register()"""
33
+ """Unregister the handler of the signal 'signum' registered by register()."""
38
34
  ...
@@ -38,27 +38,27 @@ _RWrapper = TypeVar("_RWrapper")
38
38
  @overload
39
39
  def reduce(function: Callable[[_T, _S], _T], sequence: Iterable[_S], initial: _T, /) -> _T:
40
40
  """
41
- reduce(function, sequence[, initial]) -> value
41
+ reduce(function, iterable[, initial]) -> value
42
42
 
43
- Apply a function of two arguments cumulatively to the items of a sequence,
44
- from left to right, so as to reduce the sequence to a single value.
45
- For example, reduce(lambda x, y: x+y, [1, 2, 3, 4, 5]) calculates
43
+ Apply a function of two arguments cumulatively to the items of a sequence
44
+ or iterable, from left to right, so as to reduce the iterable to a single
45
+ value. For example, reduce(lambda x, y: x+y, [1, 2, 3, 4, 5]) calculates
46
46
  ((((1+2)+3)+4)+5). If initial is present, it is placed before the items
47
- of the sequence in the calculation, and serves as a default when the
48
- sequence is empty.
47
+ of the iterable in the calculation, and serves as a default when the
48
+ iterable is empty.
49
49
  """
50
50
  ...
51
51
  @overload
52
52
  def reduce(function: Callable[[_T, _T], _T], sequence: Iterable[_T], /) -> _T:
53
53
  """
54
- reduce(function, sequence[, initial]) -> value
54
+ reduce(function, iterable[, initial]) -> value
55
55
 
56
- Apply a function of two arguments cumulatively to the items of a sequence,
57
- from left to right, so as to reduce the sequence to a single value.
58
- For example, reduce(lambda x, y: x+y, [1, 2, 3, 4, 5]) calculates
56
+ Apply a function of two arguments cumulatively to the items of a sequence
57
+ or iterable, from left to right, so as to reduce the iterable to a single
58
+ value. For example, reduce(lambda x, y: x+y, [1, 2, 3, 4, 5]) calculates
59
59
  ((((1+2)+3)+4)+5). If initial is present, it is placed before the items
60
- of the sequence in the calculation, and serves as a default when the
61
- sequence is empty.
60
+ of the iterable in the calculation, and serves as a default when the
61
+ iterable is empty.
62
62
  """
63
63
  ...
64
64
 
@@ -149,7 +149,12 @@ else:
149
149
 
150
150
  def total_ordering(cls: type[_T]) -> type[_T]: ...
151
151
  def cmp_to_key(mycmp: Callable[[_T, _T], int]) -> Callable[[_T], SupportsAllComparisons]:
152
- """Convert a cmp= function into a key= function."""
152
+ """
153
+ Convert a cmp= function into a key= function.
154
+
155
+ mycmp
156
+ Function that compares two objects.
157
+ """
153
158
  ...
154
159
 
155
160
  class partial(Generic[_T]):
@@ -13,6 +13,7 @@ set_threshold() -- Set the collection thresholds.
13
13
  get_threshold() -- Return the current the collection thresholds.
14
14
  get_objects() -- Return a list of all objects tracked by the collector.
15
15
  is_tracked() -- Returns true if a given object is tracked.
16
+ is_finalized() -- Returns true if a given object has been already finalized.
16
17
  get_referrers() -- Return the list of objects that refer to an object.
17
18
  get_referents() -- Return the list of objects that an object refers to.
18
19
  freeze() -- Freeze all tracked objects and ignore them for future collections.
@@ -269,8 +269,8 @@ class Distribution(_distribution_parent):
269
269
  :return: List of PackagePath for this distribution or None
270
270
 
271
271
  Result is `None` if the metadata file that enumerates files
272
- (i.e. RECORD for dist-info or SOURCES.txt for egg-info) is
273
- missing.
272
+ (i.e. RECORD for dist-info, or installed-files.txt or
273
+ SOURCES.txt for egg-info) is missing.
274
274
  Result may be empty if the metadata exists but is empty.
275
275
  """
276
276
  ...
@@ -294,10 +294,11 @@ class DistributionFinder(MetaPathFinder):
294
294
  @property
295
295
  def path(self) -> list[str]:
296
296
  """
297
- The path that a distribution finder should search.
297
+ The sequence of directory path that a distribution finder
298
+ should search.
298
299
 
299
- Typically refers to Python package paths and defaults
300
- to ``sys.path``.
300
+ Typically refers to Python installed package paths such as
301
+ "site-packages" directories and defaults to ``sys.path``.
301
302
  """
302
303
  ...
303
304
 
@@ -77,9 +77,9 @@ class IOBase(metaclass=abc.ABCMeta):
77
77
  ...
78
78
  def fileno(self) -> int:
79
79
  """
80
- Returns underlying file descriptor if one exists.
80
+ Return underlying file descriptor if one exists.
81
81
 
82
- OSError is raised if the IO object does not use a file descriptor.
82
+ Raise OSError if the IO object does not use a file descriptor.
83
83
  """
84
84
  ...
85
85
  def flush(self) -> None:
@@ -115,15 +115,19 @@ class IOBase(metaclass=abc.ABCMeta):
115
115
  ...
116
116
  def seek(self, offset: int, whence: int = ..., /) -> int:
117
117
  """
118
- Change stream position.
118
+ Change the stream position to the given byte offset.
119
119
 
120
- Change the stream position to the given byte offset. The offset is
121
- interpreted relative to the position indicated by whence. Values
122
- for whence are:
120
+ offset
121
+ The stream position, relative to 'whence'.
122
+ whence
123
+ The relative position to seek from.
123
124
 
124
- * 0 -- start of stream (the default); offset should be zero or positive
125
- * 1 -- current stream position; offset may be negative
126
- * 2 -- end of stream; offset is usually negative
125
+ The offset is interpreted relative to the position indicated by whence.
126
+ Values for whence are:
127
+
128
+ * os.SEEK_SET or 0 -- start of stream (the default); offset should be zero or positive
129
+ * os.SEEK_CUR or 1 -- current stream position; offset may be negative
130
+ * os.SEEK_END or 2 -- end of stream; offset is usually negative
127
131
 
128
132
  Return the new absolute position.
129
133
  """
@@ -143,8 +147,8 @@ class IOBase(metaclass=abc.ABCMeta):
143
147
  """
144
148
  Truncate file to size bytes.
145
149
 
146
- File pointer is left unchanged. Size defaults to the current IO
147
- position as reported by tell(). Returns the new size.
150
+ File pointer is left unchanged. Size defaults to the current IO position
151
+ as reported by tell(). Return the new size.
148
152
  """
149
153
  ...
150
154
  def writable(self) -> bool:
@@ -200,12 +204,12 @@ class BufferedIOBase(IOBase):
200
204
  def readinto(self, buffer: WriteableBuffer, /) -> int: ...
201
205
  def write(self, buffer: ReadableBuffer, /) -> int:
202
206
  """
203
- Write the given buffer to the IO stream.
207
+ Write buffer b to the IO stream.
204
208
 
205
- Returns the number of bytes written, which is always the length of b
206
- in bytes.
209
+ Return the number of bytes written, which is always
210
+ the length of b in bytes.
207
211
 
208
- Raises BlockingIOError if the buffer is full and the
212
+ Raise BlockingIOError if the buffer is full and the
209
213
  underlying raw stream cannot accept more data at the moment.
210
214
  """
211
215
  ...
@@ -214,29 +218,28 @@ class BufferedIOBase(IOBase):
214
218
  """
215
219
  Read and return up to n bytes.
216
220
 
217
- If the argument is omitted, None, or negative, reads and
218
- returns all data until EOF.
221
+ If the size argument is omitted, None, or negative, read and
222
+ return all data until EOF.
219
223
 
220
- If the argument is positive, and the underlying raw stream is
224
+ If the size argument is positive, and the underlying raw stream is
221
225
  not 'interactive', multiple raw reads may be issued to satisfy
222
- the byte count (unless EOF is reached first). But for
223
- interactive raw streams (as well as sockets and pipes), at most
224
- one raw read will be issued, and a short result does not imply
225
- that EOF is imminent.
226
+ the byte count (unless EOF is reached first).
227
+ However, for interactive raw streams (as well as sockets and pipes),
228
+ at most one raw read will be issued, and a short result does not
229
+ imply that EOF is imminent.
226
230
 
227
- Returns an empty bytes object on EOF.
231
+ Return an empty bytes object on EOF.
228
232
 
229
- Returns None if the underlying raw stream was open in non-blocking
233
+ Return None if the underlying raw stream was open in non-blocking
230
234
  mode and no data is available at the moment.
231
235
  """
232
236
  ...
233
237
  def read1(self, size: int = ..., /) -> bytes:
234
238
  """
235
- Read and return up to n bytes, with at most one read() call
236
- to the underlying raw stream. A short result does not imply
237
- that EOF is imminent.
239
+ Read and return up to size bytes, with at most one read() call to the underlying raw stream.
238
240
 
239
- Returns an empty bytes object on EOF.
241
+ Return an empty bytes object on EOF.
242
+ A short result does not imply that EOF is imminent.
240
243
  """
241
244
  ...
242
245
 
@@ -369,15 +372,15 @@ class TextIOBase(IOBase):
369
372
  """
370
373
  Separate the underlying buffer from the TextIOBase and return it.
371
374
 
372
- After the underlying buffer has been detached, the TextIO is in an
373
- unusable state.
375
+ After the underlying buffer has been detached, the TextIO is in an unusable state.
374
376
  """
375
377
  ...
376
378
  def write(self, s: str, /) -> int:
377
379
  """
378
- Write string to stream.
379
- Returns the number of characters written (which is always equal to
380
- the length of the string).
380
+ Write string s to stream.
381
+
382
+ Return the number of characters written
383
+ (which is always equal to the length of the string).
381
384
  """
382
385
  ...
383
386
  def writelines(self, lines: Iterable[str], /) -> None:
@@ -392,7 +395,8 @@ class TextIOBase(IOBase):
392
395
  """
393
396
  Read until newline or EOF.
394
397
 
395
- Returns an empty string if EOF is hit immediately.
398
+ Return an empty string if EOF is hit immediately.
399
+ If size is specified, at most size characters will be read.
396
400
  """
397
401
  ...
398
402
  def readlines(self, hint: int = -1, /) -> list[str]:
@@ -406,10 +410,10 @@ class TextIOBase(IOBase):
406
410
  ...
407
411
  def read(self, size: int | None = ..., /) -> str:
408
412
  """
409
- Read at most n characters from stream.
413
+ Read at most size characters from stream.
410
414
 
411
- Read from underlying buffer until we have n characters or we hit EOF.
412
- If n is negative or omitted, read until EOF.
415
+ Read from underlying buffer until we have size characters or we hit EOF.
416
+ If size is negative or omitted, read until EOF.
413
417
  """
414
418
  ...
415
419
 
@@ -444,7 +448,7 @@ class TextIOWrapper(TextIOBase, TextIO, Generic[_BufferT_co]): # type: ignore[m
444
448
  Character and line based layer over a BufferedIOBase object, buffer.
445
449
 
446
450
  encoding gives the name of the encoding that the stream will be
447
- decoded or encoded with. It defaults to locale.getpreferredencoding(False).
451
+ decoded or encoded with. It defaults to locale.getencoding().
448
452
 
449
453
  errors determines the strictness of encoding and decoding (see
450
454
  help(codecs.Codec) or the documentation for codecs.register) and
@@ -595,8 +599,9 @@ if sys.version_info >= (3, 10):
595
599
  """
596
600
  A helper function to choose the text encoding.
597
601
 
598
- When encoding is not None, just return it.
599
- Otherwise, return the default text encoding (i.e. "locale").
602
+ When encoding is not None, this function returns it.
603
+ Otherwise, this function returns the default text encoding
604
+ (i.e. "locale" or "utf-8" depends on UTF-8 mode).
600
605
 
601
606
  This function emits an EncodingWarning if encoding is None and
602
607
  sys.flags.warn_default_encoding is true.
@@ -610,8 +615,9 @@ if sys.version_info >= (3, 10):
610
615
  """
611
616
  A helper function to choose the text encoding.
612
617
 
613
- When encoding is not None, just return it.
614
- Otherwise, return the default text encoding (i.e. "locale").
618
+ When encoding is not None, this function returns it.
619
+ Otherwise, this function returns the default text encoding
620
+ (i.e. "locale" or "utf-8" depends on UTF-8 mode).
615
621
 
616
622
  This function emits an EncodingWarning if encoding is None and
617
623
  sys.flags.warn_default_encoding is true.
@@ -148,10 +148,10 @@ class _BaseNetwork(_IPAddressBase, Generic[_A]):
148
148
  @property
149
149
  def is_private(self) -> bool:
150
150
  """
151
- Test if this address is allocated for private networks.
151
+ Test if this network belongs to a private range.
152
152
 
153
153
  Returns:
154
- A boolean, True if the address is reserved per
154
+ A boolean, True if the network is reserved per
155
155
  iana-ipv4-special-registry or iana-ipv6-special-registry.
156
156
  """
157
157
  ...
@@ -8,17 +8,19 @@ repeat(elem [,n]) --> elem, elem, elem, ... endlessly or up to n times
8
8
 
9
9
  Iterators terminating on the shortest input sequence:
10
10
  accumulate(p[, func]) --> p0, p0+p1, p0+p1+p2
11
+ batched(p, n) --> [p0, p1, ..., p_n-1], [p_n, p_n+1, ..., p_2n-1], ...
11
12
  chain(p, q, ...) --> p0, p1, ... plast, q0, q1, ...
12
13
  chain.from_iterable([p, q, ...]) --> p0, p1, ... plast, q0, q1, ...
13
14
  compress(data, selectors) --> (d[0] if s[0]), (d[1] if s[1]), ...
14
- dropwhile(pred, seq) --> seq[n], seq[n+1], starting when pred fails
15
+ dropwhile(predicate, seq) --> seq[n], seq[n+1], starting when predicate fails
15
16
  groupby(iterable[, keyfunc]) --> sub-iterators grouped by value of keyfunc(v)
16
- filterfalse(pred, seq) --> elements of seq where pred(elem) is False
17
+ filterfalse(predicate, seq) --> elements of seq where predicate(elem) is False
17
18
  islice(seq, [start,] stop [, step]) --> elements from
18
19
  seq[start:stop:step]
20
+ pairwise(s) --> (s[0],s[1]), (s[1],s[2]), (s[2], s[3]), ...
19
21
  starmap(fun, seq) --> fun(*seq[0]), fun(*seq[1]), ...
20
22
  tee(it, n=2) --> (it1, it2 , ... itn) splits one iterator into n
21
- takewhile(pred, seq) --> seq[0], seq[1], until pred fails
23
+ takewhile(predicate, seq) --> seq[0], seq[1], until predicate fails
22
24
  zip_longest(p, q, ...) --> (p[0], q[0]), (p[1], q[1]), ...
23
25
 
24
26
  Combinatoric generators:
@@ -510,7 +512,7 @@ class combinations_with_replacement(Iterator[_T_co]):
510
512
  """
511
513
  Return successive r-length combinations of elements in the iterable allowing individual elements to have successive repeats.
512
514
 
513
- combinations_with_replacement('ABC', 2) --> AA AB AC BB BC CC"
515
+ combinations_with_replacement('ABC', 2) --> ('A','A'), ('A','B'), ('A','C'), ('B','B'), ('B','C'), ('C','C')
514
516
  """
515
517
  @overload
516
518
  def __new__(cls, iterable: Iterable[_T], r: Literal[2]) -> combinations_with_replacement[tuple[_T, _T]]: ...
@@ -20,19 +20,31 @@ nan: float
20
20
  tau: float
21
21
 
22
22
  def acos(x: _SupportsFloatOrIndex, /) -> float:
23
- """Return the arc cosine (measured in radians) of x."""
23
+ """
24
+ Return the arc cosine (measured in radians) of x.
25
+
26
+ The result is between 0 and pi.
27
+ """
24
28
  ...
25
29
  def acosh(x: _SupportsFloatOrIndex, /) -> float:
26
30
  """Return the inverse hyperbolic cosine of x."""
27
31
  ...
28
32
  def asin(x: _SupportsFloatOrIndex, /) -> float:
29
- """Return the arc sine (measured in radians) of x."""
33
+ """
34
+ Return the arc sine (measured in radians) of x.
35
+
36
+ The result is between -pi/2 and pi/2.
37
+ """
30
38
  ...
31
39
  def asinh(x: _SupportsFloatOrIndex, /) -> float:
32
40
  """Return the inverse hyperbolic sine of x."""
33
41
  ...
34
42
  def atan(x: _SupportsFloatOrIndex, /) -> float:
35
- """Return the arc tangent (measured in radians) of x."""
43
+ """
44
+ Return the arc tangent (measured in radians) of x.
45
+
46
+ The result is between -pi/2 and pi/2.
47
+ """
36
48
  ...
37
49
  def atan2(y: _SupportsFloatOrIndex, x: _SupportsFloatOrIndex, /) -> float:
38
50
  """
@@ -139,7 +151,7 @@ def fabs(x: _SupportsFloatOrIndex, /) -> float:
139
151
  ...
140
152
  def factorial(x: SupportsIndex, /) -> int:
141
153
  """
142
- Find x!.
154
+ Find n!.
143
155
 
144
156
  Raise a ValueError if x is negative or non-integral.
145
157
  """
@@ -278,7 +290,7 @@ def log(x: _SupportsFloatOrIndex, base: _SupportsFloatOrIndex = ...) -> float:
278
290
  log(x, [base=math.e])
279
291
  Return the logarithm of x to the given base.
280
292
 
281
- If the base not specified, returns the natural logarithm (base e) of x.
293
+ If the base is not specified, returns the natural logarithm (base e) of x.
282
294
  """
283
295
  ...
284
296
  def log10(x: _SupportsFloatOrIndex, /) -> float:
@@ -44,7 +44,7 @@ class ShareableList(Generic[_SLT]):
44
44
  def __len__(self) -> int: ...
45
45
  @property
46
46
  def format(self) -> str:
47
- """The struct packing format used by all currently stored values."""
47
+ """The struct packing format used by all currently stored items."""
48
48
  ...
49
49
  def count(self, value: _SLT) -> int: ...
50
50
  def index(self, value: _SLT) -> int: ...
@@ -685,12 +685,12 @@ if sys.platform != "win32":
685
685
  ...
686
686
  def getgrouplist(user: str, group: int, /) -> list[int]:
687
687
  """
688
- getgrouplist(user, group) -> list of groups to which a user belongs
689
-
690
688
  Returns a list of groups to which a user belongs.
691
689
 
692
- user: username to lookup
693
- group: base group id of the user
690
+ user
691
+ username to lookup
692
+ group
693
+ base group id of the user
694
694
  """
695
695
  ...
696
696
  def getgroups() -> list[int]:
@@ -698,7 +698,7 @@ if sys.platform != "win32":
698
698
  ...
699
699
  def initgroups(username: str, gid: int, /) -> None:
700
700
  """
701
- initgroups(username, gid) -> None
701
+ Initialize the group access list.
702
702
 
703
703
  Call the system initgroups() to initialize the group access list with all of
704
704
  the groups of which the specified username is a member, plus the specified
@@ -1007,6 +1007,14 @@ if sys.platform != "win32":
1007
1007
  """
1008
1008
  Change the access permissions of the file given by file descriptor fd.
1009
1009
 
1010
+ fd
1011
+ The file descriptor of the file to be modified.
1012
+ mode
1013
+ Operating-system mode bitfield.
1014
+ Be careful when using number literals for *mode*. The conventional UNIX notation for
1015
+ numeric modes uses an octal base, which needs to be indicated with a ``0o`` prefix in
1016
+ Python.
1017
+
1010
1018
  Equivalent to os.chmod(fd, mode).
1011
1019
  """
1012
1020
  ...
@@ -1140,6 +1148,7 @@ if sys.platform != "win32":
1140
1148
 
1141
1149
  - RWF_DSYNC
1142
1150
  - RWF_SYNC
1151
+ - RWF_APPEND
1143
1152
 
1144
1153
  Using non-zero flags requires Linux 4.7 or newer.
1145
1154
  """
@@ -1164,12 +1173,7 @@ if sys.platform != "win32":
1164
1173
  trailers: Sequence[ReadableBuffer] = ...,
1165
1174
  flags: int = 0,
1166
1175
  ) -> int:
1167
- """
1168
- sendfile(out, in, offset, count) -> byteswritten
1169
- sendfile(out, in, offset, count[, headers][, trailers], flags=0)
1170
- -> byteswritten
1171
- Copy count bytes from file descriptor in to file descriptor out.
1172
- """
1176
+ """Copy count bytes from file descriptor in_fd to file descriptor out_fd."""
1173
1177
  ...
1174
1178
 
1175
1179
  def readv(fd: int, buffers: SupportsLenAndGetItem[WriteableBuffer], /) -> int:
@@ -1324,6 +1328,9 @@ def chmod(path: FileDescriptorOrPath, mode: int, *, dir_fd: int | None = None, f
1324
1328
  If this functionality is unavailable, using it raises an exception.
1325
1329
  mode
1326
1330
  Operating-system mode bitfield.
1331
+ Be careful when using number literals for *mode*. The conventional UNIX notation for
1332
+ numeric modes uses an octal base, which needs to be indicated with a ``0o`` prefix in
1333
+ Python.
1327
1334
  dir_fd
1328
1335
  If not None, it should be a file descriptor open to a directory,
1329
1336
  and path should be relative; path will then be relative to that
@@ -1452,7 +1459,8 @@ def mkdir(path: StrOrBytesPath, mode: int = 0o777, *, dir_fd: int | None = None)
1452
1459
  dir_fd may not be implemented on your platform.
1453
1460
  If it is unavailable, using it will raise a NotImplementedError.
1454
1461
 
1455
- The mode argument is ignored on Windows.
1462
+ The mode argument is ignored on Windows. Where it is used, the current umask
1463
+ value is first masked out.
1456
1464
  """
1457
1465
  ...
1458
1466
 
@@ -2158,7 +2166,7 @@ if sys.platform != "win32":
2158
2166
  @final
2159
2167
  class sched_param(structseq[int], tuple[int]):
2160
2168
  """
2161
- Current has only one field: sched_priority");
2169
+ Currently has only one field: sched_priority
2162
2170
 
2163
2171
  sched_priority
2164
2172
  A scheduling parameter.
@@ -2192,7 +2200,7 @@ if sys.platform != "win32":
2192
2200
  ...
2193
2201
  def sched_getscheduler(pid: int, /) -> int:
2194
2202
  """
2195
- Get the scheduling policy for the process identifiedy by pid.
2203
+ Get the scheduling policy for the process identified by pid.
2196
2204
 
2197
2205
  Passing 0 for pid returns the scheduling policy for the calling process.
2198
2206
  """