aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Doc/library
diff options
context:
space:
mode:
Diffstat (limited to 'Doc/library')
-rw-r--r--Doc/library/datetime.rst16
-rw-r--r--Doc/library/shutil.rst4
-rw-r--r--Doc/library/ssl.rst7
-rw-r--r--Doc/library/stdtypes.rst2
-rw-r--r--Doc/library/string.rst2
5 files changed, 29 insertions, 2 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/library/ssl.rst b/Doc/library/ssl.rst
index c0dcecf737e..ae2e324d0ab 100644
--- a/Doc/library/ssl.rst
+++ b/Doc/library/ssl.rst
@@ -934,6 +934,13 @@ Constants
.. versionadded:: 3.13
+.. data:: HAS_PSK_TLS13
+
+ Whether the OpenSSL library has built-in support for External PSKs in TLS
+ 1.3 as described in :rfc:`9258`.
+
+ .. versionadded:: next
+
.. data:: HAS_PHA
Whether the OpenSSL library has built-in support for TLS-PHA.
diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst
index 61d39a6671c..1d9a655c766 100644
--- a/Doc/library/stdtypes.rst
+++ b/Doc/library/stdtypes.rst
@@ -2012,7 +2012,7 @@ expression support in the :mod:`re` module).
.. method:: str.isprintable()
- Return true if all characters in the string are printable, false if it
+ Return ``True`` if all characters in the string are printable, ``False`` if it
contains at least one non-printable character.
Here "printable" means the character is suitable for :func:`repr` to use in
diff --git a/Doc/library/string.rst b/Doc/library/string.rst
index b44d98819b6..c4012483a52 100644
--- a/Doc/library/string.rst
+++ b/Doc/library/string.rst
@@ -858,7 +858,7 @@ these rules. The methods of :class:`Template` are:
.. method:: is_valid()
- Returns false if the template has invalid placeholders that will cause
+ Returns ``False`` if the template has invalid placeholders that will cause
:meth:`substitute` to raise :exc:`ValueError`.
.. versionadded:: 3.11