diff options
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/datetime.rst | 16 | ||||
-rw-r--r-- | Doc/library/shutil.rst | 4 | ||||
-rw-r--r-- | Doc/using/windows.rst | 2 | ||||
-rw-r--r-- | Doc/whatsnew/3.14.rst | 22 | ||||
-rw-r--r-- | Doc/whatsnew/3.15.rst | 3 |
5 files changed, 46 insertions, 1 deletions
diff --git a/Doc/library/datetime.rst b/Doc/library/datetime.rst index 1ce2013f05d..3470f42a6c6 100644 --- a/Doc/library/datetime.rst +++ b/Doc/library/datetime.rst @@ -261,6 +261,22 @@ A :class:`timedelta` object represents a duration, the difference between two >>> (d.days, d.seconds, d.microseconds) (-1, 86399, 999999) + Since the string representation of :class:`!timedelta` objects can be confusing, + use the following recipe to produce a more readable format: + + .. code-block:: pycon + + >>> def pretty_timedelta(td): + ... if td.days >= 0: + ... return str(td) + ... return f'-({-td!s})' + ... + >>> d = timedelta(hours=-1) + >>> str(d) # not human-friendly + '-1 day, 23:00:00' + >>> pretty_timedelta(d) + '-(1:00:00)' + Class attributes: diff --git a/Doc/library/shutil.rst b/Doc/library/shutil.rst index 2cbf95bcf53..c78dfe1aafa 100644 --- a/Doc/library/shutil.rst +++ b/Doc/library/shutil.rst @@ -454,6 +454,10 @@ Directory and files operations :envvar:`PATH` environment variable is read from :data:`os.environ`, falling back to :data:`os.defpath` if it is not set. + If *cmd* contains a directory component, :func:`!which` only checks the + specified path directly and does not search the directories listed in + *path* or in the system's :envvar:`PATH` environment variable. + On Windows, the current directory is prepended to the *path* if *mode* does not include ``os.X_OK``. When the *mode* does include ``os.X_OK``, the Windows API ``NeedCurrentDirectoryForExePathW`` will be consulted to diff --git a/Doc/using/windows.rst b/Doc/using/windows.rst index c084392ca66..411a4092a8c 100644 --- a/Doc/using/windows.rst +++ b/Doc/using/windows.rst @@ -91,7 +91,7 @@ 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`` command, but is offered for those who prefer the full range of aliases (such as ``python3.14.exe``) to be available. The directory will be -:file:`%LocalAppData%\Python\bin` by default, but may be customized by an +:file:`%LocalAppData%\\Python\\bin` by default, but may be customized by an administrator. Click Start and search for "Edit environment variables for your account" for the system settings page to add the path. diff --git a/Doc/whatsnew/3.14.rst b/Doc/whatsnew/3.14.rst index 9265024378c..d7b3bac8d85 100644 --- a/Doc/whatsnew/3.14.rst +++ b/Doc/whatsnew/3.14.rst @@ -88,6 +88,7 @@ and improvements in user-friendliness and correctness. * :ref:`PEP 758: Allow except and except* expressions without parentheses <whatsnew314-pep758>` * :ref:`PEP 761: Discontinuation of PGP signatures <whatsnew314-pep761>` * :ref:`PEP 765: Disallow return/break/continue that exit a finally block <whatsnew314-pep765>` +* :ref:`Free-threaded mode improvements <whatsnew314-free-threaded-cpython>` * :ref:`PEP 768: Safe external debugger interface for CPython <whatsnew314-pep768>` * :ref:`PEP 784: Adding Zstandard to the standard library <whatsnew314-pep784>` * :ref:`A new type of interpreter <whatsnew314-tail-call>` @@ -794,6 +795,27 @@ For further information on how to build Python, see (Contributed by Ken Jin in :gh:`128563`, with ideas on how to implement this in CPython by Mark Shannon, Garrett Gu, Haoran Xu, and Josh Haberman.) +.. _whatsnew314-free-threaded-cpython: + +Free-threaded mode +------------------ + +Free-threaded mode (:pep:`703`), initially added in 3.13, has been significantly improved. +The implementation described in PEP 703 was finished, including C API changes, +and temporary workarounds in the interpreter were replaced with more permanent solutions. +The specializing adaptive interpreter (:pep:`659`) is now enabled in free-threaded mode, +which along with many other optimizations greatly improves its performance. +The performance penalty on single-threaded code in free-threaded mode is now roughly 5-10%, +depending on platform and C compiler used. + +This work was done by many contributors: Sam Gross, Matt Page, Neil Schemenauer, +Thomas Wouters, Donghee Na, Kirill Podoprigora, Ken Jin, Itamar Oren, +Brett Simmers, Dino Viehland, Nathan Goldbaum, Ralf Gommers, Lysandros Nikolaou, +Kumar Aditya, Edgar Margffoy, and many others. + +Some of these contributors are employed by Meta, which has continued to provide +significant engineering resources to support this project. + .. _whatsnew314-pyrepl-highlighting: diff --git a/Doc/whatsnew/3.15.rst b/Doc/whatsnew/3.15.rst index d1e58c1b764..6ce7f964020 100644 --- a/Doc/whatsnew/3.15.rst +++ b/Doc/whatsnew/3.15.rst @@ -75,6 +75,9 @@ New features Other language changes ====================== +* Several error messages incorrectly using the term "argument" have been corrected. + (Contributed by Stan Ulbrych in :gh:`133382`.) + New modules |