summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2009-01-16 03:54:08 (GMT)
committerBenjamin Peterson <benjamin@python.org>2009-01-16 03:54:08 (GMT)
commit058e31ef2aec3ea079cdf297fc0d4f40d3d9975a (patch)
tree0c8a2abae4490b207ed2a32d20680b3b2c9a48f7 /Doc
parent1456778a6a2b4a3381a9eb6749dc62921253c402 (diff)
downloadcpython-058e31ef2aec3ea079cdf297fc0d4f40d3d9975a.zip
cpython-058e31ef2aec3ea079cdf297fc0d4f40d3d9975a.tar.gz
cpython-058e31ef2aec3ea079cdf297fc0d4f40d3d9975a.tar.bz2
Merged revisions 68450,68480-68481,68493,68495,68501,68512,68514-68515,68534-68536,68552,68563,68570-68572,68575,68582,68596,68623-68624,68628 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r68450 | jeffrey.yasskin | 2009-01-09 10:47:07 -0600 (Fri, 09 Jan 2009) | 3 lines Fix issue 4884, preventing a crash in the socket code when python is compiled with llvm-gcc and run with a glibc <2.10. ........ r68480 | vinay.sajip | 2009-01-10 07:38:04 -0600 (Sat, 10 Jan 2009) | 1 line Minor documentation changes cross-referencing NullHandler to the documentation on configuring logging in a library. ........ r68481 | vinay.sajip | 2009-01-10 07:42:04 -0600 (Sat, 10 Jan 2009) | 1 line Corrected an incorrect self-reference. ........ r68493 | benjamin.peterson | 2009-01-10 11:18:55 -0600 (Sat, 10 Jan 2009) | 1 line rewrite verbose conditionals ........ r68495 | benjamin.peterson | 2009-01-10 11:36:44 -0600 (Sat, 10 Jan 2009) | 1 line tp_iter only exists with Py_TPFLAGS_HAVE_ITER #4901 ........ r68501 | vinay.sajip | 2009-01-10 13:22:57 -0600 (Sat, 10 Jan 2009) | 1 line Corrected minor typo and added .currentmodule directives to fix missing cross-references. ........ r68512 | benjamin.peterson | 2009-01-10 16:42:10 -0600 (Sat, 10 Jan 2009) | 1 line make tests fail if they can't be imported ........ r68514 | benjamin.peterson | 2009-01-10 17:41:59 -0600 (Sat, 10 Jan 2009) | 1 line move seealso to a more appropiate place ........ r68515 | benjamin.peterson | 2009-01-10 17:49:08 -0600 (Sat, 10 Jan 2009) | 1 line macos 9 isn't supported ........ r68534 | gregory.p.smith | 2009-01-11 11:53:33 -0600 (Sun, 11 Jan 2009) | 2 lines correct email address ........ r68535 | gregory.p.smith | 2009-01-11 11:57:54 -0600 (Sun, 11 Jan 2009) | 9 lines Update the documentation for binascii and zlib crc32/adler32 functions to better describe the signed vs unsigned return value behavior on different platforms and versions of python. Mention the workaround to make them all return the same thing by using & 0xffffffff. Fixes issue4903. Also needs to be merged into release26-maint, release30-maint, & py3k. ........ r68536 | benjamin.peterson | 2009-01-11 13:48:15 -0600 (Sun, 11 Jan 2009) | 1 line add email addresses ........ r68552 | vinay.sajip | 2009-01-12 14:36:18 -0600 (Mon, 12 Jan 2009) | 1 line Minor changes/corrections in markup. ........ r68563 | benjamin.peterson | 2009-01-12 19:49:10 -0600 (Mon, 12 Jan 2009) | 1 line small logic correction ........ r68570 | raymond.hettinger | 2009-01-13 03:08:32 -0600 (Tue, 13 Jan 2009) | 5 lines Issue 4922: Incorrect comments for MutableSet.add() and MutableSet.discard(). Needs to be backported to 2.6 and forward ported to 3.0 and 3.1. ........ r68571 | armin.ronacher | 2009-01-13 05:52:23 -0600 (Tue, 13 Jan 2009) | 3 lines ast.literal_eval can properly evaluate complex numbers now. This fixes issue4907. ........ r68572 | andrew.kuchling | 2009-01-13 07:40:54 -0600 (Tue, 13 Jan 2009) | 1 line Note that first coord. is left alone ........ r68575 | thomas.heller | 2009-01-13 11:32:28 -0600 (Tue, 13 Jan 2009) | 1 line Fix refcount leak in error cases. Bug found by coverity. ........ r68582 | georg.brandl | 2009-01-13 16:14:01 -0600 (Tue, 13 Jan 2009) | 2 lines Use assertRaises. ........ r68596 | amaury.forgeotdarc | 2009-01-13 17:39:22 -0600 (Tue, 13 Jan 2009) | 3 lines #1162154: inspect.getmembers() now skips attributes that raise AttributeError, e.g. a __slots__ attribute which has not been set. ........ r68623 | vinay.sajip | 2009-01-15 16:48:13 -0600 (Thu, 15 Jan 2009) | 1 line Made minor changes/corrections in markup. Added a couple of section headings. ........ r68624 | vinay.sajip | 2009-01-15 17:04:47 -0600 (Thu, 15 Jan 2009) | 1 line Minor changes/corrections in markup. ........ r68628 | benjamin.peterson | 2009-01-15 20:55:24 -0600 (Thu, 15 Jan 2009) | 1 line compare with == not is #4946 ........
Diffstat (limited to 'Doc')
-rw-r--r--Doc/c-api/typeobj.rst1
-rw-r--r--Doc/library/2to3.rst2
-rw-r--r--Doc/library/binascii.rst15
-rw-r--r--Doc/library/hashlib.rst4
-rw-r--r--Doc/library/io.rst2
-rw-r--r--Doc/library/logging.rst59
-rw-r--r--Doc/library/sys.rst14
-rw-r--r--Doc/library/turtle.rst3
-rw-r--r--Doc/library/zlib.rst34
9 files changed, 85 insertions, 49 deletions
diff --git a/Doc/c-api/typeobj.rst b/Doc/c-api/typeobj.rst
index 2ef4312..8355986 100644
--- a/Doc/c-api/typeobj.rst
+++ b/Doc/c-api/typeobj.rst
@@ -652,7 +652,6 @@ type objects) *must* have the :attr:`ob_size` field.
:attr:`__weakref__`, the type inherits its :attr:`tp_weaklistoffset` from its
base type.
-
.. cmember:: getiterfunc PyTypeObject.tp_iter
An optional pointer to a function that returns an iterator for the object. Its
diff --git a/Doc/library/2to3.rst b/Doc/library/2to3.rst
index 40234ef..375bd10 100644
--- a/Doc/library/2to3.rst
+++ b/Doc/library/2to3.rst
@@ -3,7 +3,7 @@
2to3 - Automated Python 2 to 3 code translation
===============================================
-.. sectionauthor:: Benjamin Peterson
+.. sectionauthor:: Benjamin Peterson <benjamin@python.org>
2to3 is a Python program that reads Python 2.x source code and applies a series
of *fixers* to transform it into valid Python 3.x code. The standard library
diff --git a/Doc/library/binascii.rst b/Doc/library/binascii.rst
index 2ea0e50..39130a8 100644
--- a/Doc/library/binascii.rst
+++ b/Doc/library/binascii.rst
@@ -113,8 +113,19 @@ The :mod:`binascii` module defines the following functions:
print(binascii.crc32("hello world"))
# Or, in two pieces:
crc = binascii.crc32("hello")
- crc = binascii.crc32(" world", crc)
- print(crc)
+ crc = binascii.crc32(" world", crc) & 0xffffffff
+ print('crc32 = 0x%08x' % crc)
+
+.. note::
+ To generate the same numeric value across all Python versions and
+ platforms use crc32(data) & 0xffffffff. If you are only using
+ the checksum in packed binary format this is not necessary as the
+ return value will have the correct 32bit binary representation
+ regardless of sign.
+
+.. versionchanged:: 3.0
+ The return value will always be unsigned and in the range [0, 2**32-1]
+ regardless of platform.
.. function:: b2a_hex(data)
diff --git a/Doc/library/hashlib.rst b/Doc/library/hashlib.rst
index 7a65d7d..955afb8 100644
--- a/Doc/library/hashlib.rst
+++ b/Doc/library/hashlib.rst
@@ -4,8 +4,8 @@
.. module:: hashlib
:synopsis: Secure hash and message digest algorithms.
-.. moduleauthor:: Gregory P. Smith <greg@users.sourceforge.net>
-.. sectionauthor:: Gregory P. Smith <greg@users.sourceforge.net>
+.. moduleauthor:: Gregory P. Smith <greg@krypto.org>
+.. sectionauthor:: Gregory P. Smith <greg@krypto.org>
.. index::
diff --git a/Doc/library/io.rst b/Doc/library/io.rst
index 3b699cc..45c99b5 100644
--- a/Doc/library/io.rst
+++ b/Doc/library/io.rst
@@ -6,7 +6,7 @@
.. moduleauthor:: Guido van Rossum <guido@python.org>
.. moduleauthor:: Mike Verdone <mike.verdone@gmail.com>
.. moduleauthor:: Mark Russell <mark.russell@zen.co.uk>
-.. sectionauthor:: Benjamin Peterson
+.. sectionauthor:: Benjamin Peterson <benjamin@python.org>
The :mod:`io` module provides the Python interfaces to stream handling. The
builtin :func:`open` function is defined in this module.
diff --git a/Doc/library/logging.rst b/Doc/library/logging.rst
index 84500c4..6e88b70 100644
--- a/Doc/library/logging.rst
+++ b/Doc/library/logging.rst
@@ -522,6 +522,9 @@ decides to actually dispatch an event, the :meth:`emit` method is used to send
the message to its destination. Most user-defined subclasses of :class:`Handler`
will need to override this :meth:`emit`.
+Useful Handlers
+---------------
+
In addition to the base :class:`Handler` class, many useful subclasses are
provided:
@@ -530,41 +533,44 @@ provided:
#. :class:`FileHandler` instances send error messages to disk files.
-.. currentmodule:: logging.handlers
+.. module:: logging.handlers
-#. :class:`BaseRotatingHandler` is the base class for handlers that rotate log
- files at a certain point. It is not meant to be instantiated directly. Instead,
- use :class:`RotatingFileHandler` or :class:`TimedRotatingFileHandler`.
+#. :class:`BaseRotatingHandler` is the base class for handlers that
+ rotate log files at a certain point. It is not meant to be instantiated
+ directly. Instead, use :class:`RotatingFileHandler` or
+ :class:`TimedRotatingFileHandler`.
-#. :class:`RotatingFileHandler` instances send error messages to disk files,
- with support for maximum log file sizes and log file rotation.
+#. :class:`RotatingFileHandler` instances send error messages to disk
+ files, with support for maximum log file sizes and log file rotation.
-#. :class:`TimedRotatingFileHandler` instances send error messages to disk files
- rotating the log file at certain timed intervals.
+#. :class:`TimedRotatingFileHandler` instances send error messages to
+ disk files, rotating the log file at certain timed intervals.
-#. :class:`SocketHandler` instances send error messages to TCP/IP sockets.
+#. :class:`SocketHandler` instances send error messages to TCP/IP
+ sockets.
-#. :class:`DatagramHandler` instances send error messages to UDP sockets.
+#. :class:`DatagramHandler` instances send error messages to UDP
+ sockets.
-#. :class:`SMTPHandler` instances send error messages to a designated email
- address.
+#. :class:`SMTPHandler` instances send error messages to a designated
+ email address.
-#. :class:`SysLogHandler` instances send error messages to a Unix syslog daemon,
- possibly on a remote machine.
+#. :class:`SysLogHandler` instances send error messages to a Unix
+ syslog daemon, possibly on a remote machine.
-#. :class:`NTEventLogHandler` instances send error messages to a Windows
- NT/2000/XP event log.
+#. :class:`NTEventLogHandler` instances send error messages to a
+ Windows NT/2000/XP event log.
-#. :class:`MemoryHandler` instances send error messages to a buffer in memory,
- which is flushed whenever specific criteria are met.
+#. :class:`MemoryHandler` instances send error messages to a buffer
+ in memory, which is flushed whenever specific criteria are met.
-#. :class:`HTTPHandler` instances send error messages to an HTTP server using
- either ``GET`` or ``POST`` semantics.
+#. :class:`HTTPHandler` instances send error messages to an HTTP
+ server using either ``GET`` or ``POST`` semantics.
-#. :class:`WatchedFileHandler` instances watch the file they are logging to. If
-the file changes, it is closed and reopened using the file name. This handler
-is only useful on Unix-like systems; Windows does not support the underlying
-mechanism used.
+#. :class:`WatchedFileHandler` instances watch the file they are
+ logging to. If the file changes, it is closed and reopened using the file
+ name. This handler is only useful on Unix-like systems; Windows does not
+ support the underlying mechanism used.
.. currentmodule:: logging
@@ -603,6 +609,9 @@ The basic :class:`Filter` functionality allows filtering by specific logger
name. If this feature is used, messages sent to the named logger and its
children are allowed through the filter, and all others dropped.
+Module-Level Functions
+----------------------
+
In addition to the classes described above, there are a number of module- level
functions.
@@ -1626,7 +1635,7 @@ See :ref:`library-config` for more information on how to use
WatchedFileHandler
^^^^^^^^^^^^^^^^^^
-.. module:: logging.handlers
+.. currentmodule:: logging.handlers
The :class:`WatchedFileHandler` class, located in the :mod:`logging.handlers`
module, is a :class:`FileHandler` which watches the file it is logging to. If
diff --git a/Doc/library/sys.rst b/Doc/library/sys.rst
index 254e069..aecef74 100644
--- a/Doc/library/sys.rst
+++ b/Doc/library/sys.rst
@@ -484,6 +484,11 @@ always available.
A program is free to modify this list for its own purposes.
+ .. seealso::
+ Module :mod:`site` This describes how to use .pth files to extend
+ :data:`sys.path`.
+
+
.. data:: platform
This string contains a platform identifier that can be used to append
@@ -500,7 +505,6 @@ always available.
Windows ``'win32'``
Windows/Cygwin ``'cygwin'``
Mac OS X ``'darwin'``
- Mac OS 9 ``'mac'``
OS/2 ``'os2'``
OS/2 EMX ``'os2emx'``
AtheOS ``'atheos'``
@@ -782,11 +786,3 @@ always available.
first three characters of :const:`version`. It is provided in the :mod:`sys`
module for informational purposes; modifying this value has no effect on the
registry keys used by Python. Availability: Windows.
-
-
-.. seealso::
-
- Module :mod:`site`
- This describes how to use .pth files to extend ``sys.path``.
-
-
diff --git a/Doc/library/turtle.rst b/Doc/library/turtle.rst
index 0a7acea..da3e475 100644
--- a/Doc/library/turtle.rst
+++ b/Doc/library/turtle.rst
@@ -322,8 +322,7 @@ Turtle motion
:param y: a number (integer or float)
- Set the turtle's first coordinate to *y*, leave second coordinate
- unchanged.
+ Set the turtle's second coordinate to *y*, leave first coordinate unchanged.
>>> turtle.position()
(0.00, 40.00)
diff --git a/Doc/library/zlib.rst b/Doc/library/zlib.rst
index e55e52a..b5875ee 100644
--- a/Doc/library/zlib.rst
+++ b/Doc/library/zlib.rst
@@ -31,19 +31,30 @@ The available exception and functions in this module are:
Exception raised on compression and decompression errors.
-.. function:: adler32(string[, value])
+.. function:: adler32(data[, value])
- Computes a Adler-32 checksum of *string*. (An Adler-32 checksum is almost as
+ Computes a Adler-32 checksum of *data*. (An Adler-32 checksum is almost as
reliable as a CRC32 but can be computed much more quickly.) If *value* is
present, it is used as the starting value of the checksum; otherwise, a fixed
default value is used. This allows computing a running checksum over the
- concatenation of several input strings. The algorithm is not cryptographically
+ concatenation of several inputs. The algorithm is not cryptographically
strong, and should not be used for authentication or digital signatures. Since
the algorithm is designed for use as a checksum algorithm, it is not suitable
for use as a general hash algorithm.
Always returns an unsigned 32-bit integer.
+.. note::
+ To generate the same numeric value across all Python versions and
+ platforms use adler32(data) & 0xffffffff. If you are only using
+ the checksum in packed binary format this is not necessary as the
+ return value will have the correct 32bit binary representation
+ regardless of sign.
+
+.. versionchanged:: 3.0
+ The return value will always be unsigned and in the range [0, 2**32-1]
+ regardless of platform.
+
.. function:: compress(string[, level])
@@ -62,22 +73,33 @@ The available exception and functions in this module are:
``9`` is slowest and produces the most. The default value is ``6``.
-.. function:: crc32(string[, value])
+.. function:: crc32(data[, value])
.. index::
single: Cyclic Redundancy Check
single: checksum; Cyclic Redundancy Check
- Computes a CRC (Cyclic Redundancy Check) checksum of *string*. If *value* is
+ Computes a CRC (Cyclic Redundancy Check) checksum of *data*. If *value* is
present, it is used as the starting value of the checksum; otherwise, a fixed
default value is used. This allows computing a running checksum over the
- concatenation of several input strings. The algorithm is not cryptographically
+ concatenation of several inputs. The algorithm is not cryptographically
strong, and should not be used for authentication or digital signatures. Since
the algorithm is designed for use as a checksum algorithm, it is not suitable
for use as a general hash algorithm.
Always returns an unsigned 32-bit integer.
+.. note::
+ To generate the same numeric value across all Python versions and
+ platforms use crc32(data) & 0xffffffff. If you are only using
+ the checksum in packed binary format this is not necessary as the
+ return value will have the correct 32bit binary representation
+ regardless of sign.
+
+.. versionchanged:: 3.0
+ The return value will always be unsigned and in the range [0, 2**32-1]
+ regardless of platform.
+
.. function:: decompress(string[, wbits[, bufsize]])