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().
........
errors are ignored (apart from being reported to ``sys.stdout`` if *verbose* is
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
the "negative alias" of :option:`--verbose`, then :option:`--quiet` on the
command line sets *verbose* to false.
-**\*\*** Should be replaced with :mod:`optik` (which is also now known as
-:mod:`optparse` in Python 2.3 and later). **\*\***
+.. XXX Should be replaced with :mod:`optparse`.
.. function:: fancy_getopt(options, negative_opt, object, args)
Creating dumb built distributions
=================================
-**\*\*** Need to document absolute vs. prefix-relative packages here, but first
-I have to implement it! **\*\***
+.. XXX Need to document absolute vs. prefix-relative packages here, but first
+ I have to implement it!
.. _creating-rpms:
SWIG on the interface file and compile the resulting C/C++ file into your
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::
(Again, this sort of non-portable construct should be avoided if you intend to
distribute your code.)
-**\*\*** Should mention clib libraries here or somewhere else! **\*\***
+.. XXX Should mention clib libraries here or somewhere else!
Other options
:option:`packages` options
* all C source files mentioned in the :option:`ext_modules` or
- :option:`libraries` options (
+ :option:`libraries` options
- **\*\*** getting C library sources currently broken---no
- :meth:`get_source_files` method in :file:`build_clib.py`! **\*\***)
+ .. XXX Getting C library sources is currently broken -- no
+ :meth:`get_source_files` method in :file:`build_clib.py`!
* scripts identified by the :option:`scripts` option
See :ref:`distutils-installing-scripts`.
object.
duck-typing
- A pythonic programming style which determines an object's type by inspection
- of its method or attribute signature rather than by explicit relationship
- to some type object ("If it looks like a duck and quacks like a duck, it
+ A programming style which does not look at an object's type to determine
+ if it has the right interface; instead, the method or attribute is simply
+ 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,
well-designed code improves its flexibility by allowing polymorphic
substitution. Duck-typing avoids tests using :func:`type` or
: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,
an :exc:`IOError` is raised.
An example of how a pool of worker processes can each run a
-:class:`SimpleHTTPServer.HttpServer` instance while sharing a single listening
-socket.
+:class:`~http.server.SimpleHTTPRequestHandler` instance while sharing a single
+listening socket.
.. literalinclude:: ../includes/mp_webserver.py
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
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
:meth:`~socket.recv` and :meth:`~socket.send` without *flags* argument instead.
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
``":memory:"`` to open a database connection to a database that resides in RAM
In 3.0, some of the integer formats wrapped out-of-range values and
raised :exc:`DeprecationWarning` instead of :exc:`struct.error`.
-
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
-number of bytes stored. The first byte stored is the length of the string, or
-255, whichever is smaller. The bytes of the string follow. If the string
-passed in to :func:`pack` is too long (longer than the count minus 1), only the
-leading 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
-used. Note that for :func:`unpack`, the ``'p'`` format character consumes count
-bytes, but that the string returned can never contain more than 255 bytes.
-
-
+variable-length string stored in a *fixed number of bytes*, given by the count.
+The first byte stored is the length of the string, or 255, whichever is
+smaller. The bytes of the string follow. If the string passed in to
+:func:`pack` is too long (longer than the count minus 1), only the leading
+``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 used. Note that for :func:`unpack`, the ``'p'`` format character consumes
+``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
:const:`False`. When packing, the truth value of the argument object is used.
doctype = self.document.implementation.createDocumentType(
doctypeName, publicId, systemId)
doctype.ownerDocument = self.document
- self.document.childNodes.append(doctype)
+ _append_child(self.document, doctype)
self.document.doctype = doctype
if self._filter and self._filter.acceptNode(doctype) == FILTER_REJECT:
self.document.doctype = None
* The main open() function
*/
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"
"\n"
"Open file and return a stream. Raise IOError upon failure.\n"