diff options
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/annotationlib.rst | 26 | ||||
-rw-r--r-- | Doc/library/fcntl.rst | 18 | ||||
-rw-r--r-- | Doc/library/heapq.rst | 1 | ||||
-rw-r--r-- | Doc/library/math.rst | 3 | ||||
-rw-r--r-- | Doc/library/unittest.mock.rst | 4 | ||||
-rw-r--r-- | Doc/library/urllib.request.rst | 4 | ||||
-rw-r--r-- | Doc/using/windows.rst | 21 |
7 files changed, 43 insertions, 34 deletions
diff --git a/Doc/library/annotationlib.rst b/Doc/library/annotationlib.rst index a96f5167c02..41c9ce479ff 100644 --- a/Doc/library/annotationlib.rst +++ b/Doc/library/annotationlib.rst @@ -127,16 +127,27 @@ Classes Values are the result of evaluating the annotation expressions. - .. attribute:: FORWARDREF + .. attribute:: VALUE_WITH_FAKE_GLOBALS :value: 2 + Special value used to signal that an annotate function is being + evaluated in a special environment with fake globals. When passed this + value, annotate functions should either return the same value as for + the :attr:`Format.VALUE` format, or raise :exc:`NotImplementedError` + to signal that they do not support execution in this environment. + This format is only used internally and should not be passed to + the functions in this module. + + .. attribute:: FORWARDREF + :value: 3 + Values are real annotation values (as per :attr:`Format.VALUE` format) for defined values, and :class:`ForwardRef` proxies for undefined values. Real objects may contain references to :class:`ForwardRef` proxy objects. .. attribute:: STRING - :value: 3 + :value: 4 Values are the text string of the annotation as it appears in the source code, up to modifications including, but not restricted to, @@ -144,17 +155,6 @@ Classes The exact values of these strings may change in future versions of Python. - .. attribute:: VALUE_WITH_FAKE_GLOBALS - :value: 4 - - Special value used to signal that an annotate function is being - evaluated in a special environment with fake globals. When passed this - value, annotate functions should either return the same value as for - the :attr:`Format.VALUE` format, or raise :exc:`NotImplementedError` - to signal that they do not support execution in this environment. - This format is only used internally and should not be passed to - the functions in this module. - .. versionadded:: 3.14 .. class:: ForwardRef diff --git a/Doc/library/fcntl.rst b/Doc/library/fcntl.rst index c8ce86cc7af..5c078df44ff 100644 --- a/Doc/library/fcntl.rst +++ b/Doc/library/fcntl.rst @@ -107,15 +107,15 @@ The module defines the following functions: passed to the C :c:func:`fcntl` call. The return value after a successful call is the contents of the buffer, converted to a :class:`bytes` object. The length of the returned object will be the same as the length of the - *arg* argument. This is limited to 1024 bytes. + *arg* argument. If the :c:func:`fcntl` call fails, an :exc:`OSError` is raised. .. note:: - If the type or the size of *arg* does not match the type or size - of the argument of the operation (for example, if an integer is + If the type or size of *arg* does not match the type or size + of the operation's argument (for example, if an integer is passed when a pointer is expected, or the information returned in - the buffer by the operating system is larger than 1024 bytes), + the buffer by the operating system is larger than the size of *arg*), this is most likely to result in a segmentation violation or a more subtle data corruption. @@ -125,6 +125,9 @@ The module defines the following functions: Add support of arbitrary :term:`bytes-like objects <bytes-like object>`, not only :class:`bytes`. + .. versionchanged:: next + The size of bytes-like objects is no longer limited to 1024 bytes. + .. function:: ioctl(fd, request, arg=0, mutate_flag=True, /) @@ -161,8 +164,7 @@ The module defines the following functions: If the type or size of *arg* does not match the type or size of the operation's argument (for example, if an integer is passed when a pointer is expected, or the information returned in - the buffer by the operating system is larger than 1024 bytes, - or the size of the mutable bytes-like object is too small), + the buffer by the operating system is larger than the size of *arg*), this is most likely to result in a segmentation violation or a more subtle data corruption. @@ -185,6 +187,10 @@ The module defines the following functions: The GIL is always released during a system call. System calls failing with EINTR are automatically retried. + .. versionchanged:: next + The size of not mutated bytes-like objects is no longer + limited to 1024 bytes. + .. function:: flock(fd, operation, /) Perform the lock operation *operation* on file descriptor *fd* (file objects providing diff --git a/Doc/library/heapq.rst b/Doc/library/heapq.rst index 183ac9a27d5..462b65bc7af 100644 --- a/Doc/library/heapq.rst +++ b/Doc/library/heapq.rst @@ -315,6 +315,7 @@ The strange invariant above is meant to be an efficient memory representation for a tournament. The numbers below are *k*, not ``a[k]``: .. figure:: heapq-binary-tree.svg + :class: invert-in-dark-mode :align: center :alt: Example (min-heap) binary tree. diff --git a/Doc/library/math.rst b/Doc/library/math.rst index 0749367045d..394a462b946 100644 --- a/Doc/library/math.rst +++ b/Doc/library/math.rst @@ -144,8 +144,7 @@ Number-theoretic functions .. function:: factorial(n) - Return *n* factorial as an integer. Raises :exc:`ValueError` if *n* is not integral or - is negative. + Return factorial of the nonnegative integer *n*. .. versionchanged:: 3.10 Floats with integral values (like ``5.0``) are no longer accepted. diff --git a/Doc/library/unittest.mock.rst b/Doc/library/unittest.mock.rst index 27c169dde72..091562cc9ae 100644 --- a/Doc/library/unittest.mock.rst +++ b/Doc/library/unittest.mock.rst @@ -2654,9 +2654,9 @@ with any methods on the mock: .. code-block:: pycon - >>> mock.has_data() + >>> mock.header_items() <mock.Mock object at 0x...> - >>> mock.has_data.assret_called_with() # Intentional typo! + >>> mock.header_items.assret_called_with() # Intentional typo! Auto-speccing solves this problem. You can either pass ``autospec=True`` to :func:`patch` / :func:`patch.object` or use the :func:`create_autospec` function to create a diff --git a/Doc/library/urllib.request.rst b/Doc/library/urllib.request.rst index b0f26724d0c..58bd111b5cc 100644 --- a/Doc/library/urllib.request.rst +++ b/Doc/library/urllib.request.rst @@ -1121,7 +1121,7 @@ HTTPHandler Objects .. method:: HTTPHandler.http_open(req) Send an HTTP request, which can be either GET or POST, depending on - ``req.has_data()``. + ``req.data``. .. _https-handler-objects: @@ -1133,7 +1133,7 @@ HTTPSHandler Objects .. method:: HTTPSHandler.https_open(req) Send an HTTPS request, which can be either GET or POST, depending on - ``req.has_data()``. + ``req.data``. .. _file-handler-objects: diff --git a/Doc/using/windows.rst b/Doc/using/windows.rst index 411a4092a8c..38b97a34fcd 100644 --- a/Doc/using/windows.rst +++ b/Doc/using/windows.rst @@ -77,15 +77,10 @@ To install the file downloaded from python.org, either double-click and select "Install", or run ``Add-AppxPackage <path to MSIX>`` in Windows Powershell. After installation, the ``python``, ``py``, and ``pymanager`` commands should be -available. If they are not, click Start and search for "Manage app execution -aliases". This settings page will let you enable the relevant commands. They -will be labelled "Python (default)", "Python (default windowed)", and "Python -install manager". - -If you have existing installations of Python, or you have modified your -:envvar:`PATH` variable, you may need to remove them or undo the modifications -in order for the commands to work. Old versions of Python can be reinstalled -using the Python install manager. +available. If you have existing installations of Python, or you have modified +your :envvar:`PATH` variable, you may need to remove them or undo the +modifications. See :ref:`pymanager-troubleshoot` for more help with fixing +non-working commands. When you first install a runtime, you will likely be prompted to add a directory to your :envvar:`PATH`. This is optional, if you prefer to use the ``py`` @@ -150,6 +145,10 @@ want to be passed to the runtime (such as script files or the module to launch): $> py -m this ... +The default runtime can be overridden with the :envvar:`PYTHON_MANAGER_DEFAULT` +environment variable, or a configuration file. See :ref:`pymanager-config` for +information about configuration settings. + To launch a specific runtime, the ``py`` command accepts a ``-V:<TAG>`` option. This option must be specified before any others. The tag is part or all of the identifier for the runtime; for those from the CPython team, it looks like the @@ -472,6 +471,10 @@ directory (which you may have added to your :envvar:`PATH` environment variable) can be used in a shebang, even if it is not on your :envvar:`PATH`. This allows the use of shebangs like ``/usr/bin/python3.12`` to select a particular runtime. +If no runtimes are installed, or if automatic installation is enabled, the +requested runtime will be installed if necessary. See :ref:`pymanager-config` +for information about configuration settings. + The ``/usr/bin/env`` form of shebang line will also search the :envvar:`PATH` environment variable for unrecognized commands. This corresponds to the behaviour of the Unix ``env`` program, which performs the same search, but |