Commit f0dfc7ac authored by Walter Dörwald's avatar Walter Dörwald

Fix a bunch of typos in documentation, docstrings and comments.

(From SF patch #810751)
parent 4b17e399
......@@ -547,7 +547,7 @@ base class methods when a derived class overrides<P>
all class variables<P>
<LI>Implement a different way to store instance variables (e.g. in a
list kept outside the the instance but indexed by the instance's id())<P>
list kept outside the instance but indexed by the instance's id())<P>
<LI>Automatically wrap or trap all or certain methods
......
......@@ -685,7 +685,7 @@ when objects are involved in cycles. For example, consider:
In this example, we create a list that contains itself. When we delete
it, it still has a reference from itself. It's reference count doesn't
drop to zero. Fortunately, Python's cyclic-garbage collector will
eventually figure out that that the list is garbage and free it.
eventually figure out that the list is garbage and free it.
In the second version of the \class{Noddy} example, we allowed any
kind of object to be stored in the \member{first} or \member{last}
......
......@@ -407,7 +407,7 @@ identifying the basis of a sort (example: \code{'time'} or
\code{'name'}).
When more than one key is provided, then additional keys are used as
secondary criteria when the there is equality in all keys selected
secondary criteria when there is equality in all keys selected
before them. For example, \samp{sort_stats('name', 'file')} will sort
all the entries according to their function name, and resolve all ties
(identical function names) by sorting by file name.
......
......@@ -247,7 +247,7 @@ expressions.)
\code{match()} and \code{search()}. (Already compiled expression
objects are not affected.) The argument is an integer which is the
OR of several flag bits. The return value is the previous value of
the syntax flags. Names for the flags are defined in the standard
the syntax flags. Names for the flags are defined in the standard
module \code{regex_syntax}\refstmodindex{regex_syntax}; read the
file \file{regex_syntax.py} for more information.
\end{funcdesc}
......
......@@ -149,7 +149,7 @@ target.
\item
If the target list is a comma-separated list of targets: The object
must be a sequence with the same number of items as the there are
must be a sequence with the same number of items as there are
targets in the target list, and the items are assigned, from left to
right, to the corresponding targets. (This rule is relaxed as of
Python 1.5; in earlier versions, the object had to be a tuple. Since
......
%
% python.sty for the Python docummentation [works only with with Latex2e]
% python.sty for the Python docummentation [works only with Latex2e]
%
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
......
......@@ -1000,7 +1000,7 @@ every starting and end tag encountered by the parser, the
\method{characters()} method is called for every chunk of character
data, and so forth.
The advantage of the event-driven approach is that that the whole
The advantage of the event-driven approach is that the whole
document doesn't have to be resident in memory at any one time, which
matters if you are processing really huge documents. However, writing
the SAX handler class can get very complicated if you're trying to
......
......@@ -872,7 +872,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
PyAPI_FUNC(PyObject *) PyNumber_InPlaceOr(PyObject *o1, PyObject *o2);
/*
Returns the result of bitwise or or o1 and o2, possibly in-place,
Returns the result of bitwise or of o1 and o2, possibly in-place,
or null on failure. This is the equivalent of the Python
expression: o1 |= o2.
......
......@@ -19,7 +19,7 @@ ConfigParser constructor as a dictionary.
class:
ConfigParser -- responsible for for parsing a list of
ConfigParser -- responsible for parsing a list of
configuration files, and managing the parsed database.
methods:
......
......@@ -76,7 +76,7 @@ a dictionary.
Notice that the printable representation of a Cookie is the
appropriate format for a Set-Cookie: header. This is the
default behavior. You can change the header and printed
attributes by using the the .output() function
attributes by using the .output() function
>>> C = Cookie.SmartCookie()
>>> C["rocky"] = "road"
......
......@@ -497,7 +497,7 @@ def close_all(map=None):
#
# After a little research (reading man pages on various unixen, and
# digging through the linux kernel), I've determined that select()
# isn't meant for doing doing asynchronous file i/o.
# isn't meant for doing asynchronous file i/o.
# Heartening, though - reading linux/mm/filemap.c shows that linux
# supports asynchronous read-ahead. So _MOST_ of the time, the data
# will be sitting in memory for us already when we go to read it.
......
......@@ -148,7 +148,7 @@ class Command:
"""Set final values for all the options that this command supports.
This is always called as late as possible, ie. after any option
assignments from the command-line or from other commands have been
done. Thus, this is the place to to code option dependencies: if
done. Thus, this is the place to code option dependencies: if
'foo' depends on 'bar', then it is safe to set 'foo' from 'bar' as
long as 'foo' still has the same value it was assigned in
'initialize_options()'.
......
......@@ -775,7 +775,7 @@ class Message:
newparams.append((pk, pv))
if not foundp:
# The original Content-Type header had no boundary attribute.
# Tack one one the end. BAW: should we raise an exception
# Tack one on the end. BAW: should we raise an exception
# instead???
newparams.append(('boundary', '"%s"' % boundary))
# Replace the existing Content-Type header with the new value
......
......@@ -238,7 +238,7 @@ def _siftup(heap, pos):
heap[pos] = heap[childpos]
pos = childpos
childpos = 2*pos + 1
# The leaf at pos is empty now. Put newitem there, and and bubble it up
# The leaf at pos is empty now. Put newitem there, and bubble it up
# to its final resting place (by sifting its parents down).
heap[pos] = newitem
_siftdown(heap, startpos, pos)
......
......@@ -18,7 +18,7 @@ One hooks class is defined (Hooks), which uses the interface provided
by standard modules os and os.path. It should be used as the base
class for other hooks classes.
2) A "module loader" class provides an interface to to search for a
2) A "module loader" class provides an interface to search for a
module in a search path and to load it. It defines a method which
searches for a module in a single directory; by overriding this method
one can redefine the details of the search. If the directory is None,
......
......@@ -65,7 +65,7 @@ class MimeTypes:
self.read(name, strict)
def add_type(self, type, ext, strict=True):
"""Add a mapping between a type and and extension.
"""Add a mapping between a type and an extension.
When the extension is already known, the new
type will replace the old one. When the type
......@@ -269,7 +269,7 @@ def guess_extension(type, strict=True):
return guess_extension(type, strict)
def add_type(self, type, ext, strict=True):
"""Add a mapping between a type and and extension.
"""Add a mapping between a type and an extension.
When the extension is already known, the new
type will replace the old one. When the type
......
......@@ -301,7 +301,7 @@ def ismount(path):
# For each directory under top (including top itself, but excluding
# '.' and '..'), func(arg, dirname, filenames) is called, where
# dirname is the name of the directory and filenames is the list
# files files (and subdirectories etc.) in the directory.
# of files (and subdirectories etc.) in the directory.
# The func may modify the filenames list, to implement a filter,
# or to impose a different order of visiting.
......
......@@ -260,7 +260,7 @@ def ismount(path):
# For each directory under top (including top itself, but excluding
# '.' and '..'), func(arg, dirname, filenames) is called, where
# dirname is the name of the directory and filenames is the list
# files files (and subdirectories etc.) in the directory.
# of files (and subdirectories etc.) in the directory.
# The func may modify the filenames list, to implement a filter,
# or to impose a different order of visiting.
......
......@@ -607,7 +607,7 @@ class MatchObject:
whole match is returned). If a groupN argument is zero, the
corresponding return value is the entire matching string; if
it is in the inclusive range [1..99], it is the string
matching the the corresponding parenthesized group. If a group
matching the corresponding parenthesized group. If a group
number is negative or larger than the number of groups defined
in the pattern, an IndexError exception is raised. If a group
is contained in a part of the pattern that did not match, the
......
......@@ -339,7 +339,7 @@ supplied criteria. The argument is typically a string identifying the
basis of a sort (example: "time" or "name").
When more than one key is provided, then additional keys are used as
secondary criteria when the there is equality in all keys selected
secondary criteria when there is equality in all keys selected
before them. For example, sort_stats('name', 'file') will sort all
the entries according to their function name, and resolve all ties
(identical function names) by sorting by file name.
......@@ -464,7 +464,7 @@ The second limitation has to do with accuracy of timing information.
There is a fundamental problem with deterministic profilers involving
accuracy. The most obvious restriction is that the underlying "clock"
is only ticking at a rate (typically) of about .001 seconds. Hence no
measurements will be more accurate that that underlying clock. If
measurements will be more accurate than that underlying clock. If
enough measurements are taken, then the "error" will tend to average
out. Unfortunately, removing this first error induces a second source
of error...
......
......@@ -117,7 +117,7 @@ class Completer:
Assuming the text is of the form NAME.NAME....[NAME], and is
evaluatable in self.namespace, it will be evaluated and its attributes
(as revealed by dir()) are used as possible completions. (For class
instances, class members are are also considered.)
instances, class members are also considered.)
WARNING: this can still invoke arbitrary C code, if an object
with a __getattr__ hook is evaluated.
......
......@@ -10,7 +10,7 @@ somewhere near the top of their code. Because of the automatic
import, this is no longer necessary (but code that does it still
works).
This will append site-specific paths to to the module search path. On
This will append site-specific paths to the module search path. On
Unix, it starts with sys.prefix and sys.exec_prefix (if different) and
appends lib/python<version>/site-packages as well as lib/site-python.
On other platforms (mainly Mac and Windows), it uses just sys.prefix
......
......@@ -202,7 +202,7 @@ if sys.platform[:4] != 'java':
oct(testme)
hex(testme)
else:
# Jython enforced that the these methods return
# Jython enforced that these methods return
# a value of the expected type.
print "__int__: ()"
print "__long__: ()"
......
......@@ -34,7 +34,7 @@ errors = ['E2BIG', 'EACCES', 'EADDRINUSE', 'EADDRNOTAVAIL', 'EADV',
'EUSERS', 'EWOULDBLOCK', 'EXDEV', 'EXFULL']
#
# This is is a wee bit bogus since the module only conditionally adds
# This is a wee bit bogus since the module only conditionally adds
# errno constants if they have been defined by errno.h However, this
# test seems to work on SGI, Sparc & intel Solaris, and linux.
#
......
# As a test suite for the os module, this is woefully inadequate, but this
# does add tests for a few functions which have been determined to be more
# more portable than they had been thought to be.
# portable than they had been thought to be.
import os
import unittest
......
......@@ -71,7 +71,7 @@ verify(not in_table_d2(u"\u0040"))
# This would generate a hash of all predicates. However, running
# it is quite expensive, and only serves to detect changes in the
# unicode database. Instead, stringprep.py asserts the version of
# of the database.
# the database.
# predicates = [k for k in dir(stringprep) if k.startswith("in_table")]
# predicates.sort()
......
......@@ -802,7 +802,7 @@ def encode_digest(digest):
class AbstractHTTPHandler(BaseHandler):
# XXX Should rewrite do_open() to use the new httplib interface,
# would would be a little simpler.
# would be a little simpler.
def do_open(self, http_class, req):
host = req.get_host()
......
......@@ -51,7 +51,7 @@ def whichdb(filename):
except (IOError, _dbmerror):
pass
# Check for dumbdbm next -- this has a .dir and and a .dat file
# Check for dumbdbm next -- this has a .dir and a .dat file
try:
# First check for presence of files
os.stat(filename + os.extsep + "dat")
......
......@@ -994,7 +994,7 @@ def dumps(params, methodname=None, methodresponse=None, encoding=None,
# represents a fault condition, this function raises a Fault exception.
#
# @param data An XML-RPC packet, given as an 8-bit string.
# @return A tuple containing the the unpacked data, and the method name
# @return A tuple containing the unpacked data, and the method name
# (None if not present).
# @see Fault
......
......@@ -7053,7 +7053,7 @@ separate file pyimenu.el is no longer needed, imenu support is folded
into python-mode.el.
- The configure script can finally correctly find the readline library in a
non-standard location. The LDFLAGS variable is passed on the the Makefiles
non-standard location. The LDFLAGS variable is passed on the Makefiles
from the configure script.
- Shared libraries are now installed as programs (i.e. with executable
......@@ -9278,7 +9278,7 @@ passed are system-dependent. You can generate a version for your own
system by running the script demo/scripts/h2py.py with
/usr/include/sys/socket.h as input.
cddb: interface to the database used the the CD player
cddb: interface to the database used by the CD player
torgb: convert various image file types to rgb format (requires pbmplus)
......
......@@ -224,7 +224,7 @@ newPySSLObject(PySocketSockObject *Sock, char *key_file, char *cert_file)
Py_END_ALLOW_THREADS
SSL_set_fd(self->ssl, Sock->sock_fd); /* Set the socket for SSL */
/* If the socket is is non-blocking mode or timeout mode, set the BIO
/* If the socket is in non-blocking mode or timeout mode, set the BIO
* to non-blocking mode (blocking is the default)
*/
if (Sock->sock_timeout >= 0.0) {
......
......@@ -899,7 +899,7 @@ offset_as_timedelta(PyObject *tzinfo, char *name, PyObject *tzinfoarg) {
* result. tzinfo must be an instance of the tzinfo class. If dst()
* returns None, call_dst returns 0 and sets *none to 1. If dst()
& doesn't return None or timedelta, TypeError is raised and this
* returns -1. If dst() returns an invalid timedelta for for a UTC offset,
* returns -1. If dst() returns an invalid timedelta for a UTC offset,
* ValueError is raised and this returns -1. Else *none is set to 0 and
* the offset is returned (as an int # of minutes east of UTC).
*/
......@@ -4818,7 +4818,7 @@ z' = z + z.d = 1:MM then, and z'.d=0, and z'.d - z.d = -60 != 0 so [8]
Because we know z.d said z was in daylight time (else [5] would have held and
we would have stopped then), and we know z.d != z'.d (else [8] would have held
and we we have stopped then), and there are only 2 possible values dst() can
and we would have stopped then), and there are only 2 possible values dst() can
return in Eastern, it follows that z'.d must be 0 (which it is in the example,
but the reasoning doesn't depend on the example -- it depends on there being
two possible dst() outcomes, one zero and the other non-zero). Therefore
......
......@@ -154,7 +154,7 @@ Py_Main(int argc, char **argv)
if (c == 'c') {
/* -c is the last option; following arguments
that look like options are left for the
the command to interpret. */
command to interpret. */
command = malloc(strlen(_PyOS_optarg) + 2);
if (command == NULL)
Py_FatalError(
......
......@@ -141,7 +141,7 @@ MD5Update(MD5_CTX *context, unsigned char *input, unsigned int inputLen)
}
/* MD5 finalization. Ends an MD5 message-digest operation, writing the
the message digest and zeroing the context.
message digest and zeroing the context.
*/
void
MD5Final(unsigned char digest[16], MD5_CTX *context)
......
......@@ -3953,7 +3953,7 @@ _PyPopen(char *cmdstring, int mode, int n)
/* Create new output read handle and the input write handle. Set
* the inheritance properties to FALSE. Otherwise, the child inherits
* the these handles; resulting in non-closeable handles to the pipes
* these handles; resulting in non-closeable handles to the pipes
* being created. */
fSuccess = DuplicateHandle(GetCurrentProcess(), hChildStdinWr,
GetCurrentProcess(), &hChildStdinWrDup, 0,
......
......@@ -573,7 +573,7 @@ restrictions:
/* #define DEBUG */
/* Use a macro for debugging printing, 'cause that eliminates the the use
/* Use a macro for debugging printing, 'cause that eliminates the use
of #ifdef inline, and there are *still* stupid compilers about that don't like
indented pre-processor statements. I suppose it's only been 10 years... */
......
......@@ -105,7 +105,7 @@ shutdown(how) -- shut down traffic in one or both directions\n\
\n\
[*] not available on all platforms!");
/* XXX This is a terrible mess of of platform-dependent preprocessor hacks.
/* XXX This is a terrible mess of platform-dependent preprocessor hacks.
I hope some day someone can clean this up please... */
/* Hacks for gethostbyname_r(). On some non-Linux platforms, the configure
......
......@@ -5411,7 +5411,7 @@ static PyMemberDef super_members[] = {
{"__self__", T_OBJECT, offsetof(superobject, obj), READONLY,
"the instance invoking super(); may be None"},
{"__self_class__", T_OBJECT, offsetof(superobject, obj_type), READONLY,
"the type of the the instance invoking super(); may be None"},
"the type of the instance invoking super(); may be None"},
{0}
};
......
......@@ -4,7 +4,7 @@
/* pyconfig.h. NOT Generated automatically by configure.
This is a manually maintained version used for the Watcom,
Borland and and Microsoft Visual C++ compilers. It is a
Borland and Microsoft Visual C++ compilers. It is a
standard part of the Python distribution.
WINDOWS DEFINES:
......
......@@ -553,7 +553,7 @@ _PyImport_FindExtension(char *name, char *filename)
/* Get the module object corresponding to a module name.
First check the modules dictionary if there's one there,
if not, create a new one and insert in in the modules dictionary.
if not, create a new one and insert it in the modules dictionary.
Because the former action is most common, THIS DOES NOT RETURN A
'NEW' REFERENCE! */
......
......@@ -58,7 +58,7 @@ def Output(format = "", *args):
VaOutput(format, args)
def VaOutput(format, args):
"""Call this with a format string and and argument tuple for the format.
"""Call this with a format string and argument tuple for the format.
A newline is always added. Each line in the output is indented
to the proper indentation level -- even if the result of the
......
......@@ -135,7 +135,7 @@ under Windows, or libtcl8.2.so and libtcl8.2.so under Unix) are required
at program load time, and are searched by the operating system loader
before Python can be started. Under Windows, the environment
variable PATH is consulted, and under Unix, it may be the
the environment variable LD_LIBRARY_PATH and/or the system
environment variable LD_LIBRARY_PATH and/or the system
shared library cache (ld.so). An additional preferred directory for
finding the dynamic libraries is built into the .dll or .so files at
compile time - see the LIB_RUNTIME_DIR variable in the Tcl makefile.
......
......@@ -56,7 +56,7 @@ Here are the possible messages on stdout (N stands for a line number):
- 'No conclusive evidence on line N', line marked by '*':
A / operator was found for which no warnings were seen. This could
be code that was never executed, or code that was only executed with
be code that was never executed, or code that was only executed
with user-defined objects as arguments. You will have to
investigate further. Note that // can be overloaded separately from
/, using __floordiv__. True division can also be separately
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment