[Python-checkins] gh-95913: Copyedit/improve Other Language Changes What's New section (GH-97719)

miss-islington webhook-mailer at python.org
Tue Oct 4 19:24:56 EDT 2022


https://github.com/python/cpython/commit/a13b4e8ca67d612386def140093ba024d410a811
commit: a13b4e8ca67d612386def140093ba024d410a811
branch: 3.11
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: miss-islington <31488909+miss-islington at users.noreply.github.com>
date: 2022-10-04T16:24:50-07:00
summary:

gh-95913: Copyedit/improve Other Language Changes What's New section (GH-97719)


* Add/refine cross references to items in other lang changes section

* Unify context manager exception changes into single non-repetitive item

* More clearly describe the intent and consequences of the -P option

* Apply minor clarifications & copyedits to rest of section

* Tweak the formatting of module references

Co-authored-by: Ezio Melotti <ezio.melotti at gmail.com>

Co-authored-by: Ezio Melotti <ezio.melotti at gmail.com>
(cherry picked from commit a77d9dedcd0d52c2663e9de4417dec9d1c5199f4)

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach at Gerlach.CAM>

files:
M Doc/whatsnew/3.11.rst

diff --git a/Doc/whatsnew/3.11.rst b/Doc/whatsnew/3.11.rst
index f3202f0c6d79..8906be1eccda 100644
--- a/Doc/whatsnew/3.11.rst
+++ b/Doc/whatsnew/3.11.rst
@@ -427,52 +427,57 @@ See `this message from the Steering Council <https://mail.python.org/archives/li
 for more information.
 
 
+.. _whatsnew311-other-lang-changes:
+
 Other Language Changes
 ======================
 
-* Starred expressions can be used in :ref:`for statements<for>`. (See
-  :issue:`46725` for more details.)
-
-* Asynchronous comprehensions are now allowed inside comprehensions in
-  asynchronous functions. Outer comprehensions implicitly become
-  asynchronous. (Contributed by Serhiy Storchaka in :issue:`33346`.)
+* Starred unpacking expressions can now be used in :keyword:`for` statements.
+  (See :issue:`46725` for more details.)
 
-* A :exc:`TypeError` is now raised instead of an :exc:`AttributeError` in
-  :meth:`contextlib.ExitStack.enter_context` and
-  :meth:`contextlib.AsyncExitStack.enter_async_context` for objects which do not
-  support the :term:`context manager` or :term:`asynchronous context manager`
-  protocols correspondingly.
-  (Contributed by Serhiy Storchaka in :issue:`44471`.)
+* Asynchronous :ref:`comprehensions <comprehensions>` are now allowed
+  inside comprehensions in :ref:`asynchronous functions <async def>`.
+  Outer comprehensions implicitly become asynchronous in this case.
+  (Contributed by Serhiy Storchaka in :issue:`33346`.)
 
 * A :exc:`TypeError` is now raised instead of an :exc:`AttributeError` in
-  :keyword:`with` and :keyword:`async with` statements for objects which do not
-  support the :term:`context manager` or :term:`asynchronous context manager`
-  protocols correspondingly.
-  (Contributed by Serhiy Storchaka in :issue:`12022`.)
-
-* Added :meth:`object.__getstate__` which provides the default
-  implementation of the ``__getstate__()`` method.  :mod:`Copying <copy>`
-  and :mod:`pickling <pickle>` instances of subclasses of builtin types
+  :keyword:`with` statements and :meth:`contextlib.ExitStack.enter_context`
+  for objects that do not support the :term:`context manager` protocol,
+  and in :keyword:`async with` statements and
+  :meth:`contextlib.AsyncExitStack.enter_async_context`
+  for objects not supporting the :term:`asynchronous context manager` protocol.
+  (Contributed by Serhiy Storchaka in :issue:`12022` and :issue:`44471`.)
+
+* Added :meth:`object.__getstate__`, which provides the default
+  implementation of the :meth:`!__getstate__` method. :mod:`copy`\ing
+  and :mod:`pickle`\ing instances of subclasses of builtin types
   :class:`bytearray`, :class:`set`, :class:`frozenset`,
   :class:`collections.OrderedDict`, :class:`collections.deque`,
   :class:`weakref.WeakSet`, and :class:`datetime.tzinfo` now copies and
   pickles instance attributes implemented as :term:`slots <__slots__>`.
   (Contributed by Serhiy Storchaka in :issue:`26579`.)
 
-* Add :option:`-P` command line option and :envvar:`PYTHONSAFEPATH` environment
-  variable to not prepend a potentially unsafe path to :data:`sys.path` such as
-  the current directory, the script's directory or an empty string.
+* Added a :option:`-P` command line option
+  and a :envvar:`PYTHONSAFEPATH` environment variable,
+  which disable the automatic prepending to :data:`sys.path`
+  of the script's directory when running a script,
+  or the current directory when using :option:`-c` and :option:`-m`.
+  This ensures only stdlib and installed modules
+  are picked up by :keyword:`import`,
+  and avoids unintentionally or maliciously shadowing modules
+  with those in a local (and typically user-writable) directory.
   (Contributed by Victor Stinner in :gh:`57684`.)
 
-* A ``"z"`` option was added to the format specification mini-language that
-  coerces negative zero to zero after rounding to the format precision.  See
-  :pep:`682` for more details.  (Contributed by John Belmonte in :gh:`90153`.)
+* A ``"z"`` option was added to the :ref:`formatspec` that
+  coerces negative to positive zero after rounding to the format precision.
+  See :pep:`682` for more details.
+  (Contributed by John Belmonte in :gh:`90153`.)
 
-* Bytes are no longer accepted on :attr:`sys.path`.  Support broke sometime
-  between Python 3.2 and 3.6 with no one noticing until after Python 3.10.0
-  was released. Bringing back support would also be problematic due to
-  interactions between :option:`-b` and :attr:`sys.path_importer_cache` when
-  there is a mixture of strings and bytes keys.
+* Bytes are no longer accepted on :data:`sys.path`.  Support broke sometime
+  between Python 3.2 and 3.6, with no one noticing until after Python 3.10.0
+  was released. In addition, bringing back support would be problematic due to
+  interactions between :option:`-b` and :data:`sys.path_importer_cache` when
+  there is a mixture of :class:`str` and :class:`bytes` keys.
   (Contributed by Thomas Grainger in :gh:`91181`.)
 
 Other CPython Implementation Changes



More information about the Python-checkins mailing list