diff --git a/Doc/whatsnew/3.11.rst b/Doc/whatsnew/3.11.rst index 3e94c40bca69d9..8f13bf3fa17327 100644 --- a/Doc/whatsnew/3.11.rst +++ b/Doc/whatsnew/3.11.rst @@ -615,12 +615,18 @@ asyncio These are primarily intended for internal use, notably by :class:`~asyncio.TaskGroup`. + +.. _whatsnew311-contextlib: + contextlib ---------- -Added non parallel-safe :func:`~contextlib.chdir` context manager to change -the current working directory and then restore it on exit. Simple wrapper -around :func:`~os.chdir`. (Contributed by Filipe Laíns in :issue:`25625`) +* Added non parallel-safe :func:`~contextlib.chdir` context manager to change + the current working directory and then restore it on exit. Simple wrapper + around :func:`~os.chdir`. (Contributed by Filipe Laíns in :issue:`25625`) + + +.. _whatsnew311-dataclasses: dataclasses ----------- @@ -630,11 +636,15 @@ dataclasses :class:`dict`, :class:`list` or :class:`set`. (Contributed by Eric V. Smith in :issue:`44674`.) + +.. _whatsnew311-datetime: + datetime -------- * Add :attr:`datetime.UTC`, a convenience alias for :attr:`datetime.timezone.utc`. (Contributed by Kabir Kwatra in :gh:`91973`.) + * :meth:`datetime.date.fromisoformat`, :meth:`datetime.time.fromisoformat` and :meth:`datetime.datetime.fromisoformat` can now be used to parse most ISO 8601 formats (barring only those that support fractional hours and minutes). @@ -659,7 +669,7 @@ enum (used by :func:`str`, :func:`format` and :term:`f-string`\s). * Changed :class:`~enum.IntEnum`, :class:`~enum.IntFlag` and :class:`~enum.StrEnum` - to now inherit from :class:`ReprEnum`, + to now inherit from :class:`~enum.ReprEnum`, so their :func:`str` output now matches :func:`format` (both ``str(AnIntEnum.ONE)`` and ``format(AnIntEnum.ONE)`` return ``'1'``, whereas before ``str(AnIntEnum.ONE)`` returned ``'AnIntEnum.ONE'``. @@ -709,6 +719,18 @@ enum inverted flags are coerced to their positive equivalent. +.. _whatsnew311-fcntl: + +fcntl +----- + +* On FreeBSD, the :data:`!F_DUP2FD` and :data:`!F_DUP2FD_CLOEXEC` flags respectively + are supported, the former equals to ``dup2`` usage while the latter set + the ``FD_CLOEXEC`` flag in addition. + + +.. _whatsnew311-fractions: + fractions --------- @@ -719,6 +741,9 @@ fractions that an ``isinstance(some_fraction, typing.SupportsInt)`` check passes. (Contributed by Mark Dickinson in :issue:`44547`.) + +.. _whatsnew311-functools: + functools --------- @@ -749,6 +774,9 @@ functools (Contributed by Yurii Karabas in :issue:`46014`.) + +.. _whatsnew311-hashlib: + hashlib ------- @@ -767,6 +795,9 @@ hashlib of files or file-like objects. (Contributed by Christian Heimes in :gh:`89313`.) + +.. _whatsnew311-idle: + IDLE and idlelib ---------------- @@ -804,6 +835,9 @@ inspect (Contributed by Pablo Galindo in :gh:`88116`.) + +.. _whatsnew311-locale: + locale ------ @@ -831,6 +865,8 @@ logging (Contributed by Kirill Pinchuk in :gh:`88457`.) +.. _whatsnew311-math: + math ---- @@ -850,6 +886,8 @@ math (Contributed by Victor Stinner in :issue:`46917`.) +.. _whatsnew311-operator: + operator -------- @@ -858,6 +896,8 @@ operator (Contributed by Antony Lee in :issue:`44019`.) +.. _whatsnew311-os: + os -- @@ -866,6 +906,8 @@ os (Contributed by Dong-hee Na in :issue:`44611`.) +.. _whatsnew311-pathlib: + pathlib ------- @@ -874,6 +916,9 @@ pathlib :data:`~os.sep` or :data:`~os.altsep`. (Contributed by Eisuke Kawasima in :issue:`22276` and :issue:`33392`.) + +.. _whatsnew311-re: + re -- @@ -881,6 +926,9 @@ re ``?+``, ``{m,n}+``) are now supported in regular expressions. (Contributed by Jeffrey C. Jacobs and Serhiy Storchaka in :issue:`433030`.) + +.. _whatsnew311-shutil: + shutil ------ @@ -888,6 +936,8 @@ shutil (Contributed by Serhiy Storchaka in :issue:`46245`.) +.. _whatsnew311-socket: + socket ------ @@ -899,6 +949,9 @@ socket instead of only raising the last error. (Contributed by Irit Katriel in :issue:`29980`.) + +.. _whatsnew311-sqlite3: + sqlite3 ------- @@ -962,13 +1015,15 @@ string (Contributed by Ben Kehoe in :gh:`90465`.) +.. _whatsnew311-sys: + sys --- * :func:`sys.exc_info` now derives the ``type`` and ``traceback`` fields from the ``value`` (the exception instance), so when an exception is modified while it is being handled, the changes are reflected in - the results of subsequent calls to :func:`exc_info`. + the results of subsequent calls to :func:`!exc_info`. (Contributed by Irit Katriel in :issue:`45711`.) * Add :func:`sys.exception` which returns the active exception instance @@ -979,6 +1034,8 @@ sys (Contributed by Victor Stinner in :gh:`57684`.) +.. _whatsnew311-sysconfig: + sysconfig --------- @@ -1009,6 +1066,8 @@ tempfile (Contributed by Carey Metcalfe in :gh:`70363`.) +.. _whatsnew311-threading: + threading --------- @@ -1020,6 +1079,8 @@ threading (Contributed by Victor Stinner in :issue:`41710`.) +.. _whatsnew311-time: + time ---- @@ -1037,6 +1098,18 @@ time (Contributed by Benjamin Szőke, Dong-hee Na, Eryk Sun and Victor Stinner in :issue:`21302` and :issue:`45429`.) +.. _whatsnew311-tkinter: + +tkinter +------- + +* Added method ``info_patchlevel()`` which returns the exact version of + the Tcl library as a named tuple similar to :data:`sys.version_info`. + (Contributed by Serhiy Storchaka in :gh:`91827`.) + + +.. _whatsnew311-traceback: + traceback --------- @@ -1050,6 +1123,8 @@ traceback (Contributed by Irit Katriel in :issue:`33809`.) +.. _whatsnew311-typing: + typing ------ @@ -1090,7 +1165,7 @@ For major changes, see :ref:`new-feat-related-type-hints-311`. to clear all registered overloads of a function. (Contributed by Jelle Zijlstra in :gh:`89263`.) -* The :meth:`__init__` method of :class:`~typing.Protocol` subclasses +* The :meth:`~object.__init__` method of :class:`~typing.Protocol` subclasses is now preserved. (Contributed by Adrian Garcia Badarasco in :gh:`88970`.) * The representation of empty tuple types (``Tuple[()]``) is simplified. @@ -1119,19 +1194,16 @@ For major changes, see :ref:`new-feat-related-type-hints-311`. by Nikita Sobolev in :gh:`90729`.) -tkinter -------- - -* Added method ``info_patchlevel()`` which returns the exact version of - the Tcl library as a named tuple similar to :data:`sys.version_info`. - (Contributed by Serhiy Storchaka in :gh:`91827`.) - +.. _whatsnew311-unicodedata: unicodedata ----------- -* The Unicode database has been updated to version 14.0.0. (Contributed by Benjamin Peterson in :issue:`45190`). +* The Unicode database has been updated to version 14.0.0. + (Contributed by Benjamin Peterson in :issue:`45190`). + +.. _whatsnew311-unittest: unittest -------- @@ -1145,6 +1217,8 @@ unittest (Contributed by Serhiy Storchaka in :issue:`45046`.) +.. _whatsnew311-venv: + venv ---- @@ -1158,6 +1232,9 @@ venv Third party code that also creates new virtual environments should do the same. (Contributed by Miro Hrončok in :issue:`45413`.) + +.. _whatsnew311-warnings: + warnings -------- @@ -1184,14 +1261,6 @@ zipfile (Contributed by Miguel Brito in :gh:`88261`.) -fcntl ------ - -* On FreeBSD, the :attr:`F_DUP2FD` and :attr:`F_DUP2FD_CLOEXEC` flags respectively - are supported, the former equals to ``dup2`` usage while the latter set - the ``FD_CLOEXEC`` flag in addition. - - .. _whatsnew311-optimizations: Optimizations