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
@@ -11,48 +11,35 @@ if sys.platform != "win32":
11
11
  _CompDisp: TypeAlias = Callable[[str, Sequence[str], int], None]
12
12
 
13
13
  def parse_and_bind(string: str, /) -> None:
14
- """
15
- parse_and_bind(string) -> None
16
- Execute the init line provided in the string argument.
17
- """
14
+ """Execute the init line provided in the string argument."""
18
15
  ...
19
16
  def read_init_file(filename: StrOrBytesPath | None = None, /) -> None:
20
17
  """
21
- read_init_file([filename]) -> None
22
18
  Execute a readline initialization file.
19
+
23
20
  The default filename is the last filename used.
24
21
  """
25
22
  ...
26
23
  def get_line_buffer() -> str:
27
- """
28
- get_line_buffer() -> string
29
- return the current contents of the line buffer.
30
- """
24
+ """Return the current contents of the line buffer."""
31
25
  ...
32
26
  def insert_text(string: str, /) -> None:
33
- """
34
- insert_text(string) -> None
35
- Insert text into the line buffer at the cursor position.
36
- """
27
+ """Insert text into the line buffer at the cursor position."""
37
28
  ...
38
29
  def redisplay() -> None:
39
- """
40
- redisplay() -> None
41
- Change what's displayed on the screen to reflect the current
42
- contents of the line buffer.
43
- """
30
+ """Change what's displayed on the screen to reflect contents of the line buffer."""
44
31
  ...
45
32
  def read_history_file(filename: StrOrBytesPath | None = None, /) -> None:
46
33
  """
47
- read_history_file([filename]) -> None
48
34
  Load a readline history file.
35
+
49
36
  The default filename is ~/.history.
50
37
  """
51
38
  ...
52
39
  def write_history_file(filename: StrOrBytesPath | None = None, /) -> None:
53
40
  """
54
- write_history_file([filename]) -> None
55
41
  Save a readline history file.
42
+
56
43
  The default filename is ~/.history.
57
44
  """
58
45
  ...
@@ -64,66 +51,44 @@ if sys.platform != "win32":
64
51
  """
65
52
  ...
66
53
  def get_history_length() -> int:
67
- """
68
- get_history_length() -> int
69
- return the maximum number of lines that will be written to
70
- the history file.
71
- """
54
+ """Return the maximum number of lines that will be written to the history file."""
72
55
  ...
73
56
  def set_history_length(length: int, /) -> None:
74
57
  """
75
- set_history_length(length) -> None
76
- set the maximal number of lines which will be written to
77
- the history file. A negative length is used to inhibit
78
- history truncation.
58
+ Set the maximal number of lines which will be written to the history file.
59
+
60
+ A negative length is used to inhibit history truncation.
79
61
  """
80
62
  ...
81
63
  def clear_history() -> None:
82
- """
83
- clear_history() -> None
84
- Clear the current readline history.
85
- """
64
+ """Clear the current readline history."""
86
65
  ...
87
66
  def get_current_history_length() -> int:
88
- """
89
- get_current_history_length() -> integer
90
- return the current (not the maximum) length of history.
91
- """
67
+ """Return the current (not the maximum) length of history."""
92
68
  ...
93
69
  def get_history_item(index: int, /) -> str:
94
- """
95
- get_history_item() -> string
96
- return the current contents of history item at index.
97
- """
70
+ """Return the current contents of history item at one-based index."""
98
71
  ...
99
72
  def remove_history_item(pos: int, /) -> None:
100
- """
101
- remove_history_item(pos) -> None
102
- remove history item given by its position
103
- """
73
+ """Remove history item given by its zero-based position."""
104
74
  ...
105
75
  def replace_history_item(pos: int, line: str, /) -> None:
106
76
  """
107
- replace_history_item(pos, line) -> None
108
- replaces history item given by its position with contents of line
77
+ Replaces history item given by its position with contents of line.
78
+
79
+ pos is zero-based.
109
80
  """
110
81
  ...
111
82
  def add_history(string: str, /) -> None:
112
- """
113
- add_history(string) -> None
114
- add an item to the history buffer
115
- """
83
+ """Add an item to the history buffer."""
116
84
  ...
117
85
  def set_auto_history(enabled: bool, /) -> None:
118
- """
119
- set_auto_history(enabled) -> None
120
- Enables or disables automatic history.
121
- """
86
+ """Enables or disables automatic history."""
122
87
  ...
123
88
  def set_startup_hook(function: Callable[[], object] | None = None, /) -> None:
124
89
  """
125
- set_startup_hook([function]) -> None
126
90
  Set or remove the function invoked by the rl_startup_hook callback.
91
+
127
92
  The function is called with no arguments just
128
93
  before readline prints the first prompt.
129
94
  """
@@ -139,54 +104,35 @@ if sys.platform != "win32":
139
104
  ...
140
105
  def set_completer(function: _Completer | None = None, /) -> None:
141
106
  """
142
- set_completer([function]) -> None
143
107
  Set or remove the completer function.
108
+
144
109
  The function is called as function(text, state),
145
110
  for state in 0, 1, 2, ..., until it returns a non-string.
146
111
  It should return the next possible completion starting with 'text'.
147
112
  """
148
113
  ...
149
114
  def get_completer() -> _Completer | None:
150
- """
151
- get_completer() -> function
152
-
153
- Returns current completer function.
154
- """
115
+ """Get the current completer function."""
155
116
  ...
156
117
  def get_completion_type() -> int:
157
- """
158
- get_completion_type() -> int
159
- Get the type of completion being attempted.
160
- """
118
+ """Get the type of completion being attempted."""
161
119
  ...
162
120
  def get_begidx() -> int:
163
- """
164
- get_begidx() -> int
165
- get the beginning index of the completion scope
166
- """
121
+ """Get the beginning index of the completion scope."""
167
122
  ...
168
123
  def get_endidx() -> int:
169
- """
170
- get_endidx() -> int
171
- get the ending index of the completion scope
172
- """
124
+ """Get the ending index of the completion scope."""
173
125
  ...
174
126
  def set_completer_delims(string: str, /) -> None:
175
- """
176
- set_completer_delims(string) -> None
177
- set the word delimiters for completion
178
- """
127
+ """Set the word delimiters for completion."""
179
128
  ...
180
129
  def get_completer_delims() -> str:
181
- """
182
- get_completer_delims() -> string
183
- get the word delimiters for completion
184
- """
130
+ """Get the word delimiters for completion."""
185
131
  ...
186
132
  def set_completion_display_matches_hook(function: _CompDisp | None = None, /) -> None:
187
133
  """
188
- set_completion_display_matches_hook([function]) -> None
189
134
  Set or remove the completion display function.
135
+
190
136
  The function is called as
191
137
  function(substitution, [matches], longest_match_length)
192
138
  once each time matches need to be displayed.
@@ -69,9 +69,8 @@ _HANDLER: TypeAlias = Callable[[int, FrameType | None], Any] | int | Handlers |
69
69
 
70
70
  def default_int_handler(signalnum: int, frame: FrameType | None, /) -> Never:
71
71
  """
72
- default_int_handler(...)
73
-
74
72
  The default handler for SIGINT installed by Python.
73
+
75
74
  It raises KeyboardInterrupt.
76
75
  """
77
76
  ...
@@ -239,8 +238,9 @@ def strsignal(signalnum: _SIGNUM, /) -> str | None:
239
238
  """
240
239
  Return the system description of the given signal.
241
240
 
242
- The return values can be such as "Interrupt", "Segmentation fault", etc.
243
- Returns None if the signal is not recognized.
241
+ Returns the description of signal *signalnum*, such as "Interrupt"
242
+ for :const:`SIGINT`. Returns :const:`None` if *signalnum* has no
243
+ description. Raises :exc:`ValueError` if *signalnum* is invalid.
244
244
  """
245
245
  ...
246
246
  def valid_signals() -> set[Signals]: ...
@@ -219,18 +219,14 @@ if sys.version_info >= (3, 12):
219
219
  # Can take or return anything depending on what's in the registry.
220
220
  @overload
221
221
  def adapt(obj: Any, proto: Any, /) -> Any:
222
- """adapt(obj, protocol, alternate) -> adapt obj to given protocol. Non-standard."""
222
+ """Adapt given object to given protocol."""
223
223
  ...
224
224
  @overload
225
225
  def adapt(obj: Any, proto: Any, alt: _T, /) -> Any | _T:
226
- """adapt(obj, protocol, alternate) -> adapt obj to given protocol. Non-standard."""
226
+ """Adapt given object to given protocol."""
227
227
  ...
228
228
  def complete_statement(statement: str) -> bool:
229
- """
230
- complete_statement(sql)
231
-
232
- Checks if a string contains a complete SQL statement. Non-standard.
233
- """
229
+ """Checks if a string contains a complete SQL statement."""
234
230
  ...
235
231
 
236
232
  if sys.version_info >= (3, 12):
@@ -306,12 +302,10 @@ else:
306
302
  uri: bool = False,
307
303
  ) -> Connection:
308
304
  """
309
- connect(database[, timeout, detect_types, isolation_level,
310
- check_same_thread, factory, cached_statements, uri])
305
+ Opens a connection to the SQLite database file database.
311
306
 
312
- Opens a connection to the SQLite database file *database*. You can use
313
- ":memory:" to open a database connection to a database that resides in
314
- RAM instead of on disk.
307
+ You can use ":memory:" to open a database connection to a database that resides
308
+ in RAM instead of on disk.
315
309
  """
316
310
  ...
317
311
  @overload
@@ -326,12 +320,10 @@ else:
326
320
  uri: bool = False,
327
321
  ) -> _ConnectionT:
328
322
  """
329
- connect(database[, timeout, detect_types, isolation_level,
330
- check_same_thread, factory, cached_statements, uri])
323
+ Opens a connection to the SQLite database file database.
331
324
 
332
- Opens a connection to the SQLite database file *database*. You can use
333
- ":memory:" to open a database connection to a database that resides in
334
- RAM instead of on disk.
325
+ You can use ":memory:" to open a database connection to a database that resides
326
+ in RAM instead of on disk.
335
327
  """
336
328
  ...
337
329
  @overload
@@ -347,21 +339,15 @@ else:
347
339
  uri: bool = False,
348
340
  ) -> _ConnectionT:
349
341
  """
350
- connect(database[, timeout, detect_types, isolation_level,
351
- check_same_thread, factory, cached_statements, uri])
342
+ Opens a connection to the SQLite database file database.
352
343
 
353
- Opens a connection to the SQLite database file *database*. You can use
354
- ":memory:" to open a database connection to a database that resides in
355
- RAM instead of on disk.
344
+ You can use ":memory:" to open a database connection to a database that resides
345
+ in RAM instead of on disk.
356
346
  """
357
347
  ...
358
348
 
359
349
  def enable_callback_tracebacks(enable: bool, /) -> None:
360
- """
361
- enable_callback_tracebacks(flag)
362
-
363
- Enable or disable callback functions throwing errors to stderr.
364
- """
350
+ """Enable or disable callback functions throwing errors to stderr."""
365
351
  ...
366
352
 
367
353
  if sys.version_info < (3, 12):
@@ -371,7 +357,6 @@ if sys.version_info < (3, 12):
371
357
  enable_shared_cache(do_enable)
372
358
 
373
359
  Enable or disable shared cache mode for the calling thread.
374
- Experimental/Non-standard.
375
360
  """
376
361
  ...
377
362
 
@@ -388,14 +373,14 @@ else:
388
373
  """
389
374
  register_adapter(type, callable)
390
375
 
391
- Registers an adapter with pysqlite's adapter registry. Non-standard.
376
+ Registers an adapter with sqlite3's adapter registry.
392
377
  """
393
378
  ...
394
379
  def register_converter(name: str, converter: _Converter, /) -> None:
395
380
  """
396
381
  register_converter(typename, callable)
397
382
 
398
- Registers a converter with pysqlite. Non-standard.
383
+ Registers a converter with sqlite3.
399
384
  """
400
385
  ...
401
386
 
@@ -481,7 +466,11 @@ class Connection:
481
466
  ) -> None: ...
482
467
 
483
468
  def close(self) -> None:
484
- """Closes the connection."""
469
+ """
470
+ Close the database connection.
471
+
472
+ Any pending transaction is not committed implicitly.
473
+ """
485
474
  ...
486
475
  if sys.version_info >= (3, 11):
487
476
  def blobopen(self, table: str, column: str, row: int, /, *, readonly: bool = False, name: str = "main") -> Blob:
@@ -502,10 +491,14 @@ class Connection:
502
491
  ...
503
492
 
504
493
  def commit(self) -> None:
505
- """Commit the current transaction."""
494
+ """
495
+ Commit any pending transaction to the database.
496
+
497
+ If there is no open transaction, this method is a no-op.
498
+ """
506
499
  ...
507
500
  def create_aggregate(self, name: str, n_arg: int, aggregate_class: Callable[[], _AggregateProtocol]) -> None:
508
- """Creates a new aggregate. Non-standard."""
501
+ """Creates a new aggregate."""
509
502
  ...
510
503
  if sys.version_info >= (3, 11):
511
504
  # num_params determines how many params will be passed to the aggregate class. We provide an overload
@@ -564,12 +557,12 @@ class Connection:
564
557
  ...
565
558
 
566
559
  def create_collation(self, name: str, callback: Callable[[str, str], int | SupportsIndex] | None, /) -> None:
567
- """Creates a collation function. Non-standard."""
560
+ """Creates a collation function."""
568
561
  ...
569
562
  def create_function(
570
563
  self, name: str, narg: int, func: Callable[..., _SqliteData] | None, *, deterministic: bool = False
571
564
  ) -> None:
572
- """Creates a new function. Non-standard."""
565
+ """Creates a new function."""
573
566
  ...
574
567
  @overload
575
568
  def cursor(self, factory: None = None) -> Cursor:
@@ -580,45 +573,49 @@ class Connection:
580
573
  """Return a cursor for the connection."""
581
574
  ...
582
575
  def execute(self, sql: str, parameters: _Parameters = ..., /) -> Cursor:
583
- """Executes a SQL statement. Non-standard."""
576
+ """Executes an SQL statement."""
584
577
  ...
585
578
  def executemany(self, sql: str, parameters: Iterable[_Parameters], /) -> Cursor:
586
- """Repeatedly executes a SQL statement. Non-standard."""
579
+ """Repeatedly executes an SQL statement."""
587
580
  ...
588
581
  def executescript(self, sql_script: str, /) -> Cursor:
589
- """Executes a multiple SQL statements at once. Non-standard."""
582
+ """Executes multiple SQL statements at once."""
590
583
  ...
591
584
  def interrupt(self) -> None:
592
- """Abort any pending database operation. Non-standard."""
585
+ """Abort any pending database operation."""
593
586
  ...
594
587
  if sys.version_info >= (3, 13):
595
588
  def iterdump(self, *, filter: str | None = None) -> Generator[str, None, None]: ...
596
589
  else:
597
590
  def iterdump(self) -> Generator[str, None, None]:
598
- """Returns iterator to the dump of the database in an SQL text format. Non-standard."""
591
+ """Returns iterator to the dump of the database in an SQL text format."""
599
592
  ...
600
593
 
601
594
  def rollback(self) -> None:
602
- """Roll back the current transaction."""
595
+ """
596
+ Roll back to the start of any pending transaction.
597
+
598
+ If there is no open transaction, this method is a no-op.
599
+ """
603
600
  ...
604
601
  def set_authorizer(
605
602
  self, authorizer_callback: Callable[[int, str | None, str | None, str | None, str | None], int] | None
606
603
  ) -> None:
607
- """Sets authorizer callback. Non-standard."""
604
+ """Sets authorizer callback."""
608
605
  ...
609
606
  def set_progress_handler(self, progress_handler: Callable[[], int | None] | None, n: int) -> None:
610
- """Sets progress handler callback. Non-standard."""
607
+ """Sets progress handler callback."""
611
608
  ...
612
609
  def set_trace_callback(self, trace_callback: Callable[[str], object] | None) -> None:
613
- """Sets a trace callback called for each SQL statement (passed as unicode). Non-standard."""
610
+ """Sets a trace callback called for each SQL statement (passed as unicode)."""
614
611
  ...
615
612
  # enable_load_extension and load_extension is not available on python distributions compiled
616
613
  # without sqlite3 loadable extension support. see footnotes https://docs.python.org/3/library/sqlite3.html#f1
617
614
  def enable_load_extension(self, enable: bool, /) -> None:
618
- """Enable dynamic loading of SQLite extension modules. Non-standard."""
615
+ """Enable dynamic loading of SQLite extension modules."""
619
616
  ...
620
617
  def load_extension(self, name: str, /) -> None:
621
- """Load SQLite extension module. Non-standard."""
618
+ """Load SQLite extension module."""
622
619
  ...
623
620
  def backup(
624
621
  self,
@@ -629,7 +626,7 @@ class Connection:
629
626
  name: str = "main",
630
627
  sleep: float = 0.25,
631
628
  ) -> None:
632
- """Makes a backup of the database. Non-standard."""
629
+ """Makes a backup of the database."""
633
630
  ...
634
631
  if sys.version_info >= (3, 11):
635
632
  def setlimit(self, category: int, limit: int, /) -> int:
@@ -707,12 +704,20 @@ class Connection:
707
704
  """Call self as a function."""
708
705
  ...
709
706
  def __enter__(self) -> Self:
710
- """For context manager. Non-standard."""
707
+ """
708
+ Called when the connection is used as a context manager.
709
+
710
+ Returns itself as a convenience to the caller.
711
+ """
711
712
  ...
712
713
  def __exit__(
713
714
  self, type: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None, /
714
715
  ) -> Literal[False]:
715
- """For context manager. Non-standard."""
716
+ """
717
+ Called when the connection is used as a context manager.
718
+
719
+ If there was any exception, a rollback takes place; otherwise we commit.
720
+ """
716
721
  ...
717
722
 
718
723
  class Cursor(Iterator[Any]):
@@ -732,19 +737,24 @@ class Cursor(Iterator[Any]):
732
737
  """Closes the cursor."""
733
738
  ...
734
739
  def execute(self, sql: str, parameters: _Parameters = (), /) -> Self:
735
- """Executes a SQL statement."""
740
+ """Executes an SQL statement."""
736
741
  ...
737
742
  def executemany(self, sql: str, seq_of_parameters: Iterable[_Parameters], /) -> Self:
738
- """Repeatedly executes a SQL statement."""
743
+ """Repeatedly executes an SQL statement."""
739
744
  ...
740
745
  def executescript(self, sql_script: str, /) -> Cursor:
741
- """Executes a multiple SQL statements at once. Non-standard."""
746
+ """Executes multiple SQL statements at once."""
742
747
  ...
743
748
  def fetchall(self) -> list[Any]:
744
749
  """Fetches all rows from the resultset."""
745
750
  ...
746
751
  def fetchmany(self, size: int | None = 1) -> list[Any]:
747
- """Fetches several rows from the resultset."""
752
+ """
753
+ Fetches several rows from the resultset.
754
+
755
+ size
756
+ The default value is set by the Cursor.arraysize attribute.
757
+ """
748
758
  ...
749
759
  # Returns either a row (as created by the row_factory) or None, but
750
760
  # putting None in the return annotation causes annoying false positives.
@@ -752,10 +762,10 @@ class Cursor(Iterator[Any]):
752
762
  """Fetches one row from the resultset."""
753
763
  ...
754
764
  def setinputsizes(self, sizes: Unused, /) -> None:
755
- """Required by DB-API. Does nothing in pysqlite."""
765
+ """Required by DB-API. Does nothing in sqlite3."""
756
766
  ...
757
767
  def setoutputsize(self, size: Unused, column: Unused = None, /) -> None:
758
- """Required by DB-API. Does nothing in pysqlite."""
768
+ """Required by DB-API. Does nothing in sqlite3."""
759
769
  ...
760
770
  def __iter__(self) -> Self:
761
771
  """Implement iter(self)."""
@@ -114,7 +114,7 @@ if sys.version_info < (3, 12):
114
114
 
115
115
  def RAND_status() -> bool:
116
116
  """
117
- Returns 1 if the OpenSSL PRNG has been seeded with enough data and 0 if not.
117
+ Returns True if the OpenSSL PRNG has been seeded with enough data and False if not.
118
118
 
119
119
  It is necessary to seed the PRNG with RAND_add() on some platforms before
120
120
  using the ssl() function.
@@ -57,14 +57,7 @@ def calcsize(format: str | bytes, /) -> int:
57
57
  ...
58
58
 
59
59
  class Struct:
60
- """
61
- Create a compiled struct object.
62
-
63
- Return a new Struct object which writes and reads binary data according to
64
- the format string.
65
-
66
- See help(struct) for more on format strings.
67
- """
60
+ """Struct(fmt) --> compiled struct object"""
68
61
  @property
69
62
  def format(self) -> str:
70
63
  """struct format string"""
@@ -19,11 +19,13 @@ stderr -- standard error object; used for error messages
19
19
  By assigning other file objects (or objects that behave like files)
20
20
  to these, it is possible to redirect all of the interpreter's I/O.
21
21
 
22
+ last_exc - the last uncaught exception
23
+ Only available in an interactive session after a
24
+ traceback has been printed.
22
25
  last_type -- type of last uncaught exception
23
26
  last_value -- value of last uncaught exception
24
27
  last_traceback -- traceback of last uncaught exception
25
- These three are only available in an interactive session after a
26
- traceback has been printed.
28
+ These three are the (deprecated) legacy representation of last_exc.
27
29
 
28
30
  Static objects:
29
31
 
@@ -54,7 +56,8 @@ Functions:
54
56
 
55
57
  displayhook() -- print an object to the screen, and save it in builtins._
56
58
  excepthook() -- print an exception and its traceback to sys.stderr
57
- exc_info() -- return thread-safe information about the current exception
59
+ exception() -- return the current thread's active exception
60
+ exc_info() -- return information about the current thread's active exception
58
61
  exit() -- exit the interpreter by raising SystemExit
59
62
  getdlopenflags() -- returns flags to be used for dlopen() calls
60
63
  getprofile() -- get the global profiling function
@@ -62,7 +65,6 @@ getrefcount() -- return the reference count for an object (plus one :-)
62
65
  getrecursionlimit() -- return the max recursion depth for the interpreter
63
66
  getsizeof() -- return the size of an object in bytes
64
67
  gettrace() -- get the global debug tracing function
65
- setcheckinterval() -- control how often the interpreter checks for events
66
68
  setdlopenflags() -- set the flags to be used for dlopen() calls
67
69
  setprofile() -- set the global profiling function
68
70
  setrecursionlimit() -- set the max recursion depth for the interpreter
@@ -648,7 +650,7 @@ def get_asyncgen_hooks() -> _asyncgen_hooks:
648
650
  ...
649
651
  def set_asyncgen_hooks(firstiter: _AsyncgenHook = ..., finalizer: _AsyncgenHook = ...) -> None:
650
652
  """
651
- set_asyncgen_hooks(* [, firstiter] [, finalizer])
653
+ set_asyncgen_hooks([firstiter] [, finalizer])
652
654
 
653
655
  Set a finalizer for async generators objects.
654
656
  """
@@ -267,61 +267,52 @@ if sys.platform != "win32":
267
267
 
268
268
  def tcgetattr(fd: FileDescriptorLike, /) -> _AttrReturn:
269
269
  """
270
- tcgetattr(fd) -> list_of_attrs
270
+ Get the tty attributes for file descriptor fd.
271
271
 
272
- Get the tty attributes for file descriptor fd, as follows:
273
- [iflag, oflag, cflag, lflag, ispeed, ospeed, cc] where cc is a list
274
- of the tty special characters (each a string of length 1, except the items
275
- with indices VMIN and VTIME, which are integers when these fields are
276
- defined). The interpretation of the flags and the speeds as well as the
277
- indexing in the cc array must be done using the symbolic constants defined
278
- in this module.
272
+ Returns a list [iflag, oflag, cflag, lflag, ispeed, ospeed, cc]
273
+ where cc is a list of the tty special characters (each a string of
274
+ length 1, except the items with indices VMIN and VTIME, which are
275
+ integers when these fields are defined). The interpretation of the
276
+ flags and the speeds as well as the indexing in the cc array must be
277
+ done using the symbolic constants defined in this module.
279
278
  """
280
279
  ...
281
280
  def tcsetattr(fd: FileDescriptorLike, when: int, attributes: _Attr, /) -> None:
282
281
  """
283
- tcsetattr(fd, when, attributes) -> None
284
-
285
282
  Set the tty attributes for file descriptor fd.
283
+
286
284
  The attributes to be set are taken from the attributes argument, which
287
285
  is a list like the one returned by tcgetattr(). The when argument
288
286
  determines when the attributes are changed: termios.TCSANOW to
289
287
  change immediately, termios.TCSADRAIN to change after transmitting all
290
288
  queued output, or termios.TCSAFLUSH to change after transmitting all
291
- queued output and discarding all queued input.
289
+ queued output and discarding all queued input.
292
290
  """
293
291
  ...
294
292
  def tcsendbreak(fd: FileDescriptorLike, duration: int, /) -> None:
295
293
  """
296
- tcsendbreak(fd, duration) -> None
297
-
298
294
  Send a break on file descriptor fd.
295
+
299
296
  A zero duration sends a break for 0.25-0.5 seconds; a nonzero duration
300
297
  has a system dependent meaning.
301
298
  """
302
299
  ...
303
300
  def tcdrain(fd: FileDescriptorLike, /) -> None:
304
- """
305
- tcdrain(fd) -> None
306
-
307
- Wait until all output written to file descriptor fd has been transmitted.
308
- """
301
+ """Wait until all output written to file descriptor fd has been transmitted."""
309
302
  ...
310
303
  def tcflush(fd: FileDescriptorLike, queue: int, /) -> None:
311
304
  """
312
- tcflush(fd, queue) -> None
313
-
314
305
  Discard queued data on file descriptor fd.
306
+
315
307
  The queue selector specifies which queue: termios.TCIFLUSH for the input
316
308
  queue, termios.TCOFLUSH for the output queue, or termios.TCIOFLUSH for
317
- both queues.
309
+ both queues.
318
310
  """
319
311
  ...
320
312
  def tcflow(fd: FileDescriptorLike, action: int, /) -> None:
321
313
  """
322
- tcflow(fd, action) -> None
323
-
324
314
  Suspend or resume input or output on file descriptor fd.
315
+
325
316
  The action argument can be termios.TCOOFF to suspend output,
326
317
  termios.TCOON to restart output, termios.TCIOFF to suspend input,
327
318
  or termios.TCION to restart input.
@@ -4,8 +4,8 @@ This module provides various functions to manipulate time values.
4
4
  There are two standard representations of time. One is the number
5
5
  of seconds since the Epoch, in UTC (a.k.a. GMT). It may be an integer
6
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).
7
+ The epoch is the point where the time starts, the return value of time.gmtime(0).
8
+ It is January 1, 1970, 00:00:00 (UTC) on all platforms.
9
9
 
10
10
  The other representation is a tuple of 9 integers giving local time.
11
11
  The tuple items are: