Skip to content

Commit 4f75397

Browse files
committed
Deploying to gh-pages from @ a39cf22 🚀
1 parent 51fa413 commit 4f75397

File tree

656 files changed

+25573
-8228
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

656 files changed

+25573
-8228
lines changed

_images/datetime-inheritance.svg

Lines changed: 84 additions & 0 deletions
Loading

_sources/bugs.rst.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ stability. In order to maintain this reputation, the developers would like to
99
know of any deficiencies you find in Python.
1010

1111
It can be sometimes faster to fix bugs yourself and contribute patches to
12-
Python as it streamlines the process and involves less people. Learn how to
12+
Python as it streamlines the process and involves fewer people. Learn how to
1313
:ref:`contribute <contributing-to-python>`.
1414

1515
Documentation bugs

_sources/c-api/exceptions.rst.txt

Lines changed: 35 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -673,28 +673,46 @@ Signal Handling
673673
single: SIGINT (C macro)
674674
single: KeyboardInterrupt (built-in exception)
675675
676-
This function interacts with Python's signal handling.
676+
Handle external interruptions, such as signals or activating a debugger,
677+
whose processing has been delayed until it is safe
678+
to run Python code and/or raise exceptions.
677679
678-
If the function is called from the main thread and under the main Python
679-
interpreter, it checks whether a signal has been sent to the processes
680-
and if so, invokes the corresponding signal handler. If the :mod:`signal`
681-
module is supported, this can invoke a signal handler written in Python.
680+
For example, pressing :kbd:`Ctrl-C` causes a terminal to send the
681+
:py:data:`signal.SIGINT` signal.
682+
This function executes the corresponding Python signal handler, which,
683+
by default, raises the :exc:`KeyboardInterrupt` exception.
682684
683-
The function attempts to handle all pending signals, and then returns ``0``.
684-
However, if a Python signal handler raises an exception, the error
685-
indicator is set and the function returns ``-1`` immediately (such that
686-
other pending signals may not have been handled yet: they will be on the
687-
next :c:func:`PyErr_CheckSignals()` invocation).
685+
:c:func:`!PyErr_CheckSignals` should be called by long-running C code
686+
frequently enough so that the response appears immediate to humans.
688687
689-
If the function is called from a non-main thread, or under a non-main
690-
Python interpreter, it does nothing and returns ``0``.
688+
Handlers invoked by this function currently include:
691689
692-
This function can be called by long-running C code that wants to
693-
be interruptible by user requests (such as by pressing Ctrl-C).
690+
- Signal handlers, including Python functions registered using
691+
the :mod:`signal` module.
694692
695-
.. note::
696-
The default Python signal handler for :c:macro:`!SIGINT` raises the
697-
:exc:`KeyboardInterrupt` exception.
693+
Signal handlers are only run in the main thread of the main interpreter.
694+
695+
(This is where the function got the name: originally, signals
696+
were the only way to interrupt the interpreter.)
697+
698+
- Running the garbage collector, if necessary.
699+
700+
- Executing a pending :ref:`remote debugger <remote-debugging>` script.
701+
702+
If any handler raises an exception, immediately return ``-1`` with that
703+
exception set.
704+
Any remaining interruptions are left to be processed on the next
705+
:c:func:`PyErr_CheckSignals()` invocation, if appropriate.
706+
707+
If all handlers finish successfully, or there are no handlers to run,
708+
return ``0``.
709+
710+
.. versionchanged:: 3.12
711+
This function may now invoke the garbage collector.
712+
713+
.. versionchanged:: 3.14
714+
This function may now execute a remote debugger script, if remote
715+
debugging is enabled.
698716
699717
700718
.. c:function:: void PyErr_SetInterrupt()

_sources/c-api/float.rst.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ Floating-Point Objects
8080
8181
.. c:macro:: Py_INFINITY
8282
83-
This macro expands a to constant expression of type :c:expr:`double`, that
83+
This macro expands to a constant expression of type :c:expr:`double`, that
8484
represents the positive infinity.
8585
8686
On most platforms, this is equivalent to the :c:macro:`!INFINITY` macro from
@@ -89,7 +89,7 @@ Floating-Point Objects
8989
9090
.. c:macro:: Py_NAN
9191
92-
This macro expands a to constant expression of type :c:expr:`double`, that
92+
This macro expands to a constant expression of type :c:expr:`double`, that
9393
represents a quiet not-a-number (qNaN) value.
9494
9595
On most platforms, this is equivalent to the :c:macro:`!NAN` macro from

_sources/c-api/init.rst.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ Initializing and finalizing the interpreter
431431
432432
Note that Python will do a best effort at freeing all memory allocated by the Python
433433
interpreter. Therefore, any C-Extension should make sure to correctly clean up all
434-
of the preveiously allocated PyObjects before using them in subsequent calls to
434+
of the previously allocated PyObjects before using them in subsequent calls to
435435
:c:func:`Py_Initialize`. Otherwise it could introduce vulnerabilities and incorrect
436436
behavior.
437437
@@ -1592,7 +1592,7 @@ All of the following functions must be called after :c:func:`Py_Initialize`.
15921592
15931593
Get the current interpreter.
15941594
1595-
Issue a fatal error if there no :term:`attached thread state`.
1595+
Issue a fatal error if there is no :term:`attached thread state`.
15961596
It cannot return NULL.
15971597
15981598
.. versionadded:: 3.9
@@ -2163,7 +2163,7 @@ Python-level trace functions in previous versions.
21632163
*what* when after any bytecode is processed after which the exception becomes
21642164
set within the frame being executed. The effect of this is that as exception
21652165
propagation causes the Python stack to unwind, the callback is called upon
2166-
return to each frame as the exception propagates. Only trace functions receives
2166+
return to each frame as the exception propagates. Only trace functions receive
21672167
these events; they are not needed by the profiler.
21682168
21692169
@@ -2291,7 +2291,7 @@ Reference tracing
22912291
the tracer function is called. Return ``0`` on success. Set an exception and
22922292
return ``-1`` on error.
22932293
2294-
Not that tracer functions **must not** create Python objects inside or
2294+
Note that tracer functions **must not** create Python objects inside or
22952295
otherwise the call will be re-entrant. The tracer also **must not** clear
22962296
any existing exception or set an exception. A :term:`thread state` will be active
22972297
every time the tracer function is called.

_sources/c-api/init_config.rst.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -544,9 +544,9 @@ Configuration Options
544544
545545
Visibility:
546546
547-
* Public: Can by get by :c:func:`PyConfig_Get` and set by
547+
* Public: Can be retrieved by :c:func:`PyConfig_Get` and set by
548548
:c:func:`PyConfig_Set`.
549-
* Read-only: Can by get by :c:func:`PyConfig_Get`, but cannot be set by
549+
* Read-only: Can be retrieved by :c:func:`PyConfig_Get`, but cannot be set by
550550
:c:func:`PyConfig_Set`.
551551
552552
@@ -1155,7 +1155,7 @@ PyConfig
11551155
11561156
Most ``PyConfig`` methods :ref:`preinitialize Python <c-preinit>` if needed.
11571157
In that case, the Python preinitialization configuration
1158-
(:c:type:`PyPreConfig`) in based on the :c:type:`PyConfig`. If configuration
1158+
(:c:type:`PyPreConfig`) is based on the :c:type:`PyConfig`. If configuration
11591159
fields which are in common with :c:type:`PyPreConfig` are tuned, they must
11601160
be set before calling a :c:type:`PyConfig` method:
11611161

_sources/c-api/intro.rst.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ Docstring macros
180180
General utility macros
181181
----------------------
182182

183-
The following macros common tasks not specific to Python.
183+
The following macros are for common tasks not specific to Python.
184184

185185
.. c:macro:: Py_UNUSED(arg)
186186
@@ -277,7 +277,7 @@ Assertion utilities
277277
In debug mode, and on unsupported compilers, the macro expands to a call to
278278
:c:func:`Py_FatalError`.
279279

280-
A use for ``Py_UNREACHABLE()`` is following a call a function that
280+
A use for ``Py_UNREACHABLE()`` is following a call to a function that
281281
never returns but that is not declared ``_Noreturn``.
282282

283283
If a code path is very unlikely code but can be reached under exceptional

_sources/c-api/structures.rst.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ There are these calling conventions:
408408
409409
410410
These two constants are not used to indicate the calling convention but the
411-
binding when use with methods of classes. These may not be used for functions
411+
binding when used with methods of classes. These may not be used for functions
412412
defined for modules. At most one of these flags may be set for any given
413413
method.
414414

_sources/c-api/veryhigh.rst.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ the same library that the Python runtime is using.
191191
objects *globals* and *locals* with the compiler flags specified by
192192
*flags*. *globals* must be a dictionary; *locals* can be any object
193193
that implements the mapping protocol. The parameter *start* specifies
194-
the start symbol and must one of the :ref:`available start symbols <start-symbols>`.
194+
the start symbol and must be one of the :ref:`available start symbols <start-symbols>`.
195195
196196
Returns the result of executing the code as a Python object, or ``NULL`` if an
197197
exception was raised.

_sources/deprecations/pending-removal-in-3.15.rst.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ Pending removal in Python 3.15
6464

6565
* :func:`~threading.RLock` will take no arguments in Python 3.15.
6666
Passing any arguments has been deprecated since Python 3.14,
67-
as the Python version does not permit any arguments,
67+
as the Python version does not permit any arguments,
6868
but the C version allows any number of positional or keyword arguments,
6969
ignoring every argument.
7070

0 commit comments

Comments
 (0)