Skip to content

Commit aca9447

Browse files
committed
Deploying to gh-pages from @ 950d450 🚀
1 parent 3da736c commit aca9447

File tree

539 files changed

+51073
-3842
lines changed

Some content is hidden

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

539 files changed

+51073
-3842
lines changed

_sources/c-api/init.rst.txt

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,7 @@ Process-wide parameters
615615
returned string points into static storage; the caller should not modify its
616616
value. This corresponds to the :makevar:`prefix` variable in the top-level
617617
:file:`Makefile` and the :option:`--prefix` argument to the :program:`configure`
618-
script at build time. The value is available to Python code as ``sys.prefix``.
618+
script at build time. The value is available to Python code as ``sys.base_prefix``.
619619
It is only useful on Unix. See also the next function.
620620
621621
This function should not be called before :c:func:`Py_Initialize`, otherwise
@@ -625,7 +625,8 @@ Process-wide parameters
625625
It now returns ``NULL`` if called before :c:func:`Py_Initialize`.
626626
627627
.. deprecated-removed:: 3.13 3.15
628-
Get :data:`sys.prefix` instead.
628+
Get :data:`sys.base_prefix` instead, or :data:`sys.prefix` if
629+
:ref:`virtual environments <venv-def>` need to be handled.
629630
630631
631632
.. c:function:: wchar_t* Py_GetExecPrefix()
@@ -638,7 +639,8 @@ Process-wide parameters
638639
should not modify its value. This corresponds to the :makevar:`exec_prefix`
639640
variable in the top-level :file:`Makefile` and the ``--exec-prefix``
640641
argument to the :program:`configure` script at build time. The value is
641-
available to Python code as ``sys.exec_prefix``. It is only useful on Unix.
642+
available to Python code as ``sys.base_exec_prefix``. It is only useful on
643+
Unix.
642644
643645
Background: The exec-prefix differs from the prefix when platform dependent
644646
files (such as executables and shared libraries) are installed in a different
@@ -669,7 +671,8 @@ Process-wide parameters
669671
It now returns ``NULL`` if called before :c:func:`Py_Initialize`.
670672
671673
.. deprecated-removed:: 3.13 3.15
672-
Get :data:`sys.exec_prefix` instead.
674+
Get :data:`sys.base_exec_prefix` instead, or :data:`sys.exec_prefix` if
675+
:ref:`virtual environments <venv-def>` need to be handled.
673676
674677
675678
.. c:function:: wchar_t* Py_GetProgramFullPath()
@@ -2368,7 +2371,7 @@ Example usage::
23682371
23692372
In the above example, :c:macro:`Py_SETREF` calls :c:macro:`Py_DECREF`, which
23702373
can call arbitrary code through an object's deallocation function. The critical
2371-
section API avoids potentital deadlocks due to reentrancy and lock ordering
2374+
section API avoids potential deadlocks due to reentrancy and lock ordering
23722375
by allowing the runtime to temporarily suspend the critical section if the
23732376
code triggered by the finalizer blocks and calls :c:func:`PyEval_SaveThread`.
23742377

_sources/c-api/long.rst.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ distinguished from a number. Use :c:func:`PyErr_Occurred` to disambiguate.
454454
free(bignum);
455455
456456
*flags* is either ``-1`` (``Py_ASNATIVEBYTES_DEFAULTS``) to select defaults
457-
that behave most like a C cast, or a combintation of the other flags in
457+
that behave most like a C cast, or a combination of the other flags in
458458
the table below.
459459
Note that ``-1`` cannot be combined with other flags.
460460

_sources/c-api/monitoring.rst.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ would typically correspond to a python function.
147147
148148
The ``version`` argument is a pointer to a value which should be allocated
149149
by the user together with ``state_array`` and initialized to 0,
150-
and then set only by :c:func:`!PyMonitoring_EnterScope` itelf. It allows this
150+
and then set only by :c:func:`!PyMonitoring_EnterScope` itself. It allows this
151151
function to determine whether event states have changed since the previous call,
152152
and to return quickly if they have not.
153153

_sources/c-api/typeobj.rst.txt

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -682,6 +682,19 @@ and :c:data:`PyType_Type` effectively act as defaults.)
682682
Py_DECREF(tp);
683683
}
684684
685+
.. warning::
686+
687+
In a garbage collected Python, :c:member:`!tp_dealloc` may be called from
688+
any Python thread, not just the thread which created the object (if the
689+
object becomes part of a refcount cycle, that cycle might be collected by
690+
a garbage collection on any thread). This is not a problem for Python
691+
API calls, since the thread on which :c:member:`!tp_dealloc` is called
692+
will own the Global Interpreter Lock (GIL). However, if the object being
693+
destroyed in turn destroys objects from some other C or C++ library, care
694+
should be taken to ensure that destroying those objects on the thread
695+
which called :c:member:`!tp_dealloc` will not violate any assumptions of
696+
the library.
697+
685698

686699
**Inheritance:**
687700

@@ -2109,17 +2122,6 @@ and :c:data:`PyType_Type` effectively act as defaults.)
21092122
PyErr_Restore(error_type, error_value, error_traceback);
21102123
}
21112124

2112-
Also, note that, in a garbage collected Python,
2113-
:c:member:`~PyTypeObject.tp_dealloc` may be called from
2114-
any Python thread, not just the thread which created the object (if the object
2115-
becomes part of a refcount cycle, that cycle might be collected by a garbage
2116-
collection on any thread). This is not a problem for Python API calls, since
2117-
the thread on which tp_dealloc is called will own the Global Interpreter Lock
2118-
(GIL). However, if the object being destroyed in turn destroys objects from some
2119-
other C or C++ library, care should be taken to ensure that destroying those
2120-
objects on the thread which called tp_dealloc will not violate any assumptions
2121-
of the library.
2122-
21232125
**Inheritance:**
21242126

21252127
This field is inherited by subtypes.

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ Pending Removal in Python 3.15
1313
* :c:func:`PySys_ResetWarnOptions`:
1414
Clear :data:`sys.warnoptions` and :data:`!warnings.filters` instead.
1515
* :c:func:`Py_GetExecPrefix`:
16-
Get :data:`sys.exec_prefix` instead.
16+
Get :data:`sys.base_exec_prefix` and :data:`sys.exec_prefix` instead.
1717
* :c:func:`Py_GetPath`:
1818
Get :data:`sys.path` instead.
1919
* :c:func:`Py_GetPrefix`:
20-
Get :data:`sys.prefix` instead.
20+
Get :data:`sys.base_prefix` and :data:`sys.prefix` instead.
2121
* :c:func:`Py_GetProgramFullPath`:
2222
Get :data:`sys.executable` instead.
2323
* :c:func:`Py_GetProgramName`:

_sources/library/builtins.rst.txt

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,7 @@
77
--------------
88

99
This module provides direct access to all 'built-in' identifiers of Python; for
10-
example, ``builtins.open`` is the full name for the built-in function
11-
:func:`open`. See :ref:`built-in-funcs` and :ref:`built-in-consts` for
12-
documentation.
13-
10+
example, ``builtins.open`` is the full name for the built-in function :func:`open`.
1411

1512
This module is not normally accessed explicitly by most applications, but can be
1613
useful in modules that provide objects with the same name as a built-in value,
@@ -40,3 +37,10 @@ available as part of their globals. The value of ``__builtins__`` is normally
4037
either this module or the value of this module's :attr:`~object.__dict__` attribute.
4138
Since this is an implementation detail, it may not be used by alternate
4239
implementations of Python.
40+
41+
.. seealso::
42+
43+
* :ref:`built-in-consts`
44+
* :ref:`bltin-exceptions`
45+
* :ref:`built-in-funcs`
46+
* :ref:`bltin-types`

_sources/library/concurrent.futures.rst.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ ThreadPoolExecutor Example
206206
'http://www.cnn.com/',
207207
'http://europe.wsj.com/',
208208
'http://www.bbc.co.uk/',
209-
'http://nonexistant-subdomain.python.org/']
209+
'http://nonexistent-subdomain.python.org/']
210210

211211
# Retrieve a single page and report the URL and contents
212212
def load_url(url, timeout):

_sources/library/importlib.metadata.rst.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ path.
555555

556556
``DatabaseDistribution``, then, would look something like::
557557

558-
class DatabaseDistribution(importlib.metadata.Distributon):
558+
class DatabaseDistribution(importlib.metadata.Distribution):
559559
def __init__(self, record):
560560
self.record = record
561561

_sources/library/locale.rst.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,7 @@ The :mod:`locale` module defines the following exception and functions:
158158

159159
.. function:: nl_langinfo(option)
160160

161-
Return some locale-specific information as a string (or a tuple for
162-
``ALT_DIGITS``). This function is not
161+
Return some locale-specific information as a string. This function is not
163162
available on all systems, and the set of possible options might also vary
164163
across platforms. The possible argument values are numbers, for which
165164
symbolic constants are available in the locale module.
@@ -312,7 +311,9 @@ The :mod:`locale` module defines the following exception and functions:
312311

313312
.. data:: ALT_DIGITS
314313

315-
Get a tuple of up to 100 strings used to represent the values 0 to 99.
314+
Get a string consisting of up to 100 semicolon-separated symbols used
315+
to represent the values 0 to 99 in a locale-specific way.
316+
In most locales this is an empty string.
316317

317318

318319
.. function:: getdefaultlocale([envvars])

_sources/using/unix.rst.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ On Linux
1717

1818
Python comes preinstalled on most Linux distributions, and is available as a
1919
package on all others. However there are certain features you might want to use
20-
that are not available on your distro's package. You can easily compile the
20+
that are not available on your distro's package. You can compile the
2121
latest version of Python from source.
2222

23-
In the event that Python doesn't come preinstalled and isn't in the repositories as
24-
well, you can easily make packages for your own distro. Have a look at the
25-
following links:
23+
In the event that the latest version of Python doesn't come preinstalled and isn't
24+
in the repositories as well, you can make packages for your own distro. Have a
25+
look at the following links:
2626

2727
.. seealso::
2828

0 commit comments

Comments
 (0)