mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Merged revisions 82629,82632,82724,82757-82758,82760-82763,82798-82799,82801 via svnmerge from
svn+ssh://svn.python.org/python/branches/py3k ........ r82629 | georg.brandl | 2010-07-07 20:51:43 +0200 (Mi, 07 Jul 2010) | 1 line Make comment out of an awkward note. ........ r82632 | georg.brandl | 2010-07-07 21:04:36 +0200 (Mi, 07 Jul 2010) | 1 line Turn more notes into comments. ........ r82724 | georg.brandl | 2010-07-09 09:33:15 +0200 (Fr, 09 Jul 2010) | 1 line 2.7 is now stable. ........ r82757 | georg.brandl | 2010-07-10 10:58:37 +0200 (Sa, 10 Jul 2010) | 1 line Fix markup. ........ r82758 | georg.brandl | 2010-07-10 12:23:40 +0200 (Sa, 10 Jul 2010) | 1 line Emphasize role of count for Pascal string. ........ r82760 | georg.brandl | 2010-07-10 12:39:57 +0200 (Sa, 10 Jul 2010) | 1 line #3214: improve description of duck-typing in glossary. ........ r82761 | georg.brandl | 2010-07-10 13:40:13 +0200 (Sa, 10 Jul 2010) | 1 line #1434090: properly append child in expatbuilder doctype handler. ........ r82762 | georg.brandl | 2010-07-10 13:51:06 +0200 (Sa, 10 Jul 2010) | 1 line #8338: fix outdated class name. ........ r82763 | georg.brandl | 2010-07-10 14:01:34 +0200 (Sa, 10 Jul 2010) | 1 line #8456: fix signature of sqlite3.connect(). ........ r82798 | georg.brandl | 2010-07-11 11:23:11 +0200 (So, 11 Jul 2010) | 1 line #6774: explain shutdown() behavior varying with platform. ........ r82799 | georg.brandl | 2010-07-11 11:26:57 +0200 (So, 11 Jul 2010) | 1 line Fix typo. ........ r82801 | georg.brandl | 2010-07-11 11:33:39 +0200 (So, 11 Jul 2010) | 1 line #9184: fix default value for "buffering" param of open(). ........
This commit is contained in:
parent
c7b6908bb1
commit
914a218fbe
12 changed files with 30 additions and 31 deletions
|
@ -995,7 +995,7 @@ directories.
|
||||||
errors are ignored (apart from being reported to ``sys.stdout`` if *verbose* is
|
errors are ignored (apart from being reported to ``sys.stdout`` if *verbose* is
|
||||||
true).
|
true).
|
||||||
|
|
||||||
**\*\*** Some of this could be replaced with the shutil module? **\*\***
|
.. XXX Some of this could be replaced with the shutil module?
|
||||||
|
|
||||||
|
|
||||||
:mod:`distutils.file_util` --- Single file operations
|
:mod:`distutils.file_util` --- Single file operations
|
||||||
|
@ -1311,8 +1311,7 @@ provides the following additional features:
|
||||||
the "negative alias" of :option:`--verbose`, then :option:`--quiet` on the
|
the "negative alias" of :option:`--verbose`, then :option:`--quiet` on the
|
||||||
command line sets *verbose* to false.
|
command line sets *verbose* to false.
|
||||||
|
|
||||||
**\*\*** Should be replaced with :mod:`optik` (which is also now known as
|
.. XXX Should be replaced with :mod:`optparse`.
|
||||||
:mod:`optparse` in Python 2.3 and later). **\*\***
|
|
||||||
|
|
||||||
|
|
||||||
.. function:: fancy_getopt(options, negative_opt, object, args)
|
.. function:: fancy_getopt(options, negative_opt, object, args)
|
||||||
|
|
|
@ -146,8 +146,8 @@ commands.
|
||||||
Creating dumb built distributions
|
Creating dumb built distributions
|
||||||
=================================
|
=================================
|
||||||
|
|
||||||
**\*\*** Need to document absolute vs. prefix-relative packages here, but first
|
.. XXX Need to document absolute vs. prefix-relative packages here, but first
|
||||||
I have to implement it! **\*\***
|
I have to implement it!
|
||||||
|
|
||||||
|
|
||||||
.. _creating-rpms:
|
.. _creating-rpms:
|
||||||
|
|
|
@ -207,7 +207,7 @@ However, you can also include SWIG interface (:file:`.i`) files in the list; the
|
||||||
SWIG on the interface file and compile the resulting C/C++ file into your
|
SWIG on the interface file and compile the resulting C/C++ file into your
|
||||||
extension.
|
extension.
|
||||||
|
|
||||||
**\*\*** SWIG support is rough around the edges and largely untested! **\*\***
|
.. XXX SWIG support is rough around the edges and largely untested!
|
||||||
|
|
||||||
This warning notwithstanding, options to SWIG can be currently passed like
|
This warning notwithstanding, options to SWIG can be currently passed like
|
||||||
this::
|
this::
|
||||||
|
@ -326,7 +326,7 @@ include the location in ``library_dirs``::
|
||||||
(Again, this sort of non-portable construct should be avoided if you intend to
|
(Again, this sort of non-portable construct should be avoided if you intend to
|
||||||
distribute your code.)
|
distribute your code.)
|
||||||
|
|
||||||
**\*\*** Should mention clib libraries here or somewhere else! **\*\***
|
.. XXX Should mention clib libraries here or somewhere else!
|
||||||
|
|
||||||
|
|
||||||
Other options
|
Other options
|
||||||
|
|
|
@ -68,10 +68,10 @@ source distribution:
|
||||||
:option:`packages` options
|
:option:`packages` options
|
||||||
|
|
||||||
* all C source files mentioned in the :option:`ext_modules` or
|
* all C source files mentioned in the :option:`ext_modules` or
|
||||||
:option:`libraries` options (
|
:option:`libraries` options
|
||||||
|
|
||||||
**\*\*** getting C library sources currently broken---no
|
.. XXX Getting C library sources is currently broken -- no
|
||||||
:meth:`get_source_files` method in :file:`build_clib.py`! **\*\***)
|
:meth:`get_source_files` method in :file:`build_clib.py`!
|
||||||
|
|
||||||
* scripts identified by the :option:`scripts` option
|
* scripts identified by the :option:`scripts` option
|
||||||
See :ref:`distutils-installing-scripts`.
|
See :ref:`distutils-installing-scripts`.
|
||||||
|
|
|
@ -150,9 +150,9 @@ Glossary
|
||||||
object.
|
object.
|
||||||
|
|
||||||
duck-typing
|
duck-typing
|
||||||
A pythonic programming style which determines an object's type by inspection
|
A programming style which does not look at an object's type to determine
|
||||||
of its method or attribute signature rather than by explicit relationship
|
if it has the right interface; instead, the method or attribute is simply
|
||||||
to some type object ("If it looks like a duck and quacks like a duck, it
|
called or used ("If it looks like a duck and quacks like a duck, it
|
||||||
must be a duck.") By emphasizing interfaces rather than specific types,
|
must be a duck.") By emphasizing interfaces rather than specific types,
|
||||||
well-designed code improves its flexibility by allowing polymorphic
|
well-designed code improves its flexibility by allowing polymorphic
|
||||||
substitution. Duck-typing avoids tests using :func:`type` or
|
substitution. Duck-typing avoids tests using :func:`type` or
|
||||||
|
|
|
@ -672,7 +672,7 @@ are always available. They are listed here in alphabetical order.
|
||||||
:meth:`__index__` method that returns an integer.
|
:meth:`__index__` method that returns an integer.
|
||||||
|
|
||||||
|
|
||||||
.. function:: open(file, mode='r', buffering=None, encoding=None, errors=None, newline=None, closefd=True)
|
.. function:: open(file, mode='r', buffering=-1, encoding=None, errors=None, newline=None, closefd=True)
|
||||||
|
|
||||||
Open *file* and return a corresponding stream. If the file cannot be opened,
|
Open *file* and return a corresponding stream. If the file cannot be opened,
|
||||||
an :exc:`IOError` is raised.
|
an :exc:`IOError` is raised.
|
||||||
|
|
|
@ -2217,8 +2217,8 @@ collect the results:
|
||||||
|
|
||||||
|
|
||||||
An example of how a pool of worker processes can each run a
|
An example of how a pool of worker processes can each run a
|
||||||
:class:`SimpleHTTPServer.HttpServer` instance while sharing a single listening
|
:class:`~http.server.SimpleHTTPRequestHandler` instance while sharing a single
|
||||||
socket.
|
listening socket.
|
||||||
|
|
||||||
.. literalinclude:: ../includes/mp_webserver.py
|
.. literalinclude:: ../includes/mp_webserver.py
|
||||||
|
|
||||||
|
|
|
@ -741,7 +741,9 @@ timeout error of its own regardless of any Python socket timeout setting.
|
||||||
Shut down one or both halves of the connection. If *how* is :const:`SHUT_RD`,
|
Shut down one or both halves of the connection. If *how* is :const:`SHUT_RD`,
|
||||||
further receives are disallowed. If *how* is :const:`SHUT_WR`, further sends
|
further receives are disallowed. If *how* is :const:`SHUT_WR`, further sends
|
||||||
are disallowed. If *how* is :const:`SHUT_RDWR`, further sends and receives are
|
are disallowed. If *how* is :const:`SHUT_RDWR`, further sends and receives are
|
||||||
disallowed.
|
disallowed. Depending on the platform, shutting down one half of the connection
|
||||||
|
can also close the opposite half (e.g. on Mac OS X, ``shutdown(SHUT_WR)`` does
|
||||||
|
not allow further reads on the other end of the connection).
|
||||||
|
|
||||||
Note that there are no methods :meth:`read` or :meth:`write`; use
|
Note that there are no methods :meth:`read` or :meth:`write`; use
|
||||||
:meth:`~socket.recv` and :meth:`~socket.send` without *flags* argument instead.
|
:meth:`~socket.recv` and :meth:`~socket.send` without *flags* argument instead.
|
||||||
|
|
|
@ -136,7 +136,7 @@ Module functions and constants
|
||||||
first blank for the column name: the column name would simply be "x".
|
first blank for the column name: the column name would simply be "x".
|
||||||
|
|
||||||
|
|
||||||
.. function:: connect(database[, timeout, isolation_level, detect_types, factory])
|
.. function:: connect(database[, timeout, detect_types, isolation_level, check_same_thread, factory, cached_statements])
|
||||||
|
|
||||||
Opens a connection to the SQLite database file *database*. You can use
|
Opens a connection to the SQLite database file *database*. You can use
|
||||||
``":memory:"`` to open a database connection to a database that resides in RAM
|
``":memory:"`` to open a database connection to a database that resides in RAM
|
||||||
|
|
|
@ -251,18 +251,16 @@ then :exc:`struct.error` is raised.
|
||||||
In 3.0, some of the integer formats wrapped out-of-range values and
|
In 3.0, some of the integer formats wrapped out-of-range values and
|
||||||
raised :exc:`DeprecationWarning` instead of :exc:`struct.error`.
|
raised :exc:`DeprecationWarning` instead of :exc:`struct.error`.
|
||||||
|
|
||||||
|
|
||||||
The ``'p'`` format character encodes a "Pascal string", meaning a short
|
The ``'p'`` format character encodes a "Pascal string", meaning a short
|
||||||
variable-length string stored in a fixed number of bytes. The count is the total
|
variable-length string stored in a *fixed number of bytes*, given by the count.
|
||||||
number of bytes stored. The first byte stored is the length of the string, or
|
The first byte stored is the length of the string, or 255, whichever is
|
||||||
255, whichever is smaller. The bytes of the string follow. If the string
|
smaller. The bytes of the string follow. If the string passed in to
|
||||||
passed in to :func:`pack` is too long (longer than the count minus 1), only the
|
:func:`pack` is too long (longer than the count minus 1), only the leading
|
||||||
leading count-1 bytes of the string are stored. If the string is shorter than
|
``count-1`` bytes of the string are stored. If the string is shorter than
|
||||||
count-1, it is padded with null bytes so that exactly count bytes in all are
|
``count-1``, it is padded with null bytes so that exactly count bytes in all
|
||||||
used. Note that for :func:`unpack`, the ``'p'`` format character consumes count
|
are used. Note that for :func:`unpack`, the ``'p'`` format character consumes
|
||||||
bytes, but that the string returned can never contain more than 255 bytes.
|
``count`` bytes, but that the string returned can never contain more than 255
|
||||||
|
bytes.
|
||||||
|
|
||||||
|
|
||||||
For the ``'?'`` format character, the return value is either :const:`True` or
|
For the ``'?'`` format character, the return value is either :const:`True` or
|
||||||
:const:`False`. When packing, the truth value of the argument object is used.
|
:const:`False`. When packing, the truth value of the argument object is used.
|
||||||
|
|
|
@ -242,7 +242,7 @@ class ExpatBuilder:
|
||||||
doctype = self.document.implementation.createDocumentType(
|
doctype = self.document.implementation.createDocumentType(
|
||||||
doctypeName, publicId, systemId)
|
doctypeName, publicId, systemId)
|
||||||
doctype.ownerDocument = self.document
|
doctype.ownerDocument = self.document
|
||||||
self.document.childNodes.append(doctype)
|
_append_child(self.document, doctype)
|
||||||
self.document.doctype = doctype
|
self.document.doctype = doctype
|
||||||
if self._filter and self._filter.acceptNode(doctype) == FILTER_REJECT:
|
if self._filter and self._filter.acceptNode(doctype) == FILTER_REJECT:
|
||||||
self.document.doctype = None
|
self.document.doctype = None
|
||||||
|
|
|
@ -176,7 +176,7 @@ PyObject *PyExc_BlockingIOError = (PyObject *)&_PyExc_BlockingIOError;
|
||||||
* The main open() function
|
* The main open() function
|
||||||
*/
|
*/
|
||||||
PyDoc_STRVAR(open_doc,
|
PyDoc_STRVAR(open_doc,
|
||||||
"open(file, mode='r', buffering=None, encoding=None,\n"
|
"open(file, mode='r', buffering=-1, encoding=None,\n"
|
||||||
" errors=None, newline=None, closefd=True) -> file object\n"
|
" errors=None, newline=None, closefd=True) -> file object\n"
|
||||||
"\n"
|
"\n"
|
||||||
"Open file and return a stream. Raise IOError upon failure.\n"
|
"Open file and return a stream. Raise IOError upon failure.\n"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue