Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 575fb31

Browse files
committed
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.
1 parent b5d5518 commit 575fb31

4 files changed

Lines changed: 31 additions & 3 deletions

File tree

Doc/library/shelve.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,8 @@ Restrictions
121121
The *keyencoding* parameter is the encoding used to encode keys before they
122122
are used with the underlying dict.
123123

124-
:class:`Shelf` objects can also be used as context managers.
124+
A :class:`Shelf` object can also be used as a context manager, in which
125+
case it will be automatically closed when the :keyword:`with` block ends.
125126

126127
.. versionchanged:: 3.2
127128
Added the *keyencoding* parameter; previously, keys were always encoded in

Doc/library/xml.etree.elementtree.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -831,8 +831,8 @@ ElementTree Objects
831831
:term:`file object`; make sure you do not try to write a string to a
832832
binary stream and vice versa.
833833

834-
.. versionadded:: 3.4
835-
The *short_empty_elements* parameter.
834+
.. versionadded:: 3.4
835+
The *short_empty_elements* parameter.
836836

837837

838838
This is the XML file that is going to be manipulated::

Doc/using/venv-create.inc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,3 +92,5 @@ a "deactivate" function, whereas on Windows there are separate scripts called
9292
``deactivate.bat`` and ``Deactivate.ps1`` which are installed when the venv is
9393
created.
9494
95+
.. versionadded:: 3.4
96+
``fish`` and ``csh`` activation scripts.

Doc/whatsnew/3.4.rst

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -823,6 +823,15 @@ resource
823823
New :func:`resource.prlimit` function and Linux specific constants.
824824
(Contributed by Christian Heimes in :issue:`16595` and :issue:`19324`.)
825825

826+
827+
shelve
828+
------
829+
830+
:class:`~shelve.Shelf` instances may now be used in :keyword:`with` statements,
831+
and will be automatically closed at the end of the :keyword:`with` block.
832+
(Contributed by Filip Gruszczyński in :issue:`13896`.)
833+
834+
826835
smtplib
827836
-------
828837

@@ -927,6 +936,13 @@ Support for easy dynamically-generated subtests using the
927936
(Contributed by Antoine Pitrou in :issue:`16997`.)
928937

929938

939+
venv
940+
----
941+
942+
:mod:`venv` now includes activation scripts for the ``csh`` and ``fish``
943+
shells (Contributed by Andrew Svetlov in :issue:`15417`.)
944+
945+
930946
wave
931947
----
932948

@@ -956,6 +972,15 @@ Add an event-driven parser for non-blocking applications,
956972
:class:`~xml.etree.ElementTree.XMLPullParser`.
957973
(Contributed by Antoine Pitrou in :issue:`17741`.)
958974

975+
The :mod:`xml.etree.ElementTree` :func:`~xml.etree.ElementTree.tostring` and
976+
:func:`~xml.etree.ElementTree.tostringlist` functions, and the
977+
:class:`~xml.etree.ElementTree.ElementTree`
978+
:meth:`~xml.etree.ElementTree.ElementTree.write` method, now have a
979+
*short_empty_elements* :ref:`keyword-only parameter <keyword-only_parameter>`
980+
providing control over whether elements with no content are written in
981+
abbreviated (``<tag />``) or expanded (``<tag></tag>``) form. (Contributed by
982+
Ariel Poliak and Serhiy Storchaka in :issue:`14377`.)
983+
959984

960985
zipfile.PyZipfile
961986
-----------------

0 commit comments

Comments
 (0)