diff options
Diffstat (limited to 'Doc/library')
-rw-r--r-- | Doc/library/codecs.rst | 2 | ||||
-rw-r--r-- | Doc/library/collections.rst | 6 | ||||
-rw-r--r-- | Doc/library/decimal.rst | 2 | ||||
-rw-r--r-- | Doc/library/logging.rst | 4 | ||||
-rw-r--r-- | Doc/library/mailbox.rst | 4 | ||||
-rw-r--r-- | Doc/library/optparse.rst | 2 | ||||
-rw-r--r-- | Doc/library/platform.rst | 2 | ||||
-rw-r--r-- | Doc/library/profile.rst | 2 | ||||
-rw-r--r-- | Doc/library/random.rst | 11 | ||||
-rw-r--r-- | Doc/library/re.rst | 6 | ||||
-rw-r--r-- | Doc/library/socket.rst | 2 | ||||
-rw-r--r-- | Doc/library/tokenize.rst | 2 | ||||
-rw-r--r-- | Doc/library/weakref.rst | 2 | ||||
-rw-r--r-- | Doc/library/xml.etree.elementtree.rst | 2 |
14 files changed, 30 insertions, 19 deletions
diff --git a/Doc/library/codecs.rst b/Doc/library/codecs.rst index 1491213..f00c873 100644 --- a/Doc/library/codecs.rst +++ b/Doc/library/codecs.rst @@ -1018,7 +1018,7 @@ particular, the following variants typically exist: +-----------------+--------------------------------+--------------------------------+ | iso8859_3 | iso-8859-3, latin3, L3 | Esperanto, Maltese | +-----------------+--------------------------------+--------------------------------+ -| iso8859_4 | iso-8859-4, latin4, L4 | Baltic languagues | +| iso8859_4 | iso-8859-4, latin4, L4 | Baltic languages | +-----------------+--------------------------------+--------------------------------+ | iso8859_5 | iso-8859-5, cyrillic | Bulgarian, Byelorussian, | | | | Macedonian, Russian, Serbian | diff --git a/Doc/library/collections.rst b/Doc/library/collections.rst index 1d6687d..55b6f37 100644 --- a/Doc/library/collections.rst +++ b/Doc/library/collections.rst @@ -452,7 +452,7 @@ they add the ability to access fields by name instead of position index. .. function:: namedtuple(typename, fieldnames, [verbose]) Returns a new tuple subclass named *typename*. The new subclass is used to - create tuple-like objects that have fields accessable by attribute lookup as + create tuple-like objects that have fields accessible by attribute lookup as well as being indexable and iterable. Instances of the subclass also have a helpful docstring (with typename and fieldnames) and a helpful :meth:`__repr__` method which lists the tuple contents in a ``name=value`` format. @@ -516,7 +516,7 @@ Example:: >>> x, y = p # unpack like a regular tuple >>> x, y (11, 22) - >>> p.x + p.y # fields also accessable by name + >>> p.x + p.y # fields also accessible by name 33 >>> p # readable __repr__ with a name=value style Point(x=11, y=22) @@ -708,7 +708,7 @@ consult the sources for information about the methods which need to be provided in that case. :class:`UserString` objects -------------------------- +--------------------------- The class, :class:`UserString` acts as a wrapper around string objects. The need for this class has been partially supplanted by the ability to diff --git a/Doc/library/decimal.rst b/Doc/library/decimal.rst index b0845e9..ac21b57 100644 --- a/Doc/library/decimal.rst +++ b/Doc/library/decimal.rst @@ -1557,7 +1557,7 @@ of significant places in the coefficient. For example, expressing original's two-place significance. If an application does not care about tracking significance, it is easy to -remove the exponent and trailing zeroes, losing signficance, but keeping the +remove the exponent and trailing zeroes, losing significance, but keeping the value unchanged:: >>> def remove_exponent(d): diff --git a/Doc/library/logging.rst b/Doc/library/logging.rst index f466df1..27f6189 100644 --- a/Doc/library/logging.rst +++ b/Doc/library/logging.rst @@ -41,7 +41,7 @@ can include messages from third-party modules. It is, of course, possible to log messages with different verbosity levels or to different destinations. Support for writing log messages to files, HTTP GET/POST locations, email via SMTP, generic sockets, or OS-specific logging -mechnisms are all supported by the standard module. You can also create your +mechanisms are all supported by the standard module. You can also create your own log destination class if you have special requirements not met by any of the built-in classes. @@ -265,7 +265,7 @@ destination. Logger objects can add zero or more handler objects to themselves with an :func:`addHandler` method. As an example scenario, an application may want to send all log messages to a log file, all log messages of error or higher to stdout, and all messages of critical to an email address. This scenario -requires three individual handlers where each hander is responsible for sending +requires three individual handlers where each handler is responsible for sending messages of a specific severity to a specific location. The standard library includes quite a few handler types; this tutorial uses only diff --git a/Doc/library/mailbox.rst b/Doc/library/mailbox.rst index d81897c..e05f44a 100644 --- a/Doc/library/mailbox.rst +++ b/Doc/library/mailbox.rst @@ -432,7 +432,7 @@ the original. In the interest of compatibility, :class:`mbox` implements the original format, which is sometimes referred to as :dfn:`mboxo`. This means that the :mailheader:`Content-Length` header, if present, is ignored and that any occurrences of "From " at the beginning of a line in a message body are -transformed to ">From " when storing the message, although occurences of ">From +transformed to ">From " when storing the message, although occurrences of ">From " are not transformed to "From " when reading the message. Some :class:`Mailbox` methods implemented by :class:`mbox` deserve special @@ -580,7 +580,7 @@ remarks: .. method:: MH.close() - :class:`MH` instances do not keep any open files, so this method is equivelant + :class:`MH` instances do not keep any open files, so this method is equivalent to :meth:`unlock`. diff --git a/Doc/library/optparse.rst b/Doc/library/optparse.rst index 1b1b8ba..7903ae8 100644 --- a/Doc/library/optparse.rst +++ b/Doc/library/optparse.rst @@ -1629,7 +1629,7 @@ arguments:: value.append(arg) del rargs[0] - setattr(parser.values, option.dest, value) + setattr(parser.values, option.dest, value) [...] parser.add_option("-c", "--callback", diff --git a/Doc/library/platform.rst b/Doc/library/platform.rst index cddaa58..bb1e672 100644 --- a/Doc/library/platform.rst +++ b/Doc/library/platform.rst @@ -237,7 +237,7 @@ Unix Platforms version)`` which default to the given parameters in case the lookup fails. Note that this function has intimate knowledge of how different libc versions - add symbols to the executable is probably only useable for executables compiled + add symbols to the executable is probably only usable for executables compiled using :program:`gcc`. The file is read and scanned in chunks of *chunksize* bytes. diff --git a/Doc/library/profile.rst b/Doc/library/profile.rst index fe3cadf..2d46033 100644 --- a/Doc/library/profile.rst +++ b/Doc/library/profile.rst @@ -513,7 +513,7 @@ The :class:`Stats` Class non-parenthesized number repeats the cumulative time spent in the function at the right. - * With :mod:`cProfile`, each caller is preceeded by three numbers: the number of + * With :mod:`cProfile`, each caller is preceded by three numbers: the number of times this specific call was made, and the total and cumulative times spent in the current function while it was invoked by this specific caller. diff --git a/Doc/library/random.rst b/Doc/library/random.rst index f08192d..c9e703c 100644 --- a/Doc/library/random.rst +++ b/Doc/library/random.rst @@ -68,6 +68,17 @@ Bookkeeping functions: the time :func:`setstate` was called. +.. function:: jumpahead(n) + + Change the internal state to one different from and likely far away from the + current state. *n* is a non-negative integer which is used to scramble the + current state vector. This is most useful in multi-threaded programs, in + conjunction with multiple instances of the :class:`Random` class: + :meth:`setstate` or :meth:`seed` can be used to force all instances into the + same internal state, and then :meth:`jumpahead` can be used to force the + instances' states far apart. + + .. function:: getrandbits(k) Returns a python integer with *k* random bits. This method is supplied with diff --git a/Doc/library/re.rst b/Doc/library/re.rst index 0c64c72..852511c 100644 --- a/Doc/library/re.rst +++ b/Doc/library/re.rst @@ -1089,7 +1089,7 @@ into a list with each nonempty line having its own entry:: 'Heather Albrecht 548.326.4584 919 Park Place'] Finally, split each entry into a list with first name, last name, telephone -number, and address. We use the ``maxsplit`` paramater of :func:`split` +number, and address. We use the ``maxsplit`` parameter of :func:`split` because the address has spaces, our splitting pattern, in it:: >>> [re.split(":? ", entry, 3) for entry in entries] @@ -1099,7 +1099,7 @@ because the address has spaces, our splitting pattern, in it:: ['Heather', 'Albrecht', '548.326.4584', '919 Park Place']] The ``:?`` pattern matches the colon after the last name, so that it does not -occur in the result list. With a ``maxsplit`` of ``4``, we could seperate the +occur in the result list. With a ``maxsplit`` of ``4``, we could separate the house number from the street name:: >>> [re.split(":? ", entry, 4) for entry in entries] @@ -1131,7 +1131,7 @@ in each word of a sentence except for the first and last characters:: Finding all Adverbs ^^^^^^^^^^^^^^^^^^^ -:func:`findall` matches *all* occurences of a pattern, not just the first +:func:`findall` matches *all* occurrences of a pattern, not just the first one as :func:`search` does. For example, if one was a writer and wanted to find all of the adverbs in some text, he or she might use :func:`findall` in the following manner:: diff --git a/Doc/library/socket.rst b/Doc/library/socket.rst index cb1b87c..971e316 100644 --- a/Doc/library/socket.rst +++ b/Doc/library/socket.rst @@ -886,5 +886,5 @@ the interface:: # receive a package print s.recvfrom(65565) - # disabled promiscous mode + # disabled promiscuous mode s.ioctl(socket.SIO_RCVALL, socket.RCVALL_OFF) diff --git a/Doc/library/tokenize.rst b/Doc/library/tokenize.rst index 19a5a35..9a17b14 100644 --- a/Doc/library/tokenize.rst +++ b/Doc/library/tokenize.rst @@ -18,7 +18,7 @@ The primary entry point is a :term:`generator`: .. function:: generate_tokens(readline) - The :func:`generate_tokens` generator requires one argment, *readline*, which + The :func:`generate_tokens` generator requires one argument, *readline*, which must be a callable object which provides the same interface as the :meth:`readline` method of built-in file objects (see section :ref:`bltin-file-objects`). Each call to the function should return one line of diff --git a/Doc/library/weakref.rst b/Doc/library/weakref.rst index 195ac95..83e6000 100644 --- a/Doc/library/weakref.rst +++ b/Doc/library/weakref.rst @@ -61,7 +61,7 @@ support weak references but can add support through subclassing:: class Dict(dict): pass - obj = Dict(red=1, green=2, blue=3) # this object is weak referencable + obj = Dict(red=1, green=2, blue=3) # this object is weak referenceable Extension types can easily be made to support weak references; see :ref:`weakref-support`. diff --git a/Doc/library/xml.etree.elementtree.rst b/Doc/library/xml.etree.elementtree.rst index 44c82e0..5590476 100644 --- a/Doc/library/xml.etree.elementtree.rst +++ b/Doc/library/xml.etree.elementtree.rst @@ -421,7 +421,7 @@ TreeBuilder Objects .. method:: TreeBuilder.close() - Flushes the parser buffers, and returns the toplevel documen element. Returns an + Flushes the parser buffers, and returns the toplevel document element. Returns an Element instance. |