mirror of
https://github.com/python/cpython.git
synced 2025-09-27 10:50:04 +00:00
Minor wordsmithing and markup fix-ups.
This commit is contained in:
parent
3094ed8c69
commit
d73be67c3f
1 changed files with 25 additions and 22 deletions
|
@ -1,4 +1,4 @@
|
||||||
http://news.blogs.cnn.com/2010/12/17/final-lunar-eclipse-of-2010-set-for-early-morning-of-december-21/?hpt=T2http://news.blogs.cnn.com/2010/12/17/final-lunar-eclipse-of-2010-set-for-early-morning-of-december-21/?hpt=T2****************************
|
****************************
|
||||||
What's New In Python 3.2
|
What's New In Python 3.2
|
||||||
****************************
|
****************************
|
||||||
|
|
||||||
|
@ -1617,33 +1617,36 @@ Porting to Python 3.2
|
||||||
This section lists previously described changes and other bugfixes that may
|
This section lists previously described changes and other bugfixes that may
|
||||||
require changes to your code:
|
require changes to your code:
|
||||||
|
|
||||||
* The :mod:`configparser` class :class:`SafeConfigParser` has been updated and
|
* The :mod:`configparser` module has a number of clean-ups. The major change is
|
||||||
renamed to :class:`ConfigParser` whereas the old :class:`ConfigParser` class
|
to replace the old :class:`ConfigParser` class with long-standing preferred
|
||||||
has been removed. This means a couple of minor incompatibilities:
|
alternative :class:`SafeConfigParser`. In addition there are a number of
|
||||||
|
smaller incompatibilites:
|
||||||
|
|
||||||
* interpolation syntax is now validated on :meth:`get` and :meth:`set`
|
* The interpolation syntax is now validated on
|
||||||
operations. In the default interpolation scheme, only two tokens with
|
:meth:`~configparser.ConfigParser.get` and
|
||||||
percent signs are valid: %(name)s and %%, the latter being an escaped
|
:meth:`~configparser.ConfigParser.set` operations. In the default
|
||||||
percent sign. If that is not welcome, consider using
|
interpolation scheme, only two tokens with percent signs are valid: ``%(name)s``
|
||||||
:class:`ExtendedInterpolation` or none at all.
|
and ``%%``, the latter being an escaped percent sign.
|
||||||
|
|
||||||
* :meth:`set` and :meth:`add_section` now check whether the given value type
|
* The :meth:`~configparser.ConfigParser.set` and
|
||||||
is a string. :mod:`configparser` was never designed to hold non-string
|
:meth:`~configparser.ConfigParser.add_section` methods now verify that
|
||||||
values internally.
|
values are actual strings. Formerly, unsupported types could be introduced
|
||||||
|
unintentionally.
|
||||||
|
|
||||||
* exception is raised on any section or option duplicates that appear when
|
* Duplicate sections or options now raise either
|
||||||
reading a single source. This exposes mistakes in user configuration.
|
:exc:`~configparser.DuplicateSectionError` or
|
||||||
|
:exc:`~configparser.DuplicateOptionError`. Formerly, duplicates would
|
||||||
|
silently overwrite a previous entry.
|
||||||
|
|
||||||
* inline comments are now disabled by default which means the ``;`` character
|
* Inline comments are now disabled by default so now the **;** character
|
||||||
can be safeuly used in values (``#`` was never allowed as inline comment).
|
can be safely used in values.
|
||||||
|
|
||||||
* comments now can be indented which means for ``;`` and ``#`` to appear at
|
* Comments now can be indented. Consequently, for **;** or **#** to appear at
|
||||||
the start of a line in multiline values, it has to be interpolated. This is
|
the start of a line in multiline values, it has to be interpolated. This
|
||||||
preferable because in INI files a character that is also a comment prefix
|
keep comment prefix characters in value from being mistaken as comments.
|
||||||
cannot be taken for a comment by mistake.
|
|
||||||
|
|
||||||
* ``""`` is now a valid value, no longer automatically converted to an empty
|
* ``""`` is now a valid value and is no longer automatically converted to an
|
||||||
string. For empty strings users can use ``"option ="`` in a line.
|
empty string. For empty strings, use ``"option ="`` in a line.
|
||||||
|
|
||||||
* The :mod:`nntplib` module was reworked extensively, meaning that its APIs
|
* The :mod:`nntplib` module was reworked extensively, meaning that its APIs
|
||||||
are often incompatible with the 3.1 APIs.
|
are often incompatible with the 3.1 APIs.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue