Add some items
This commit is contained in:
parent
a7364408cd
commit
0c3f1680b3
|
@ -3,6 +3,7 @@
|
||||||
****************************
|
****************************
|
||||||
|
|
||||||
.. XXX mention switch to Roundup for bug tracking
|
.. XXX mention switch to Roundup for bug tracking
|
||||||
|
.. XXX add trademark info for Apple, Microsoft.
|
||||||
|
|
||||||
:Author: A.M. Kuchling
|
:Author: A.M. Kuchling
|
||||||
:Release: |release|
|
:Release: |release|
|
||||||
|
@ -909,7 +910,13 @@ complete list of changes, or look through the CVS logs for all the details.
|
||||||
* An optional ``timeout`` parameter was added to the
|
* An optional ``timeout`` parameter was added to the
|
||||||
:class:`ftplib.FTP` class constructor as well as the :meth:`connect`
|
:class:`ftplib.FTP` class constructor as well as the :meth:`connect`
|
||||||
method, specifying a timeout measured in seconds. (Added by Facundo
|
method, specifying a timeout measured in seconds. (Added by Facundo
|
||||||
Batista.)
|
Batista.) Also, the :class:`FTP` class's
|
||||||
|
:meth:`storbinary` and :meth:`storlines`
|
||||||
|
now take an optional *callback* parameter that will be called with
|
||||||
|
each block of data after the data has been sent.
|
||||||
|
(Contributed by Phil Schwartz.)
|
||||||
|
|
||||||
|
.. Patch 1221598
|
||||||
|
|
||||||
* The :func:`reduce` built-in function is also available in the
|
* The :func:`reduce` built-in function is also available in the
|
||||||
:mod:`functools` module. In Python 3.0, the built-in is dropped and it's
|
:mod:`functools` module. In Python 3.0, the built-in is dropped and it's
|
||||||
|
@ -1041,6 +1048,13 @@ complete list of changes, or look through the CVS logs for all the details.
|
||||||
|
|
||||||
.. Patch 1137
|
.. Patch 1137
|
||||||
|
|
||||||
|
* The :mod:`Queue` module now provides queue classes that retrieve entries
|
||||||
|
in different orders. The :class:`PriorityQueue` class stores
|
||||||
|
queued items in a heap and retrieves them in priority order,
|
||||||
|
and :class:`LifoQueue` retrieves the most recently added entries first,
|
||||||
|
meaning that it behaves like a stack.
|
||||||
|
(Contributed by Raymond Hettinger.)
|
||||||
|
|
||||||
* The :mod:`random` module's :class:`Random` objects can
|
* The :mod:`random` module's :class:`Random` objects can
|
||||||
now be pickled on a 32-bit system and unpickled on a 64-bit
|
now be pickled on a 32-bit system and unpickled on a 64-bit
|
||||||
system, and vice versa. Unfortunately, this change also means
|
system, and vice versa. Unfortunately, this change also means
|
||||||
|
@ -1304,6 +1318,47 @@ XXX Certain features require the OpenSSL package to be installed, notably
|
||||||
|
|
||||||
SSL module documentation.
|
SSL module documentation.
|
||||||
|
|
||||||
|
|
||||||
|
.. ======================================================================
|
||||||
|
|
||||||
|
plistlib: A Property-List Parser
|
||||||
|
--------------------------------------------------
|
||||||
|
|
||||||
|
A commonly-used format on MacOS X is the ``.plist`` format,
|
||||||
|
which stores basic data types (numbers, strings, lists,
|
||||||
|
and dictionaries) and serializes them into an XML-based format.
|
||||||
|
(It's a lot like the XML-RPC serialization of data types.)
|
||||||
|
|
||||||
|
Despite being primarily used on MacOS X, the format
|
||||||
|
has nothing Mac-specific about it and the Python implementation works
|
||||||
|
on any platform that Python supports, so the :mod:`plistlib` module
|
||||||
|
has been promoted to the standard library.
|
||||||
|
|
||||||
|
Using the module is simple::
|
||||||
|
|
||||||
|
import sys
|
||||||
|
import plistlib
|
||||||
|
import datetime
|
||||||
|
|
||||||
|
# Create data structure
|
||||||
|
data_struct = dict(lastAccessed=datetime.datetime.now(),
|
||||||
|
version=1,
|
||||||
|
categories=('Personal', 'Shared', 'Private'))
|
||||||
|
|
||||||
|
# Create string containing XML.
|
||||||
|
plist_str = plistlib.writePlistToString(data_struct)
|
||||||
|
new_struct = plistlib.readPlistFromString(plist_str)
|
||||||
|
print data_struct
|
||||||
|
print new_struct
|
||||||
|
|
||||||
|
# Write data structure to a file and read it back.
|
||||||
|
plistlib.writePlist(data_struct, '/tmp/customizations.plist')
|
||||||
|
new_struct = plistlib.readPlist('/tmp/customizations.plist')
|
||||||
|
|
||||||
|
# read/writePlist accepts file-like objects as well as paths.
|
||||||
|
plistlib.writePlist(data_struct, sys.stdout)
|
||||||
|
|
||||||
|
|
||||||
.. ======================================================================
|
.. ======================================================================
|
||||||
|
|
||||||
|
|
||||||
|
@ -1351,6 +1406,13 @@ Changes to Python's build process and to the C API include:
|
||||||
|
|
||||||
.. Issue 1629
|
.. Issue 1629
|
||||||
|
|
||||||
|
* Distutils now places C extensions it builds in a
|
||||||
|
different directory when running on a debug version of Python.
|
||||||
|
(Contributed by Collin Winter.)
|
||||||
|
|
||||||
|
.. Patch 1530959
|
||||||
|
|
||||||
|
|
||||||
.. ======================================================================
|
.. ======================================================================
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue