[Python-checkins] cpython: shelf in with stmt, fish/csh in venv, ElementTree short_empty_elements keyword.

r.david.murray python-checkins at python.org
Thu Dec 26 05:21:57 CET 2013


http://hg.python.org/cpython/rev/94a04b8b3a12
changeset:   88192:94a04b8b3a12
parent:      88190:4e2b69138ab9
user:        R David Murray <rdmurray at bitdance.com>
date:        Wed Dec 25 23:21:03 2013 -0500
summary:
  shelf in with stmt, fish/csh in venv, ElementTree short_empty_elements keyword.

Also added versionadded for for fish/csh, fixed indentation of versionadded
for ElementTree.write, and make the behavior of shelf as a context manager
explicit in the docs.

files:
  Doc/library/shelve.rst                |   3 +-
  Doc/library/xml.etree.elementtree.rst |   4 +-
  Doc/using/venv-create.inc             |   2 +
  Doc/whatsnew/3.4.rst                  |  25 +++++++++++++++
  4 files changed, 31 insertions(+), 3 deletions(-)


diff --git a/Doc/library/shelve.rst b/Doc/library/shelve.rst
--- a/Doc/library/shelve.rst
+++ b/Doc/library/shelve.rst
@@ -121,7 +121,8 @@
    The *keyencoding* parameter is the encoding used to encode keys before they
    are used with the underlying dict.
 
-   :class:`Shelf` objects can also be used as context managers.
+   A :class:`Shelf` object can also be used as a context manager, in which
+   case it will be automatically closed when the :keyword:`with` block ends.
 
    .. versionchanged:: 3.2
       Added the *keyencoding* parameter; previously, keys were always encoded in
diff --git a/Doc/library/xml.etree.elementtree.rst b/Doc/library/xml.etree.elementtree.rst
--- a/Doc/library/xml.etree.elementtree.rst
+++ b/Doc/library/xml.etree.elementtree.rst
@@ -831,8 +831,8 @@
       :term:`file object`; make sure you do not try to write a string to a
       binary stream and vice versa.
 
-   .. versionadded:: 3.4
-      The *short_empty_elements* parameter.
+      .. versionadded:: 3.4
+         The *short_empty_elements* parameter.
 
 
 This is the XML file that is going to be manipulated::
diff --git a/Doc/using/venv-create.inc b/Doc/using/venv-create.inc
--- a/Doc/using/venv-create.inc
+++ b/Doc/using/venv-create.inc
@@ -92,3 +92,5 @@
 ``deactivate.bat`` and ``Deactivate.ps1`` which are installed when the venv is
 created.
 
+.. versionadded:: 3.4
+   ``fish`` and ``csh`` activation scripts.
diff --git a/Doc/whatsnew/3.4.rst b/Doc/whatsnew/3.4.rst
--- a/Doc/whatsnew/3.4.rst
+++ b/Doc/whatsnew/3.4.rst
@@ -823,6 +823,15 @@
 New :func:`resource.prlimit` function and Linux specific constants.
 (Contributed by Christian Heimes in :issue:`16595` and :issue:`19324`.)
 
+
+shelve
+------
+
+:class:`~shelve.Shelf` instances may now be used in :keyword:`with` statements,
+and will be automatically closed at the end of the :keyword:`with` block.
+(Contributed by Filip Gruszczyński in :issue:`13896`.)
+
+
 smtplib
 -------
 
@@ -927,6 +936,13 @@
 (Contributed by Antoine Pitrou in :issue:`16997`.)
 
 
+venv
+----
+
+:mod:`venv` now includes activation scripts for the ``csh`` and ``fish``
+shells (Contributed by Andrew Svetlov in :issue:`15417`.)
+
+
 wave
 ----
 
@@ -956,6 +972,15 @@
 :class:`~xml.etree.ElementTree.XMLPullParser`.
 (Contributed by Antoine Pitrou in :issue:`17741`.)
 
+The :mod:`xml.etree.ElementTree` :func:`~xml.etree.ElementTree.tostring` and
+:func:`~xml.etree.ElementTree.tostringlist` functions, and the
+:class:`~xml.etree.ElementTree.ElementTree`
+:meth:`~xml.etree.ElementTree.ElementTree.write` method, now have a
+*short_empty_elements* :ref:`keyword-only parameter <keyword-only_parameter>`
+providing control over whether elements with no content are written in
+abbreviated (``<tag />``) or expanded (``<tag></tag>``) form.  (Contributed by
+Ariel Poliak and Serhiy Storchaka in :issue:`14377`.)
+
 
 zipfile.PyZipfile
 -----------------

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list