summaryrefslogtreecommitdiffstats
path: root/Doc/library
diff options
context:
space:
mode:
Diffstat (limited to 'Doc/library')
-rw-r--r--Doc/library/abc.rst4
-rw-r--r--Doc/library/aifc.rst2
-rw-r--r--Doc/library/al.rst2
-rw-r--r--Doc/library/ast.rst4
-rw-r--r--Doc/library/audioop.rst2
-rw-r--r--Doc/library/bastion.rst4
-rw-r--r--Doc/library/bdb.rst4
-rw-r--r--Doc/library/bsddb.rst4
-rw-r--r--Doc/library/bz2.rst2
-rw-r--r--Doc/library/cd.rst4
-rw-r--r--Doc/library/cmath.rst4
-rw-r--r--Doc/library/codeop.rst2
-rw-r--r--Doc/library/collections.rst20
-rw-r--r--Doc/library/compiler.rst14
-rw-r--r--Doc/library/crypt.rst2
-rw-r--r--Doc/library/csv.rst2
-rw-r--r--Doc/library/datetime.rst34
-rw-r--r--Doc/library/decimal.rst34
-rw-r--r--Doc/library/difflib.rst2
-rw-r--r--Doc/library/dircache.rst6
-rw-r--r--Doc/library/dis.rst6
-rw-r--r--Doc/library/dl.rst8
-rw-r--r--Doc/library/email.mime.rst2
-rw-r--r--Doc/library/fileinput.rst2
-rw-r--r--Doc/library/fl.rst12
-rw-r--r--Doc/library/fm.rst2
-rw-r--r--Doc/library/fpformat.rst4
-rw-r--r--Doc/library/functions.rst12
-rw-r--r--Doc/library/gl.rst12
-rw-r--r--Doc/library/heapq.rst2
-rw-r--r--Doc/library/htmllib.rst2
-rw-r--r--Doc/library/idle.rst2
-rw-r--r--Doc/library/imageop.rst2
-rw-r--r--Doc/library/imgfile.rst2
-rw-r--r--Doc/library/io.rst4
-rw-r--r--Doc/library/itertools.rst20
-rw-r--r--Doc/library/jpeg.rst2
-rw-r--r--Doc/library/json.rst22
-rw-r--r--Doc/library/locale.rst2
-rw-r--r--Doc/library/macos.rst4
-rw-r--r--Doc/library/mailbox.rst2
-rw-r--r--Doc/library/marshal.rst2
-rw-r--r--Doc/library/math.rst2
-rw-r--r--Doc/library/mhlib.rst2
-rw-r--r--Doc/library/mmap.rst2
-rw-r--r--Doc/library/msvcrt.rst20
-rw-r--r--Doc/library/multiprocessing.rst36
-rw-r--r--Doc/library/mutex.rst2
-rw-r--r--Doc/library/nntplib.rst6
-rw-r--r--Doc/library/operator.rst10
-rw-r--r--Doc/library/optparse.rst2
-rw-r--r--Doc/library/os.rst14
-rw-r--r--Doc/library/ossaudiodev.rst10
-rw-r--r--Doc/library/othergui.rst2
-rw-r--r--Doc/library/pdb.rst6
-rw-r--r--Doc/library/pickle.rst20
-rw-r--r--Doc/library/popen2.rst2
-rw-r--r--Doc/library/profile.rst24
-rw-r--r--Doc/library/pyexpat.rst6
-rw-r--r--Doc/library/re.rst8
-rw-r--r--Doc/library/rexec.rst4
-rw-r--r--Doc/library/rlcompleter.rst2
-rw-r--r--Doc/library/robotparser.rst2
-rw-r--r--Doc/library/sched.rst4
-rw-r--r--Doc/library/sgmllib.rst2
-rw-r--r--Doc/library/shutil.rst10
-rw-r--r--Doc/library/signal.rst42
-rw-r--r--Doc/library/simplexmlrpcserver.rst6
-rw-r--r--Doc/library/smtplib.rst6
-rw-r--r--Doc/library/socket.rst26
-rw-r--r--Doc/library/sqlite3.rst26
-rw-r--r--Doc/library/ssl.rst12
-rw-r--r--Doc/library/statvfs.rst2
-rw-r--r--Doc/library/stdtypes.rst14
-rw-r--r--Doc/library/string.rst26
-rw-r--r--Doc/library/stringio.rst6
-rw-r--r--Doc/library/subprocess.rst4
-rw-r--r--Doc/library/sunaudio.rst4
-rw-r--r--Doc/library/sys.rst6
-rw-r--r--Doc/library/tk.rst12
-rw-r--r--Doc/library/tkinter.rst6
-rw-r--r--Doc/library/trace.rst4
-rw-r--r--Doc/library/traceback.rst8
-rw-r--r--Doc/library/turtle.rst42
-rw-r--r--Doc/library/undoc.rst8
-rw-r--r--Doc/library/unicodedata.rst2
-rw-r--r--Doc/library/unittest.rst4
-rw-r--r--Doc/library/urllib.rst2
-rw-r--r--Doc/library/urllib2.rst2
-rw-r--r--Doc/library/warnings.rst8
-rw-r--r--Doc/library/webbrowser.rst2
-rw-r--r--Doc/library/wsgiref.rst4
-rw-r--r--Doc/library/xml.etree.elementtree.rst16
-rw-r--r--Doc/library/zipfile.rst20
-rw-r--r--Doc/library/zipimport.rst2
95 files changed, 400 insertions, 400 deletions
diff --git a/Doc/library/abc.rst b/Doc/library/abc.rst
index 8700faf..a4b29f6 100644
--- a/Doc/library/abc.rst
+++ b/Doc/library/abc.rst
@@ -130,7 +130,7 @@ It also provides the following decorators:
A decorator indicating abstract methods.
Using this decorator requires that the class's metaclass is :class:`ABCMeta` or
- is derived from it.
+ is derived from it.
A class that has a metaclass derived from :class:`ABCMeta`
cannot be instantiated unless all of its abstract methods and
properties are overridden.
@@ -166,7 +166,7 @@ It also provides the following decorators:
A subclass of the built-in :func:`property`, indicating an abstract property.
Using this function requires that the class's metaclass is :class:`ABCMeta` or
- is derived from it.
+ is derived from it.
A class that has a metaclass derived from :class:`ABCMeta` cannot be
instantiated unless all of its abstract methods and properties are overridden.
The abstract properties can be called using any of the normal
diff --git a/Doc/library/aifc.rst b/Doc/library/aifc.rst
index 7f7d7fe..e3bb51a 100644
--- a/Doc/library/aifc.rst
+++ b/Doc/library/aifc.rst
@@ -17,7 +17,7 @@ samples in a file. AIFF-C is a newer version of the format that includes the
ability to compress the audio data.
.. warning::
-
+
Some operations may only work under IRIX; these will raise :exc:`ImportError`
when attempting to import the :mod:`cl` module, which is only available on IRIX.
diff --git a/Doc/library/al.rst b/Doc/library/al.rst
index 4ce5098..12cec42 100644
--- a/Doc/library/al.rst
+++ b/Doc/library/al.rst
@@ -6,7 +6,7 @@
:platform: IRIX
:synopsis: Audio functions on the SGI.
:deprecated:
-
+
.. deprecated:: 2.6
The :mod:`al` module has been deprecated for removal in Python 3.0.
diff --git a/Doc/library/ast.rst b/Doc/library/ast.rst
index 87b8bac..5c1d5c4 100644
--- a/Doc/library/ast.rst
+++ b/Doc/library/ast.rst
@@ -127,7 +127,7 @@ and classes for traversing abstract syntax trees:
Parse an expression into an AST node. Equivalent to ``compile(expr,
filename, mode, ast.PyCF_ONLY_AST)``.
-
+
.. function:: literal_eval(node_or_string)
Safely evaluate an expression node or a string containing a Python
@@ -205,7 +205,7 @@ and classes for traversing abstract syntax trees:
.. method:: generic_visit(node)
This visitor calls :meth:`visit` on all children of the node.
-
+
Note that child nodes of nodes that have a custom visitor method won't be
visited unless the visitor calls :meth:`generic_visit` or visits them
itself.
diff --git a/Doc/library/audioop.rst b/Doc/library/audioop.rst
index 02bd755..8b7aa9e 100644
--- a/Doc/library/audioop.rst
+++ b/Doc/library/audioop.rst
@@ -265,7 +265,7 @@ sample and subtract the whole output sample from the input sample::
in_test = inputdata[pos*2:]
ipos, factor = audioop.findfit(in_test, out_test)
# Optional (for better cancellation):
- # factor = audioop.findfactor(in_test[ipos*2:ipos*2+len(out_test)],
+ # factor = audioop.findfactor(in_test[ipos*2:ipos*2+len(out_test)],
# out_test)
prefill = '\0'*(pos+ipos)*2
postfill = '\0'*(len(inputdata)-len(prefill)-len(outputdata))
diff --git a/Doc/library/bastion.rst b/Doc/library/bastion.rst
index 35ecd75..5916af4 100644
--- a/Doc/library/bastion.rst
+++ b/Doc/library/bastion.rst
@@ -5,10 +5,10 @@
.. module:: Bastion
:synopsis: Providing restricted access to objects.
:deprecated:
-
+
.. deprecated:: 2.6
The :mod:`Bastion` module has been removed in Python 3.0.
-
+
.. moduleauthor:: Barry Warsaw <bwarsaw@python.org>
diff --git a/Doc/library/bdb.rst b/Doc/library/bdb.rst
index 3041b7b..a74e14d 100644
--- a/Doc/library/bdb.rst
+++ b/Doc/library/bdb.rst
@@ -325,7 +325,7 @@ Finally, the module defines the following functions:
Check whether we should break here, depending on the way the breakpoint *b*
was set.
-
+
If it was set via line number, it checks if ``b.line`` is the same as the one
in the frame also passed as argument. If the breakpoint was set via function
name, we have to check we are in the right frame (the right function) and if
@@ -335,7 +335,7 @@ Finally, the module defines the following functions:
Determine if there is an effective (active) breakpoint at this line of code.
Return breakpoint number or 0 if none.
-
+
Called only if we know there is a breakpoint at this location. Returns the
breakpoint that was triggered and a flag that indicates if it is ok to delete
a temporary breakpoint.
diff --git a/Doc/library/bsddb.rst b/Doc/library/bsddb.rst
index 52ff38a..f6aa6d7 100644
--- a/Doc/library/bsddb.rst
+++ b/Doc/library/bsddb.rst
@@ -172,7 +172,7 @@ Example::
>>> import bsddb
>>> db = bsddb.btopen('/tmp/spam.db', 'c')
>>> for i in range(10): db['%d'%i] = '%d'% (i*i)
- ...
+ ...
>>> db['3']
'9'
>>> db.keys()
@@ -185,7 +185,7 @@ Example::
('9', '81')
>>> db.set_location('2')
('2', '4')
- >>> db.previous()
+ >>> db.previous()
('1', '1')
>>> for k, v in db.iteritems():
... print k, v
diff --git a/Doc/library/bz2.rst b/Doc/library/bz2.rst
index 7c93cec..7804c54 100644
--- a/Doc/library/bz2.rst
+++ b/Doc/library/bz2.rst
@@ -93,7 +93,7 @@ Handling of compressed files is offered by the :class:`BZ2File` class.
performance optimizations previously implemented in the :mod:`xreadlines`
module.
- .. deprecated:: 2.3
+ .. deprecated:: 2.3
This exists only for compatibility with the method by this name on
:class:`file` objects, which is deprecated. Use ``for line in file``
instead.
diff --git a/Doc/library/cd.rst b/Doc/library/cd.rst
index d0464e7..0043764 100644
--- a/Doc/library/cd.rst
+++ b/Doc/library/cd.rst
@@ -6,8 +6,8 @@
:platform: IRIX
:synopsis: Interface to the CD-ROM on Silicon Graphics systems.
:deprecated:
-
-
+
+
.. deprecated:: 2.6
The :mod:`cd` module has been deprecated for removal in Python 3.0.
diff --git a/Doc/library/cmath.rst b/Doc/library/cmath.rst
index b9ea490..4469573 100644
--- a/Doc/library/cmath.rst
+++ b/Doc/library/cmath.rst
@@ -70,9 +70,9 @@ Definition::
.. function:: polar(x)
- Convert a :class:`complex` from rectangular coordinates to polar
+ Convert a :class:`complex` from rectangular coordinates to polar
coordinates. The function returns a tuple with the two elements
- *r* and *phi*. *r* is the distance from 0 and *phi* the phase
+ *r* and *phi*. *r* is the distance from 0 and *phi* the phase
angle.
.. versionadded:: 2.6
diff --git a/Doc/library/codeop.rst b/Doc/library/codeop.rst
index 456f6dd..39981ca 100644
--- a/Doc/library/codeop.rst
+++ b/Doc/library/codeop.rst
@@ -43,7 +43,7 @@ To do just the former:
other value will cause :exc:`ValueError` to be raised.
.. warning::
-
+
It is possible (but not likely) that the parser stops parsing with a
successful outcome before reaching the end of the source; in this case,
trailing symbols may be ignored instead of causing an error. For example,
diff --git a/Doc/library/collections.rst b/Doc/library/collections.rst
index 40ec9e8..2f72dcf 100644
--- a/Doc/library/collections.rst
+++ b/Doc/library/collections.rst
@@ -55,34 +55,34 @@ ABC Inherits Abstract Methods Mixin
:class:`Iterator` :class:`Iterable` ``__next__`` ``__iter__``
:class:`Sized` ``__len__``
:class:`Callable` ``__call__``
-
+
:class:`Sequence` :class:`Sized`, ``__getitem__`` ``__contains__``. ``__iter__``, ``__reversed__``.
:class:`Iterable`, and ``__len__`` ``index``, and ``count``
- :class:`Container`
-
+ :class:`Container`
+
:class:`MutableSequence` :class:`Sequence` ``__getitem__`` Inherited Sequence methods and
``__delitem__``, ``append``, ``reverse``, ``extend``, ``pop``,
``insert``, ``remove``, and ``__iadd__``
and ``__len__``
-
+
:class:`Set` :class:`Sized`, ``__len__``, ``__le__``, ``__lt__``, ``__eq__``, ``__ne__``,
:class:`Iterable`, ``__iter__``, and ``__gt__``, ``__ge__``, ``__and__``, ``__or__``
:class:`Container` ``__contains__`` ``__sub__``, ``__xor__``, and ``isdisjoint``
-
+
:class:`MutableSet` :class:`Set` ``add`` and Inherited Set methods and
``discard`` ``clear``, ``pop``, ``remove``, ``__ior__``,
``__iand__``, ``__ixor__``, and ``__isub__``
-
+
:class:`Mapping` :class:`Sized`, ``__getitem__``, ``__contains__``, ``keys``, ``items``, ``values``,
:class:`Iterable`, ``__len__``. and ``get``, ``__eq__``, and ``__ne__``
:class:`Container` ``__iter__``
-
+
:class:`MutableMapping` :class:`Mapping` ``__getitem__`` Inherited Mapping methods and
``__setitem__``, ``pop``, ``popitem``, ``clear``, ``update``,
``__delitem__``, and ``setdefault``
``__iter__``, and
``__len__``
-
+
:class:`MappingView` :class:`Sized` ``__len__``
:class:`KeysView` :class:`MappingView`, ``__contains__``,
:class:`Set` ``__iter__``
@@ -549,8 +549,8 @@ Example:
if kwds:
raise ValueError('Got unexpected field names: %r' % kwds.keys())
return result
- <BLANKLINE>
- def __getnewargs__(self):
+ <BLANKLINE>
+ def __getnewargs__(self):
return tuple(self)
<BLANKLINE>
x = property(itemgetter(0))
diff --git a/Doc/library/compiler.rst b/Doc/library/compiler.rst
index e13f7fc..0093518 100644
--- a/Doc/library/compiler.rst
+++ b/Doc/library/compiler.rst
@@ -559,24 +559,24 @@ to create an instance from a repr, you must import the class names from the
>>> import compiler
>>> mod = compiler.parseFile("/tmp/doublelib.py")
>>> mod
- Module('This is an example module.\n\nThis is the docstring.\n',
+ Module('This is an example module.\n\nThis is the docstring.\n',
Stmt([Function(None, 'double', ['x'], [], 0,
- 'Return twice the argument',
+ 'Return twice the argument',
Stmt([Return(Mul((Name('x'), Const(2))))]))]))
>>> from compiler.ast import *
- >>> Module('This is an example module.\n\nThis is the docstring.\n',
+ >>> Module('This is an example module.\n\nThis is the docstring.\n',
... Stmt([Function(None, 'double', ['x'], [], 0,
- ... 'Return twice the argument',
+ ... 'Return twice the argument',
... Stmt([Return(Mul((Name('x'), Const(2))))]))]))
- Module('This is an example module.\n\nThis is the docstring.\n',
+ Module('This is an example module.\n\nThis is the docstring.\n',
Stmt([Function(None, 'double', ['x'], [], 0,
- 'Return twice the argument',
+ 'Return twice the argument',
Stmt([Return(Mul((Name('x'), Const(2))))]))]))
>>> mod.doc
'This is an example module.\n\nThis is the docstring.\n'
>>> for node in mod.node.nodes:
... print node
- ...
+ ...
Function(None, 'double', ['x'], [], 0, 'Return twice the argument',
Stmt([Return(Mul((Name('x'), Const(2))))]))
>>> func = mod.node.nodes[0]
diff --git a/Doc/library/crypt.rst b/Doc/library/crypt.rst
index 4356944..2f037c7 100644
--- a/Doc/library/crypt.rst
+++ b/Doc/library/crypt.rst
@@ -51,7 +51,7 @@ A simple example illustrating typical use::
username = raw_input('Python login:')
cryptedpasswd = pwd.getpwnam(username)[1]
if cryptedpasswd:
- if cryptedpasswd == 'x' or cryptedpasswd == '*':
+ if cryptedpasswd == 'x' or cryptedpasswd == '*':
raise "Sorry, currently no support for shadow passwords"
cleartext = getpass.getpass()
return crypt.crypt(cleartext, cryptedpasswd) == cryptedpasswd
diff --git a/Doc/library/csv.rst b/Doc/library/csv.rst
index 2458b3c..f19574b 100644
--- a/Doc/library/csv.rst
+++ b/Doc/library/csv.rst
@@ -76,7 +76,7 @@ The :mod:`csv` module defines the following functions:
performed.
A short usage example::
-
+
>>> import csv
>>> spamReader = csv.reader(open('eggs.csv'), delimiter=' ', quotechar='|')
>>> for row in spamReader:
diff --git a/Doc/library/datetime.rst b/Doc/library/datetime.rst
index 76b8470..570ed9e 100644
--- a/Doc/library/datetime.rst
+++ b/Doc/library/datetime.rst
@@ -266,10 +266,10 @@ efficient pickling, and in Boolean contexts, a :class:`timedelta` object is
considered to be true if and only if it isn't equal to ``timedelta(0)``.
Example usage:
-
+
>>> from datetime import timedelta
>>> year = timedelta(days=365)
- >>> another_year = timedelta(weeks=40, days=84, hours=23,
+ >>> another_year = timedelta(weeks=40, days=84, hours=23,
... minutes=50, seconds=600) # adds up to 365 days
>>> year == another_year
True
@@ -517,10 +517,10 @@ Example of counting days to an event::
True
>>> my_birthday = date(today.year, 6, 24)
>>> if my_birthday < today:
- ... my_birthday = my_birthday.replace(year=today.year + 1)
+ ... my_birthday = my_birthday.replace(year=today.year + 1)
>>> my_birthday
datetime.date(2008, 6, 24)
- >>> time_to_birthday = abs(my_birthday - today)
+ >>> time_to_birthday = abs(my_birthday - today)
>>> time_to_birthday.days
202
@@ -1015,7 +1015,7 @@ Examples of working with datetime objects:
>>> tt = dt.timetuple()
>>> for it in tt: # doctest: +SKIP
... print it
- ...
+ ...
2006 # year
11 # month
21 # day
@@ -1044,23 +1044,23 @@ Using datetime with tzinfo:
... def __init__(self): # DST starts last Sunday in March
... d = datetime(dt.year, 4, 1) # ends last Sunday in October
... self.dston = d - timedelta(days=d.weekday() + 1)
- ... d = datetime(dt.year, 11, 1)
+ ... d = datetime(dt.year, 11, 1)
... self.dstoff = d - timedelta(days=d.weekday() + 1)
... def utcoffset(self, dt):
... return timedelta(hours=1) + self.dst(dt)
- ... def dst(self, dt):
+ ... def dst(self, dt):
... if self.dston <= dt.replace(tzinfo=None) < self.dstoff:
... return timedelta(hours=1)
... else:
... return timedelta(0)
... def tzname(self,dt):
... return "GMT +1"
- ...
+ ...
>>> class GMT2(tzinfo):
... def __init__(self):
- ... d = datetime(dt.year, 4, 1)
+ ... d = datetime(dt.year, 4, 1)
... self.dston = d - timedelta(days=d.weekday() + 1)
- ... d = datetime(dt.year, 11, 1)
+ ... d = datetime(dt.year, 11, 1)
... self.dstoff = d - timedelta(days=d.weekday() + 1)
... def utcoffset(self, dt):
... return timedelta(hours=1) + self.dst(dt)
@@ -1071,7 +1071,7 @@ Using datetime with tzinfo:
... return timedelta(0)
... def tzname(self,dt):
... return "GMT +2"
- ...
+ ...
>>> gmt1 = GMT1()
>>> # Daylight Saving Time
>>> dt1 = datetime(2006, 11, 21, 16, 30, tzinfo=gmt1)
@@ -1092,7 +1092,7 @@ Using datetime with tzinfo:
datetime.datetime(2006, 6, 14, 13, 0, tzinfo=<GMT1 object at 0x...>)
>>> dt2.utctimetuple() == dt3.utctimetuple()
True
-
+
.. _datetime-time:
@@ -1240,12 +1240,12 @@ Instance methods:
return ``None`` or a string object.
Example:
-
+
>>> from datetime import time, tzinfo
>>> class GMT1(tzinfo):
... def utcoffset(self, dt):
- ... return timedelta(hours=1)
- ... def dst(self, dt):
+ ... return timedelta(hours=1)
+ ... def dst(self, dt):
... return timedelta(0)
... def tzname(self,dt):
... return "Europe/Prague"
@@ -1476,7 +1476,7 @@ Applications that can't bear such ambiguities should avoid using hybrid
:class:`tzinfo` subclasses; there are no ambiguities when using UTC, or any
other fixed-offset :class:`tzinfo` subclass (such as a class representing only
EST (fixed offset -5 hours), or only EDT (fixed offset -4 hours)).
-
+
.. _strftime-behavior:
@@ -1521,7 +1521,7 @@ For an aware object:
The full set of format codes supported varies across platforms, because Python
calls the platform C library's :func:`strftime` function, and platform
-variations are common.
+variations are common.
The following is a list of all the format codes that the C standard (1989
version) requires, and these work on all platforms with a standard C
diff --git a/Doc/library/decimal.rst b/Doc/library/decimal.rst
index 46fe643..73de358 100644
--- a/Doc/library/decimal.rst
+++ b/Doc/library/decimal.rst
@@ -328,7 +328,7 @@ Decimal objects
infinity ::= 'Infinity' | 'Inf'
nan ::= 'NaN' [digits] | 'sNaN' [digits]
numeric-value ::= decimal-part [exponent-part] | infinity
- numeric-string ::= [sign] numeric-value | [sign] nan
+ numeric-string ::= [sign] numeric-value | [sign] nan
If *value* is a :class:`tuple`, it should have three components, a sign
(:const:`0` for positive or :const:`1` for negative), a :class:`tuple` of
@@ -970,7 +970,7 @@ In addition to the three supplied contexts, new contexts can be created with the
* :const:`ROUND_HALF_EVEN` (to nearest with ties going to nearest even integer),
* :const:`ROUND_HALF_UP` (to nearest with ties going away from zero), or
* :const:`ROUND_UP` (away from zero).
- * :const:`ROUND_05UP` (away from zero if last digit after rounding towards zero
+ * :const:`ROUND_05UP` (away from zero if last digit after rounding towards zero
would have been 0 or 5; otherwise towards zero)
The *traps* and *flags* fields list any signals to be set. Generally, new
@@ -1313,7 +1313,7 @@ In addition to the three supplied contexts, new contexts can be created with the
that would be obtained by computing ``(x**y) % modulo`` with unbounded
precision, but is computed more efficiently. It is always exact.
- .. versionchanged:: 2.6
+ .. versionchanged:: 2.6
``y`` may now be nonintegral in ``x**y``.
Stricter requirements for the three-argument version.
@@ -1455,7 +1455,7 @@ condition.
sqrt(-x) and x > 0
0 ** 0
x ** (non-integer)
- x ** Infinity
+ x ** Infinity
.. class:: Overflow
@@ -1558,7 +1558,7 @@ expanding the precision sufficiently to avoid loss of significance:
Decimal('9.51111111')
>>> u + (v + w)
Decimal('9.51111111')
- >>>
+ >>>
>>> u, v, w = Decimal(20000), Decimal(-6), Decimal('6.0000003')
>>> (u*v) + (u*w)
Decimal('0.0060000')
@@ -1697,7 +1697,7 @@ to work with the :class:`Decimal` class::
"""
q = Decimal(10) ** -places # 2 places --> '0.01'
- sign, digits, exp = value.quantize(q).as_tuple()
+ sign, digits, exp = value.quantize(q).as_tuple()
result = []
digits = map(str, digits)
build, next = result.append, digits.pop
@@ -1754,12 +1754,12 @@ to work with the :class:`Decimal` class::
getcontext().prec += 2
i, lasts, s, fact, num = 0, 0, 1, 1, 1
while s != lasts:
- lasts = s
+ lasts = s
i += 1
fact *= i
- num *= x
- s += num / fact
- getcontext().prec -= 2
+ num *= x
+ s += num / fact
+ getcontext().prec -= 2
return +s
def cos(x):
@@ -1776,13 +1776,13 @@ to work with the :class:`Decimal` class::
getcontext().prec += 2
i, lasts, s, fact, num, sign = 0, 0, 1, 1, 1, 1
while s != lasts:
- lasts = s
+ lasts = s
i += 2
fact *= i * (i-1)
num *= x * x
sign *= -1
- s += num / fact * sign
- getcontext().prec -= 2
+ s += num / fact * sign
+ getcontext().prec -= 2
return +s
def sin(x):
@@ -1799,13 +1799,13 @@ to work with the :class:`Decimal` class::
getcontext().prec += 2
i, lasts, s, fact, num, sign = 1, 0, x, 1, x, 1
while s != lasts:
- lasts = s
+ lasts = s
i += 2
fact *= i * (i-1)
num *= x * x
sign *= -1
- s += num / fact * sign
- getcontext().prec -= 2
+ s += num / fact * sign
+ getcontext().prec -= 2
return +s
@@ -1839,7 +1839,7 @@ the :const:`Inexact` trap is set, it is also useful for validation:
>>> Decimal('3.214').quantize(TWOPLACES)
Decimal('3.21')
- >>> # Validate that a number does not exceed two places
+ >>> # Validate that a number does not exceed two places
>>> Decimal('3.21').quantize(TWOPLACES, context=Context(traps=[Inexact]))
Decimal('3.21')
diff --git a/Doc/library/difflib.rst b/Doc/library/difflib.rst
index f19156d..addd813 100644
--- a/Doc/library/difflib.rst
+++ b/Doc/library/difflib.rst
@@ -428,7 +428,7 @@ The :class:`SequenceMatcher` class has this constructor:
.. XXX Explain why a dummy is used!
- .. versionchanged:: 2.5
+ .. versionchanged:: 2.5
The guarantee that adjacent triples always describe non-adjacent blocks
was implemented.
diff --git a/Doc/library/dircache.rst b/Doc/library/dircache.rst
index d5907a6..71a8abe 100644
--- a/Doc/library/dircache.rst
+++ b/Doc/library/dircache.rst
@@ -5,11 +5,11 @@
.. module:: dircache
:synopsis: Return directory listing, with cache mechanism.
:deprecated:
-
+
.. deprecated:: 2.6
The :mod:`dircache` module has been removed in Python 3.0.
-
-
+
+
.. sectionauthor:: Moshe Zadka <moshez@zadka.site.co.il>
diff --git a/Doc/library/dis.rst b/Doc/library/dis.rst
index 909e229..3dd528b 100644
--- a/Doc/library/dis.rst
+++ b/Doc/library/dis.rst
@@ -79,8 +79,8 @@ The :mod:`dis` module defines the following functions and constants:
Detect all offsets in the code object *code* which are jump targets, and
return a list of these offsets.
-
-
+
+
.. data:: opname
Sequence of operation names, indexable using the bytecode.
@@ -770,7 +770,7 @@ the more significant byte last.
opcode finds the keyword parameters first. For each keyword argument, the value
is on top of the key. Below the keyword parameters, the positional parameters
are on the stack, with the right-most parameter on top. Below the parameters,
- the function object to call is on the stack. Pops all function arguments, and
+ the function object to call is on the stack. Pops all function arguments, and
the function itself off the stack, and pushes the return value.
diff --git a/Doc/library/dl.rst b/Doc/library/dl.rst
index ef8eb40..fdda2f9 100644
--- a/Doc/library/dl.rst
+++ b/Doc/library/dl.rst
@@ -6,11 +6,11 @@
:platform: Unix
:synopsis: Call C functions in shared objects.
:deprecated:
-
+
.. deprecated:: 2.6
The :mod:`dl` module has been removed in Python 3.0. Use the :mod:`ctypes`
module instead.
-
+
.. sectionauthor:: Moshe Zadka <moshez@zadka.site.co.il>
The :mod:`dl` module defines an interface to the :cfunc:`dlopen` function, which
@@ -91,9 +91,9 @@ Dl objects, as returned by :func:`open` above, have the following methods:
Return the pointer for the function named *name*, as a number, if it exists in
the referenced shared object, otherwise ``None``. This is useful in code like::
- >>> if a.sym('time'):
+ >>> if a.sym('time'):
... a.call('time')
- ... else:
+ ... else:
... time.time()
(Note that this function will return a non-zero number, as zero is the *NULL*
diff --git a/Doc/library/email.mime.rst b/Doc/library/email.mime.rst
index 5b20944..8a0b01f 100644
--- a/Doc/library/email.mime.rst
+++ b/Doc/library/email.mime.rst
@@ -2,7 +2,7 @@
----------------------------------------------------------
.. module:: email.mime
- :synopsis: Build MIME messages.
+ :synopsis: Build MIME messages.
Ordinarily, you get a message object structure by passing a file or some text to
diff --git a/Doc/library/fileinput.rst b/Doc/library/fileinput.rst
index b3f7e61..269d856 100644
--- a/Doc/library/fileinput.rst
+++ b/Doc/library/fileinput.rst
@@ -151,7 +151,7 @@ it is deleted when the output file is closed. In-place filtering is disabled
when standard input is read.
.. warning::
-
+
The current implementation does not work for MS-DOS 8+3 filesystems.
diff --git a/Doc/library/fl.rst b/Doc/library/fl.rst
index 02b13ff..a5a426a 100644
--- a/Doc/library/fl.rst
+++ b/Doc/library/fl.rst
@@ -6,8 +6,8 @@
:platform: IRIX
:synopsis: FORMS library for applications with graphical user interfaces.
:deprecated:
-
-
+
+
.. deprecated:: 2.6
The :mod:`fl` module has been deprecated for removal in Python 3.0.
@@ -484,8 +484,8 @@ FORMS objects have these data attributes; see the FORMS documentation:
:platform: IRIX
:synopsis: Constants used with the fl module.
:deprecated:
-
-
+
+
.. deprecated:: 2.6
The :mod:`FL` module has been deprecated for removal in Python 3.0.
@@ -506,8 +506,8 @@ source for a complete list of the defined names. Suggested use::
:platform: IRIX
:synopsis: Functions for loading stored FORMS designs.
:deprecated:
-
-
+
+
.. deprecated:: 2.6
The :mod:`flp` module has been deprecated for removal in Python 3.0.
diff --git a/Doc/library/fm.rst b/Doc/library/fm.rst
index 438135a..e46506b 100644
--- a/Doc/library/fm.rst
+++ b/Doc/library/fm.rst
@@ -6,7 +6,7 @@
:platform: IRIX
:synopsis: Font Manager interface for SGI workstations.
:deprecated:
-
+
.. deprecated:: 2.6
The :mod:`fm` module has been deprecated for removal in Python 3.0.
diff --git a/Doc/library/fpformat.rst b/Doc/library/fpformat.rst
index 29b29f4..3448585 100644
--- a/Doc/library/fpformat.rst
+++ b/Doc/library/fpformat.rst
@@ -5,10 +5,10 @@
.. module:: fpformat
:synopsis: General floating point formatting functions.
:deprecated:
-
+
.. deprecated:: 2.6
The :mod:`fpformat` module has been removed in Python 3.0.
-
+
.. sectionauthor:: Moshe Zadka <moshez@zadka.site.co.il>
diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst
index 9b408dc..0977c91 100644
--- a/Doc/library/functions.rst
+++ b/Doc/library/functions.rst
@@ -888,7 +888,7 @@ available. They are listed here in alphabetical order.
.. versionchanged:: 2.5
Use *fget*'s docstring if no *doc* given.
- .. versionchanged:: 2.6
+ .. versionchanged:: 2.6
The ``getter``, ``setter``, and ``deleter`` attributes were added.
@@ -1178,10 +1178,10 @@ available. They are listed here in alphabetical order.
single inheritance, "super" can be used to refer to parent classes without
naming them explicitly, thus making the code more maintainable. This use
closely parallels the use of "super" in other programming languages.
-
+
The second use case is to support cooperative multiple inheritence in a
- dynamic execution environment. This use case is unique to Python and is
- not found in statically compiled languages or languages that only support
+ dynamic execution environment. This use case is unique to Python and is
+ not found in statically compiled languages or languages that only support
single inheritance. This makes in possible to implement "diamond diagrams"
where multiple base classes implement the same method. Good design dictates
that this method have the same calling signature in every case (because the
@@ -1242,7 +1242,7 @@ available. They are listed here in alphabetical order.
>>> class X(object):
... a = 1
- ...
+ ...
>>> X = type('X', (object,), dict(a=1))
.. versionadded:: 2.2
@@ -1397,7 +1397,7 @@ available. They are listed here in alphabetical order.
For example, the statement ``import spam`` results in bytecode resembling the
following code::
-
+
spam = __import__('spam', globals(), locals(), [], -1)
The statement ``import spam.ham`` results in this call::
diff --git a/Doc/library/gl.rst b/Doc/library/gl.rst
index 0afb1c8..cbc175a 100644
--- a/Doc/library/gl.rst
+++ b/Doc/library/gl.rst
@@ -6,8 +6,8 @@
:platform: IRIX
:synopsis: Functions from the Silicon Graphics Graphics Library.
:deprecated:
-
-
+
+
.. deprecated:: 2.6
The :mod:`gl` module has been deprecated for removal in Python 3.0.
@@ -166,8 +166,8 @@ Here is a tiny but complete example GL program in Python::
:platform: IRIX
:synopsis: Constants used with the gl module.
:deprecated:
-
-
+
+
.. deprecated:: 2.6
The :mod:`DEVICE` module has been deprecated for removal in Python 3.0.
@@ -184,8 +184,8 @@ module source file for details.
:platform: IRIX
:synopsis: Constants used with the gl module.
:deprecated:
-
-
+
+
.. deprecated:: 2.6
The :mod:`GL` module has been deprecated for removal in Python 3.0.
diff --git a/Doc/library/heapq.rst b/Doc/library/heapq.rst
index 2190b80..bf7e3c4 100644
--- a/Doc/library/heapq.rst
+++ b/Doc/library/heapq.rst
@@ -102,7 +102,7 @@ Using a heap to insert items at the correct place in a priority queue:
H
N
-
+
The module also offers three general purpose functions based on heaps.
diff --git a/Doc/library/htmllib.rst b/Doc/library/htmllib.rst
index 0fa518e..f6ed564 100644
--- a/Doc/library/htmllib.rst
+++ b/Doc/library/htmllib.rst
@@ -4,7 +4,7 @@
.. module:: htmllib
:synopsis: A parser for HTML documents.
:deprecated:
-
+
.. deprecated:: 2.6
The :mod:`htmllib` module has been removed in Python 3.0.
diff --git a/Doc/library/idle.rst b/Doc/library/idle.rst
index 65101fc..413750f 100644
--- a/Doc/library/idle.rst
+++ b/Doc/library/idle.rst
@@ -230,7 +230,7 @@ Python syntax colors:
Keywords
orange
- Strings
+ Strings
green
Comments
diff --git a/Doc/library/imageop.rst b/Doc/library/imageop.rst
index 758d23c..ceef0c7 100644
--- a/Doc/library/imageop.rst
+++ b/Doc/library/imageop.rst
@@ -5,7 +5,7 @@
.. module:: imageop
:synopsis: Manipulate raw image data.
:deprecated:
-
+
.. deprecated:: 2.6
The :mod:`imageop` module has been removed in Python 3.0.
diff --git a/Doc/library/imgfile.rst b/Doc/library/imgfile.rst
index 9785453..84ede95 100644
--- a/Doc/library/imgfile.rst
+++ b/Doc/library/imgfile.rst
@@ -6,7 +6,7 @@
:platform: IRIX
:synopsis: Support for SGI imglib files.
:deprecated:
-
+
.. deprecated:: 2.6
The :mod:`imgfile` module has been deprecated for removal in Python 3.0.
diff --git a/Doc/library/io.rst b/Doc/library/io.rst
index 25d5f16..86407be 100644
--- a/Doc/library/io.rst
+++ b/Doc/library/io.rst
@@ -215,7 +215,7 @@ I/O Base Classes
.. method:: close()
Flush and close this stream. This method has no effect if the file is
- already closed. Once the file is closed, any operation on the file
+ already closed. Once the file is closed, any operation on the file
(e.g. reading or writing) will raise an :exc:`IOError`. The internal
file descriptor isn't closed if *closefd* was False.
@@ -629,7 +629,7 @@ Text I/O
.. attribute:: line_buffering
Whether line buffering is enabled.
-
+
.. class:: StringIO([initial_value[, encoding[, errors[, newline]]]])
diff --git a/Doc/library/itertools.rst b/Doc/library/itertools.rst
index 2bd18d0..67646c6 100644
--- a/Doc/library/itertools.rst
+++ b/Doc/library/itertools.rst
@@ -76,7 +76,7 @@ loops that truncate the stream.
.. function:: itertools.chain.from_iterable(iterable)
- Alternate constructor for :func:`chain`. Gets chained inputs from a
+ Alternate constructor for :func:`chain`. Gets chained inputs from a
single iterable argument that is evaluated lazily. Equivalent to::
@classmethod
@@ -93,9 +93,9 @@ loops that truncate the stream.
Return *r* length subsequences of elements from the input *iterable*.
- Combinations are emitted in lexicographic sort order. So, if the
+ Combinations are emitted in lexicographic sort order. So, if the
input *iterable* is sorted, the combination tuples will be produced
- in sorted order.
+ in sorted order.
Elements are treated as unique based on their position, not on their
value. So if the input elements are unique, there will be no repeat
@@ -314,7 +314,7 @@ loops that truncate the stream.
for i, element in enumerate(iterable):
if i == nexti:
yield element
- nexti = it.next()
+ nexti = it.next()
If *start* is ``None``, then iteration starts at zero. If *step* is ``None``,
then the step defaults to one.
@@ -380,12 +380,12 @@ loops that truncate the stream.
Return successive *r* length permutations of elements in the *iterable*.
If *r* is not specified or is ``None``, then *r* defaults to the length
- of the *iterable* and all possible full-length permutations
+ of the *iterable* and all possible full-length permutations
are generated.
- Permutations are emitted in lexicographic sort order. So, if the
+ Permutations are emitted in lexicographic sort order. So, if the
input *iterable* is sorted, the permutation tuples will be produced
- in sorted order.
+ in sorted order.
Elements are treated as unique based on their position, not on their
value. So if the input elements are unique, there will be no repeat
@@ -416,7 +416,7 @@ loops that truncate the stream.
else:
return
- The code for :func:`permutations` can be also expressed as a subsequence of
+ The code for :func:`permutations` can be also expressed as a subsequence of
:func:`product`, filtered to exclude entries with repeated elements (those
from the same position in the input pool)::
@@ -564,7 +564,7 @@ can be combined.
>>> data = [ 1, 4,5,6, 10, 15,16,17,18, 22, 25,26,27,28]
>>> for k, g in groupby(enumerate(data), lambda (i,x):i-x):
... print map(itemgetter(1), g)
- ...
+ ...
[1]
[4, 5, 6]
[10]
@@ -691,7 +691,7 @@ which incur interpreter overhead.
def unique_everseen(iterable, key=None):
"List unique elements, preserving order. Remember all elements ever seen."
# unique_everseen('AAAABBBCCDAABBB') --> A B C D
- # unique_everseen('ABBCcAD', str.lower) --> A B C D
+ # unique_everseen('ABBCcAD', str.lower) --> A B C D
seen = set()
seen_add = seen.add
if key is None:
diff --git a/Doc/library/jpeg.rst b/Doc/library/jpeg.rst
index 5cc649f..98497ad 100644
--- a/Doc/library/jpeg.rst
+++ b/Doc/library/jpeg.rst
@@ -6,7 +6,7 @@
:platform: IRIX
:synopsis: Read and write image files in compressed JPEG format.
:deprecated:
-
+
.. deprecated:: 2.6
The :mod:`jpeg` module has been deprecated for removal in Python 3.0.
diff --git a/Doc/library/json.rst b/Doc/library/json.rst
index 5fb8498..8a644af 100644
--- a/Doc/library/json.rst
+++ b/Doc/library/json.rst
@@ -14,7 +14,7 @@ syntax (ECMA-262 3rd edition) used as a lightweight data interchange format.
:mod:`marshal` and :mod:`pickle` modules.
Encoding basic Python object hierarchies::
-
+
>>> import json
>>> json.dumps(['foo', {'bar': ('baz', None, 1.0, 2)}])
'["foo", {"bar": ["baz", null, 1.0, 2]}]'
@@ -43,12 +43,12 @@ Pretty printing::
>>> import json
>>> print json.dumps({'4': 5, '6': 7}, sort_keys=True, indent=4)
{
- "4": 5,
+ "4": 5,
"6": 7
}
Decoding JSON::
-
+
>>> import json
>>> json.loads('["foo", {"bar":["baz", null, 1.0, 2]}]')
[u'foo', {u'bar': [u'baz', None, 1.0, 2]}]
@@ -66,7 +66,7 @@ Specializing JSON object decoding::
... if '__complex__' in dct:
... return complex(dct['real'], dct['imag'])
... return dct
- ...
+ ...
>>> json.loads('{"__complex__": true, "real": 1, "imag": 2}',
... object_hook=as_complex)
(1+2j)
@@ -75,26 +75,26 @@ Specializing JSON object decoding::
Decimal('1.1')
Extending :class:`JSONEncoder`::
-
+
>>> import json
>>> class ComplexEncoder(json.JSONEncoder):
... def default(self, obj):
... if isinstance(obj, complex):
... return [obj.real, obj.imag]
... return json.JSONEncoder.default(self, obj)
- ...
+ ...
>>> dumps(2 + 1j, cls=ComplexEncoder)
'[2.0, 1.0]'
>>> ComplexEncoder().encode(2 + 1j)
'[2.0, 1.0]'
>>> list(ComplexEncoder().iterencode(2 + 1j))
['[', '2.0', ', ', '1.0', ']']
-
+
.. highlight:: none
Using json.tool from the shell to validate and pretty-print::
-
+
$ echo '{"json":"obj"}' | python -mjson.tool
{
"json": "obj"
@@ -104,7 +104,7 @@ Using json.tool from the shell to validate and pretty-print::
.. highlight:: python
-.. note::
+.. note::
The JSON produced by this module's default settings is a subset of
YAML, so it may be used as a serializer for that as well.
@@ -368,7 +368,7 @@ Encoders and decoders
For example, to support arbitrary iterators, you could implement default
like this::
-
+
def default(self, o):
try:
iterable = iter(o)
@@ -392,6 +392,6 @@ Encoders and decoders
Encode the given object, *o*, and yield each string representation as
available. For example::
-
+
for chunk in JSONEncoder().iterencode(bigobject):
mysocket.write(chunk)
diff --git a/Doc/library/locale.rst b/Doc/library/locale.rst
index 3dfefa2..750fb2e 100644
--- a/Doc/library/locale.rst
+++ b/Doc/library/locale.rst
@@ -494,7 +494,7 @@ Example::
>>> import locale
>>> loc = locale.getlocale() # get current locale
>>> locale.setlocale(locale.LC_ALL, 'de_DE') # use German locale; name might vary with platform
- >>> locale.strcoll('f\xe4n', 'foo') # compare a string containing an umlaut
+ >>> locale.strcoll('f\xe4n', 'foo') # compare a string containing an umlaut
>>> locale.setlocale(locale.LC_ALL, '') # use user's preferred locale
>>> locale.setlocale(locale.LC_ALL, 'C') # use default (C) locale
>>> locale.setlocale(locale.LC_ALL, loc) # restore saved locale
diff --git a/Doc/library/macos.rst b/Doc/library/macos.rst
index 7376de1..526fb3c 100644
--- a/Doc/library/macos.rst
+++ b/Doc/library/macos.rst
@@ -82,7 +82,7 @@ Note the capitalization of the module name; this is a historical artifact.
parameter can be a pathname or an ``FSSpec`` or ``FSRef`` object.
.. note::
-
+
It is not possible to use an ``FSSpec`` in 64-bit mode.
@@ -93,7 +93,7 @@ Note the capitalization of the module name; this is a historical artifact.
strings.
.. note::
-
+
It is not possible to use an ``FSSpec`` in 64-bit mode.
.. function:: openrf(name [, mode])
diff --git a/Doc/library/mailbox.rst b/Doc/library/mailbox.rst
index 0a8c6df..01d3f4b 100644
--- a/Doc/library/mailbox.rst
+++ b/Doc/library/mailbox.rst
@@ -1686,7 +1686,7 @@ due to malformed messages in the mailbox::
# that's better than losing a message completely.
box.lock()
box.add(message)
- box.flush()
+ box.flush()
box.unlock()
# Remove original message
diff --git a/Doc/library/marshal.rst b/Doc/library/marshal.rst
index 4f5b16a..a9d6ea8 100644
--- a/Doc/library/marshal.rst
+++ b/Doc/library/marshal.rst
@@ -45,7 +45,7 @@ themselves supported; and recursive lists and dictionaries should not be written
(they will cause infinite loops).
.. warning::
-
+
On machines where C's ``long int`` type has more than 32 bits (such as the
DEC Alpha), it is possible to create plain Python integers that are longer
than 32 bits. If such an integer is marshaled and read back in on a machine
diff --git a/Doc/library/math.rst b/Doc/library/math.rst
index 39fde82..b33c597 100644
--- a/Doc/library/math.rst
+++ b/Doc/library/math.rst
@@ -109,7 +109,7 @@ Number-theoretic and representation functions
.. function:: isnan(x)
Checks if the float *x* is a NaN (not a number). NaNs are part of the
- IEEE 754 standards. Operation like but not limited to ``inf * 0``,
+ IEEE 754 standards. Operation like but not limited to ``inf * 0``,
``inf / inf`` or any operation involving a NaN, e.g. ``nan * 1``, return
a NaN.
diff --git a/Doc/library/mhlib.rst b/Doc/library/mhlib.rst
index 2a6a2db..2aab1dc 100644
--- a/Doc/library/mhlib.rst
+++ b/Doc/library/mhlib.rst
@@ -4,7 +4,7 @@
.. module:: mhlib
:synopsis: Manipulate MH mailboxes from Python.
:deprecated:
-
+
.. deprecated:: 2.6
The :mod:`mhlib` module has been removed in Python 3.0. Use the
:mod:`mailbox` instead.
diff --git a/Doc/library/mmap.rst b/Doc/library/mmap.rst
index 8b4685c..09ec73b 100644
--- a/Doc/library/mmap.rst
+++ b/Doc/library/mmap.rst
@@ -93,7 +93,7 @@ memory but does not update the underlying file.
will be relative to the offset from the beginning of the file. *offset*
defaults to 0. *offset* must be a multiple of the PAGESIZE or
ALLOCATIONGRANULARITY.
-
+
This example shows a simple way of using :class:`mmap`::
import mmap
diff --git a/Doc/library/msvcrt.rst b/Doc/library/msvcrt.rst
index 47d63b5..4537be8 100644
--- a/Doc/library/msvcrt.rst
+++ b/Doc/library/msvcrt.rst
@@ -18,7 +18,7 @@ documentation.
The module implements both the normal and wide char variants of the console I/O
api. The normal API deals only with ASCII characters and is of limited use
-for internationalized applications. The wide char API should be used where
+for internationalized applications. The wide char API should be used where
ever possible
.. _msvcrt-files:
@@ -98,13 +98,13 @@ Console I/O
return the keycode. The :kbd:`Control-C` keypress cannot be read with this
function.
-
+
.. function:: getwch()
Wide char variant of :func:`getch`, returning a Unicode value.
-
+
.. versionadded:: 2.6
-
+
.. function:: getche()
@@ -115,7 +115,7 @@ Console I/O
.. function:: getwche()
Wide char variant of :func:`getche`, returning a Unicode value.
-
+
.. versionadded:: 2.6
@@ -123,24 +123,24 @@ Console I/O
Print the character *char* to the console without buffering.
-
+
.. function:: putwch(unicode_char)
Wide char variant of :func:`putch`, accepting a Unicode value.
-
+
.. versionadded:: 2.6
-
+
.. function:: ungetch(char)
Cause the character *char* to be "pushed back" into the console buffer; it will
be the next character read by :func:`getch` or :func:`getche`.
-
+
.. function:: ungetwch(unicode_char)
Wide char variant of :func:`ungetch`, accepting a Unicode value.
-
+
.. versionadded:: 2.6
diff --git a/Doc/library/multiprocessing.rst b/Doc/library/multiprocessing.rst
index 1d95999..ec27be0 100644
--- a/Doc/library/multiprocessing.rst
+++ b/Doc/library/multiprocessing.rst
@@ -21,9 +21,9 @@ Windows.
.. warning::
Some of this package's functionality requires a functioning shared semaphore
- implementation on the host operating system. Without one, the
- :mod:`multiprocessing.synchronize` module will be disabled, and attempts to
- import it will result in an :exc:`ImportError`. See
+ implementation on the host operating system. Without one, the
+ :mod:`multiprocessing.synchronize` module will be disabled, and attempts to
+ import it will result in an :exc:`ImportError`. See
:issue:`3770` for additional information.
.. note::
@@ -38,7 +38,7 @@ Windows.
>>> p = Pool(5)
>>> def f(x):
... return x*x
- ...
+ ...
>>> p.map(f, [1,2,3])
Process PoolWorker-1:
Process PoolWorker-2:
@@ -77,11 +77,11 @@ To show the individual process IDs involved, here is an expanded example::
print 'module name:', __name__
print 'parent process:', os.getppid()
print 'process id:', os.getpid()
-
+
def f(name):
info('function f')
print 'hello', name
-
+
if __name__ == '__main__':
info('main line')
p = Process(target=f, args=('bob',))
@@ -543,7 +543,7 @@ For an example of the usage of queues for interprocess communication see
.. method:: put(item[, block[, timeout]])
- Put item into the queue. If the optional argument *block* is ``True``
+ Put item into the queue. If the optional argument *block* is ``True``
(the default) and *timeout* is ``None`` (the default), block if necessary until
a free slot is available. If *timeout* is a positive number, it blocks at
most *timeout* seconds and raises the :exc:`Queue.Full` exception if no
@@ -858,7 +858,7 @@ object -- see :ref:`multiprocessing-managers`.
acceptable. If *block* is ``True`` and *timeout* is not ``None`` then it
specifies a timeout in seconds. If *block* is ``False`` then *timeout* is
ignored.
-
+
Note that on OS/X ``sem_timedwait`` is unsupported, so timeout arguments
for these will be ignored.
@@ -1135,22 +1135,22 @@ their parent process exits. The manager classes are defined in the
server process which is using the given address and authentication key.
.. method:: get_server()
-
+
Returns a :class:`Server` object which represents the actual server under
- the control of the Manager. The :class:`Server` object supports the
+ the control of the Manager. The :class:`Server` object supports the
:meth:`serve_forever` method:
-
+
>>> from multiprocessing.managers import BaseManager
>>> m = BaseManager(address=('', 50000), authkey='abc'))
>>> server = m.get_server()
>>> s.serve_forever()
-
+
:class:`Server` additionally have an :attr:`address` attribute.
.. method:: connect()
-
+
Connect a local manager object to a remote manager process:
-
+
>>> from multiprocessing.managers import BaseManager
>>> m = BaseManager(address='127.0.0.1', authkey='abc))
>>> m.connect()
@@ -1360,7 +1360,7 @@ Another client can also use it::
>>> queue.get()
'hello'
-Local processes can also access that queue, using the code from above on the
+Local processes can also access that queue, using the code from above on the
client to access it remotely::
>>> from multiprocessing import Process, Queue
@@ -1371,12 +1371,12 @@ client to access it remotely::
... super(Worker, self).__init__()
... def run(self):
... self.q.put('local hello')
- ...
+ ...
>>> queue = Queue()
>>> w = Worker(queue)
>>> w.start()
>>> class QueueManager(BaseManager): pass
- ...
+ ...
>>> QueueManager.register('get_queue', callable=lambda: queue)
>>> m = QueueManager(address=('', 50000), authkey='abracadabra')
>>> s = m.get_server()
@@ -2120,7 +2120,7 @@ Some simple benchmarks comparing :mod:`multiprocessing` with :mod:`threading`:
.. literalinclude:: ../includes/mp_benchmarks.py
An example/demo of how to use the :class:`managers.SyncManager`, :class:`Process`
-and others to build a system which can distribute processes and work via a
+and others to build a system which can distribute processes and work via a
distributed queue to a "cluster" of machines on a network, accessible via SSH.
You will need to have private key authentication for all hosts configured for
this to work.
diff --git a/Doc/library/mutex.rst b/Doc/library/mutex.rst
index 480c888..53656c3 100644
--- a/Doc/library/mutex.rst
+++ b/Doc/library/mutex.rst
@@ -5,7 +5,7 @@
.. module:: mutex
:synopsis: Lock and queue for mutual exclusion.
:deprecated:
-
+
.. deprecated::
The :mod:`mutex` module has been removed in Python 3.0.
diff --git a/Doc/library/nntplib.rst b/Doc/library/nntplib.rst
index fdbf2a3..6c16a43 100644
--- a/Doc/library/nntplib.rst
+++ b/Doc/library/nntplib.rst
@@ -24,16 +24,16 @@ about a newsgroup and print the subjects of the last 10 articles::
Group comp.lang.python has 59 articles, range 3742 to 3803
>>> resp, subs = s.xhdr('subject', first + '-' + last)
>>> for id, sub in subs[-10:]: print id, sub
- ...
+ ...
3792 Re: Removing elements from a list while iterating...
3793 Re: Who likes Info files?
3794 Emacs and doc strings
3795 a few questions about the Mac implementation
3796 Re: executable python scripts
3797 Re: executable python scripts
- 3798 Re: a few questions about the Mac implementation
+ 3798 Re: a few questions about the Mac implementation
3799 Re: PROPOSAL: A Generic Python Object Interface for Python C Modules
- 3802 Re: executable python scripts
+ 3802 Re: executable python scripts
3803 Re: \POSIX{} wait and SIGCHLD
>>> s.quit()
'205 news.cwi.nl closing connection. Goodbye.'
diff --git a/Doc/library/operator.rst b/Doc/library/operator.rst
index 2ab54db..dc7ad37 100644
--- a/Doc/library/operator.rst
+++ b/Doc/library/operator.rst
@@ -7,7 +7,7 @@
.. testsetup::
-
+
import operator
from operator import itemgetter
@@ -437,7 +437,7 @@ objects.
>>> class C:
... pass
- ...
+ ...
>>> import operator
>>> obj = C()
>>> operator.isMappingType(obj)
@@ -547,9 +547,9 @@ expect a function argument.
def g(obj):
return tuple(obj[item] for item in items)
return g
-
- The items can be any type accepted by the operand's :meth:`__getitem__`
- method. Dictionaries accept any hashable value. Lists, tuples, and
+
+ The items can be any type accepted by the operand's :meth:`__getitem__`
+ method. Dictionaries accept any hashable value. Lists, tuples, and
strings accept an index or a slice:
>>> itemgetter(1)('ABCDEFG')
diff --git a/Doc/library/optparse.rst b/Doc/library/optparse.rst
index fbc2de2..e201d22 100644
--- a/Doc/library/optparse.rst
+++ b/Doc/library/optparse.rst
@@ -799,7 +799,7 @@ And to define an option with only a long option string::
The keyword arguments define attributes of the new Option object. The most
important option attribute is :attr:`action`, and it largely determines which
other attributes are relevant or required. If you pass irrelevant option
-attributes, or fail to pass required ones, :mod:`optparse` raises an
+attributes, or fail to pass required ones, :mod:`optparse` raises an
:exc:`OptionError` exception explaining your mistake.
An option's *action* determines what :mod:`optparse` does when it encounters
diff --git a/Doc/library/os.rst b/Doc/library/os.rst
index 8111fa3..74fca8a 100644
--- a/Doc/library/os.rst
+++ b/Doc/library/os.rst
@@ -368,7 +368,7 @@ These functions create new file objects. (See also :func:`open`.)
is returned. Availability: Unix, Windows.
.. deprecated:: 2.6
- This function is obsolete. Use the :mod:`subprocess` module. Check
+ This function is obsolete. Use the :mod:`subprocess` module. Check
especially the :ref:`subprocess-replacements` section.
.. versionchanged:: 2.0
@@ -418,7 +418,7 @@ functions, see :ref:`popen2-flow-control`.
child_stdout)``.
.. deprecated:: 2.6
- This function is obsolete. Use the :mod:`subprocess` module. Check
+ This function is obsolete. Use the :mod:`subprocess` module. Check
especially the :ref:`subprocess-replacements` section.
Availability: Unix, Windows.
@@ -432,7 +432,7 @@ functions, see :ref:`popen2-flow-control`.
child_stdout, child_stderr)``.
.. deprecated:: 2.6
- This function is obsolete. Use the :mod:`subprocess` module. Check
+ This function is obsolete. Use the :mod:`subprocess` module. Check
especially the :ref:`subprocess-replacements` section.
Availability: Unix, Windows.
@@ -446,7 +446,7 @@ functions, see :ref:`popen2-flow-control`.
child_stdout_and_stderr)``.
.. deprecated:: 2.6
- This function is obsolete. Use the :mod:`subprocess` module. Check
+ This function is obsolete. Use the :mod:`subprocess` module. Check
especially the :ref:`subprocess-replacements` section.
Availability: Unix, Windows.
@@ -1449,7 +1449,7 @@ to be ignored.
These functions all execute a new program, replacing the current process; they
do not return. On Unix, the new executable is loaded into the current process,
and will have the same process id as the caller. Errors will be reported as
- :exc:`OSError` exceptions.
+ :exc:`OSError` exceptions.
The current process is replaced immediately. Open file objects and
descriptors are not flushed, so if there may be data buffered
@@ -1481,7 +1481,7 @@ to be ignored.
used to define the environment variables for the new process (these are used
instead of the current process' environment); the functions :func:`execl`,
:func:`execlp`, :func:`execv`, and :func:`execvp` all cause the new process to
- inherit the environment of the current process.
+ inherit the environment of the current process.
Availability: Unix, Windows.
@@ -1718,7 +1718,7 @@ written in Python, such as a mail server's external command delivery program.
(Note that the :mod:`subprocess` module provides more powerful facilities for
spawning new processes and retrieving their results; using that module is
- preferable to using these functions. Check specially the *Replacing Older
+ preferable to using these functions. Check specially the *Replacing Older
Functions with the subprocess Module* section in that documentation page.)
If *mode* is :const:`P_NOWAIT`, this function returns the process id of the new
diff --git a/Doc/library/ossaudiodev.rst b/Doc/library/ossaudiodev.rst
index e4ece4d..d8ff3f2 100644
--- a/Doc/library/ossaudiodev.rst
+++ b/Doc/library/ossaudiodev.rst
@@ -18,26 +18,26 @@ the standard audio interface for Linux and recent versions of FreeBSD.
use ALSA, you'll have to make sure its OSS compatibility layer
is active to use ossaudiodev, but you're gonna need it for the vast
majority of Linux audio apps anyways.
-
+
Sounds like things are also complicated for other BSDs. In response
to my python-dev query, Thomas Wouters said:
-
+
> Likewise, googling shows OpenBSD also uses OSS/Free -- the commercial
> OSS installation manual tells you to remove references to OSS/Free from the
> kernel :)
-
+
but Aleksander Piotrowsk actually has an OpenBSD box, and he quotes
from its <soundcard.h>:
> * WARNING! WARNING!
> * This is an OSS (Linux) audio emulator.
> * Use the Native NetBSD API for developing new code, and this
> * only for compiling Linux programs.
-
+
There's also an ossaudio manpage on OpenBSD that explains things
further. Presumably NetBSD and OpenBSD have a different standard
audio interface. That's the great thing about standards, there are so
many to choose from ... ;-)
-
+
This probably all warrants a footnote or two, but I don't understand
things well enough right now to write it! --GPW
diff --git a/Doc/library/othergui.rst b/Doc/library/othergui.rst
index 2d4ea37..9821173 100644
--- a/Doc/library/othergui.rst
+++ b/Doc/library/othergui.rst
@@ -70,7 +70,7 @@ also available for Python:
Robin Dunn.
PyGTK, PyQt, and wxPython, all have a modern look and feel and more
-widgets than Tkinter. In addition, there are many other GUI toolkits for
+widgets than Tkinter. In addition, there are many other GUI toolkits for
Python, both cross-platform, and platform-specific. See the `GUI Programming
<http://wiki.python.org/moin/GuiProgramming>`_ page in the Python Wiki for a
much more complete list, and also for links to documents where the
diff --git a/Doc/library/pdb.rst b/Doc/library/pdb.rst
index 384c7d9..700146b 100644
--- a/Doc/library/pdb.rst
+++ b/Doc/library/pdb.rst
@@ -37,7 +37,7 @@ of the debugger is::
(Pdb) continue
NameError: 'spam'
> <string>(1)?()
- (Pdb)
+ (Pdb)
:file:`pdb.py` can also be invoked as a script to debug other scripts. For
example::
@@ -68,7 +68,7 @@ Typical usage to inspect a crashed program is::
>>> pdb.pm()
> ./mymodule.py(3)test2()
-> print spam
- (Pdb)
+ (Pdb)
The module defines the following functions; each enters the debugger in a
slightly different way:
@@ -109,7 +109,7 @@ slightly different way:
.. function:: post_mortem([traceback])
- Enter post-mortem debugging of the given *traceback* object. If no
+ Enter post-mortem debugging of the given *traceback* object. If no
*traceback* is given, it uses the one of the exception that is currently
being handled (an exception must be being handled if the default is to be
used).
diff --git a/Doc/library/pickle.rst b/Doc/library/pickle.rst
index cc3c036..a99dc86 100644
--- a/Doc/library/pickle.rst
+++ b/Doc/library/pickle.rst
@@ -413,7 +413,7 @@ Pickling and unpickling normal class instances
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. method:: object.__getinitargs__()
-
+
When a pickled class instance is unpickled, its :meth:`__init__` method is
normally *not* invoked. If it is desirable that the :meth:`__init__` method
be called on unpickling, an old-style class can define a method
@@ -430,31 +430,31 @@ Pickling and unpickling normal class instances
is affected by the values passed to the :meth:`__new__` method for the type
(as it is for tuples and strings). Instances of a :term:`new-style class`
``C`` are created using ::
-
+
obj = C.__new__(C, *args)
-
+
where *args* is the result of calling :meth:`__getnewargs__` on the original
object; if there is no :meth:`__getnewargs__`, an empty tuple is assumed.
.. method:: object.__getstate__()
-
+
Classes can further influence how their instances are pickled; if the class
defines the method :meth:`__getstate__`, it is called and the return state is
pickled as the contents for the instance, instead of the contents of the
instance's dictionary. If there is no :meth:`__getstate__` method, the
instance's :attr:`__dict__` is pickled.
-.. method:: object.__setstate__()
-
+.. method:: object.__setstate__()
+
Upon unpickling, if the class also defines the method :meth:`__setstate__`,
it is called with the unpickled state. [#]_ If there is no
:meth:`__setstate__` method, the pickled state must be a dictionary and its
items are assigned to the new instance's dictionary. If a class defines both
:meth:`__getstate__` and :meth:`__setstate__`, the state object needn't be a
dictionary and these methods can do what they want. [#]_
-
+
.. warning::
-
+
For :term:`new-style class`\es, if :meth:`__getstate__` returns a false
value, the :meth:`__setstate__` method will not be called.
@@ -463,7 +463,7 @@ Pickling and unpickling extension types
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. method:: object.__reduce__()
-
+
When the :class:`Pickler` encounters an object of a type it knows nothing
about --- such as an extension type --- it looks in two places for a hint of
how to pickle it. One alternative is for the object to implement a
@@ -518,7 +518,7 @@ Pickling and unpickling extension types
is primarily used for dictionary subclasses, but may be used by other
classes as long as they implement :meth:`__setitem__`.
-.. method:: object.__reduce_ex__(protocol)
+.. method:: object.__reduce_ex__(protocol)
It is sometimes useful to know the protocol version when implementing
:meth:`__reduce__`. This can be done by implementing a method named
diff --git a/Doc/library/popen2.rst b/Doc/library/popen2.rst
index a18b571..4646dd9 100644
--- a/Doc/library/popen2.rst
+++ b/Doc/library/popen2.rst
@@ -9,7 +9,7 @@
.. deprecated:: 2.6
- This module is obsolete. Use the :mod:`subprocess` module. Check
+ This module is obsolete. Use the :mod:`subprocess` module. Check
especially the :ref:`subprocess-replacements` section.
This module allows you to spawn processes and connect to their
diff --git a/Doc/library/profile.rst b/Doc/library/profile.rst
index 4c0ba15..4d71437 100644
--- a/Doc/library/profile.rst
+++ b/Doc/library/profile.rst
@@ -51,17 +51,17 @@ examine the results of a profile operation.
The Python standard library provides three different profilers:
-#. :mod:`cProfile` is recommended for most users; it's a C extension
+#. :mod:`cProfile` is recommended for most users; it's a C extension
with reasonable overhead
- that makes it suitable for profiling long-running programs.
+ that makes it suitable for profiling long-running programs.
Based on :mod:`lsprof`,
- contributed by Brett Rosen and Ted Czotter.
+ contributed by Brett Rosen and Ted Czotter.
.. versionadded:: 2.5
#. :mod:`profile`, a pure Python module whose interface is imitated by
- :mod:`cProfile`. Adds significant overhead to profiled programs.
- If you're trying to extend
+ :mod:`cProfile`. Adds significant overhead to profiled programs.
+ If you're trying to extend
the profiler in some way, the task might be easier with this module.
Copyright © 1994, by InfoSeek Corporation.
@@ -72,7 +72,7 @@ The Python standard library provides three different profilers:
the overhead of profiling, at the expense of longer data
post-processing times. It is no longer maintained and may be
dropped in a future version of Python.
-
+
.. versionchanged:: 2.5
The results should be more meaningful than in the past: the timing core
@@ -276,24 +276,24 @@ reading the source code for these modules.
that the text string in the far right column was used to sort the output. The
column headings include:
- ncalls
+ ncalls
for the number of calls,
- tottime
+ tottime
for the total time spent in the given function (and excluding time made in calls
to sub-functions),
- percall
+ percall
is the quotient of ``tottime`` divided by ``ncalls``
- cumtime
+ cumtime
is the total time spent in this and all subfunctions (from invocation till
exit). This figure is accurate *even* for recursive functions.
- percall
+ percall
is the quotient of ``cumtime`` divided by primitive calls
- filename:lineno(function)
+ filename:lineno(function)
provides the respective data of each function
When there are two numbers in the first column (for example, ``43/3``), then the
diff --git a/Doc/library/pyexpat.rst b/Doc/library/pyexpat.rst
index 1d5e6e6..04179a4 100644
--- a/Doc/library/pyexpat.rst
+++ b/Doc/library/pyexpat.rst
@@ -182,9 +182,9 @@ XMLParser Objects
.. attribute:: xmlparser.buffer_size
- The size of the buffer used when :attr:`buffer_text` is true.
- A new buffer size can be set by assigning a new integer value
- to this attribute.
+ The size of the buffer used when :attr:`buffer_text` is true.
+ A new buffer size can be set by assigning a new integer value
+ to this attribute.
When the size is changed, the buffer will be flushed.
.. versionadded:: 2.3
diff --git a/Doc/library/re.rst b/Doc/library/re.rst
index 916feca..96b452e 100644
--- a/Doc/library/re.rst
+++ b/Doc/library/re.rst
@@ -994,14 +994,14 @@ method of :class:`MatchObject` in the following manner:
>>> pair.match("717ak").group(1)
'7'
-
+
# Error because re.match() returns None, which doesn't have a group() method:
>>> pair.match("718ak").group(1)
Traceback (most recent call last):
File "<pyshell#23>", line 1, in <module>
re.match(r".*(.).*\1", "718ak").group(1)
AttributeError: 'NoneType' object has no attribute 'group'
-
+
>>> pair.match("354aa").group(1)
'a'
@@ -1110,7 +1110,7 @@ where the search is to start:
Making a Phonebook
^^^^^^^^^^^^^^^^^^
-:func:`split` splits a string into a list delimited by the passed pattern. The
+:func:`split` splits a string into a list delimited by the passed pattern. The
method is invaluable for converting textual data into data structures that can be
easily read and modified by Python as demonstrated in the following example that
creates a phonebook.
@@ -1119,7 +1119,7 @@ First, here is the input. Normally it may come from a file, here we are using
triple-quoted string syntax:
>>> input = """Ross McFluff: 834.345.1254 155 Elm Street
- ...
+ ...
... Ronald Heathmore: 892.345.3428 436 Finley Avenue
... Frank Burger: 925.541.7625 662 South Dogwood Way
...
diff --git a/Doc/library/rexec.rst b/Doc/library/rexec.rst
index 3bc3fc9..e25e5c9 100644
--- a/Doc/library/rexec.rst
+++ b/Doc/library/rexec.rst
@@ -5,7 +5,7 @@
.. module:: rexec
:synopsis: Basic restricted execution framework.
:deprecated:
-
+
.. deprecated:: 2.6
The :mod:`rexec` module has been removed in Python 3.0.
@@ -272,7 +272,7 @@ Let us say that we want a slightly more relaxed policy than the standard
pass
elif mode in ('w', 'wb', 'a', 'ab'):
# check filename : must begin with /tmp/
- if file[:5]!='/tmp/':
+ if file[:5]!='/tmp/':
raise IOError, "can't write outside /tmp"
elif (string.find(file, '/../') >= 0 or
file[:3] == '../' or file[-3:] == '/..'):
diff --git a/Doc/library/rlcompleter.rst b/Doc/library/rlcompleter.rst
index 060f296..50f1afd 100644
--- a/Doc/library/rlcompleter.rst
+++ b/Doc/library/rlcompleter.rst
@@ -61,6 +61,6 @@ Completer objects have the following method:
If called for a dotted name, it will try to evaluate anything without obvious
side-effects (functions will not be evaluated, but it can generate calls to
:meth:`__getattr__`) up to the last part, and find matches for the rest via the
- :func:`dir` function. Any exception raised during the evaluation of the
+ :func:`dir` function. Any exception raised during the evaluation of the
expression is caught, silenced and :const:`None` is returned.
diff --git a/Doc/library/robotparser.rst b/Doc/library/robotparser.rst
index fb26123..ba7e557 100644
--- a/Doc/library/robotparser.rst
+++ b/Doc/library/robotparser.rst
@@ -13,7 +13,7 @@
single: World Wide Web
single: URL
single: robots.txt
-
+
.. note::
The :mod:`robotparser` module has been renamed :mod:`urllib.robotparser` in
Python 3.0.
diff --git a/Doc/library/sched.rst b/Doc/library/sched.rst
index 3b83f4a..121038d 100644
--- a/Doc/library/sched.rst
+++ b/Doc/library/sched.rst
@@ -42,7 +42,7 @@ Example::
930343700.276
In multi-threaded environments, the :class:`scheduler` class has limitations
-with respect to thread-safety, inability to insert a new task before
+with respect to thread-safety, inability to insert a new task before
the one currently pending in a running scheduler, and holding up the main
thread until the event queue is empty. Instead, the preferred approach
is to use the :class:`threading.Timer` class instead.
@@ -59,7 +59,7 @@ Example::
... Timer(5, print_time, ()).start()
... Timer(10, print_time, ()).start()
... time.sleep(11) # sleep while time-delay events execute
- ... print time.time()
+ ... print time.time()
...
>>> print_some_times()
930343690.257
diff --git a/Doc/library/sgmllib.rst b/Doc/library/sgmllib.rst
index 93c0cde..f50b02c 100644
--- a/Doc/library/sgmllib.rst
+++ b/Doc/library/sgmllib.rst
@@ -4,7 +4,7 @@
.. module:: sgmllib
:synopsis: Only as much of an SGML parser as needed to parse HTML.
:deprecated:
-
+
.. deprecated:: 2.6
The :mod:`sgmllib` module has been removed in Python 3.0.
diff --git a/Doc/library/shutil.rst b/Doc/library/shutil.rst
index 7baff30..e09b646 100644
--- a/Doc/library/shutil.rst
+++ b/Doc/library/shutil.rst
@@ -20,7 +20,7 @@ copying and removal. For operations on individual files, see also the
Even the higher-level file copying functions (:func:`copy`, :func:`copy2`)
can't copy all file metadata.
-
+
On POSIX platforms, this means that file owner and group are lost as well
as ACLs. On Mac OS, the resource fork and other metadata are not used.
This means that resources will be lost and file type and creator codes will
@@ -124,7 +124,7 @@ copying and removal. For operations on individual files, see also the
error. Copy permissions and times of directories using :func:`copystat`.
.. versionchanged:: 2.6
- Added the *ignore* argument to be able to influence what is being copied.
+ Added the *ignore* argument to be able to influence what is being copied.
.. function:: rmtree(path[, ignore_errors[, onerror]])
@@ -189,7 +189,7 @@ provided by this module. ::
os.makedirs(dst)
errors = []
for name in names:
- if name in ignored_names:
+ if name in ignored_names:
continue
srcname = os.path.join(src, name)
dstname = os.path.join(dst, name)
@@ -221,7 +221,7 @@ provided by this module. ::
Another example that uses the :func:`ignore_patterns` helper::
from shutil import copytree, ignore_patterns
-
+
copytree(source, destination, ignore=ignore_patterns('*.pyc', 'tmp*'))
This will copy everything except ``.pyc`` files and files or directories whose
@@ -231,7 +231,7 @@ Another example that uses the *ignore* argument to add a logging call::
from shutil import copytree
import logging
-
+
def _logpath(path, names):
logging.info('Working in %s' % path)
return [] # nothing will be ignored
diff --git a/Doc/library/signal.rst b/Doc/library/signal.rst
index 561a1c7..3793a89 100644
--- a/Doc/library/signal.rst
+++ b/Doc/library/signal.rst
@@ -39,12 +39,12 @@ rules for working with signals and their handlers:
* Some care must be taken if both signals and threads are used in the same
program. The fundamental thing to remember in using signals and threads
simultaneously is: always perform :func:`signal` operations in the main thread
- of execution. Any thread can perform an :func:`alarm`, :func:`getsignal`,
- :func:`pause`, :func:`setitimer` or :func:`getitimer`; only the main thread
- can set a new signal handler, and the main thread will be the only one to
- receive signals (this is enforced by the Python :mod:`signal` module, even
- if the underlying thread implementation supports sending signals to
- individual threads). This means that signals can't be used as a means of
+ of execution. Any thread can perform an :func:`alarm`, :func:`getsignal`,
+ :func:`pause`, :func:`setitimer` or :func:`getitimer`; only the main thread
+ can set a new signal handler, and the main thread will be the only one to
+ receive signals (this is enforced by the Python :mod:`signal` module, even
+ if the underlying thread implementation supports sending signals to
+ individual threads). This means that signals can't be used as a means of
inter-thread communication. Use locks instead.
The variables defined in the :mod:`signal` module are:
@@ -80,22 +80,22 @@ The variables defined in the :mod:`signal` module are:
One more than the number of the highest signal number.
-.. data:: ITIMER_REAL
+.. data:: ITIMER_REAL
Decrements interval timer in real time, and delivers :const:`SIGALRM` upon expiration.
-.. data:: ITIMER_VIRTUAL
+.. data:: ITIMER_VIRTUAL
- Decrements interval timer only when the process is executing, and delivers
+ Decrements interval timer only when the process is executing, and delivers
SIGVTALRM upon expiration.
.. data:: ITIMER_PROF
-
- Decrements interval timer both when the process executes and when the
- system is executing on behalf of the process. Coupled with ITIMER_VIRTUAL,
- this timer is usually used to profile the time spent by the application
+
+ Decrements interval timer both when the process executes and when the
+ system is executing on behalf of the process. Coupled with ITIMER_VIRTUAL,
+ this timer is usually used to profile the time spent by the application
in user and kernel space. SIGPROF is delivered upon expiration.
@@ -105,7 +105,7 @@ The :mod:`signal` module defines one exception:
Raised to signal an error from the underlying :func:`setitimer` or
:func:`getitimer` implementation. Expect this error if an invalid
- interval timer or a negative time is passed to :func:`setitimer`.
+ interval timer or a negative time is passed to :func:`setitimer`.
This error is a subtype of :exc:`IOError`.
@@ -143,21 +143,21 @@ The :mod:`signal` module defines the following functions:
.. function:: setitimer(which, seconds[, interval])
- Sets given interval timer (one of :const:`signal.ITIMER_REAL`,
+ Sets given interval timer (one of :const:`signal.ITIMER_REAL`,
:const:`signal.ITIMER_VIRTUAL` or :const:`signal.ITIMER_PROF`) specified
- by *which* to fire after *seconds* (float is accepted, different from
+ by *which* to fire after *seconds* (float is accepted, different from
:func:`alarm`) and after that every *interval* seconds. The interval
timer specified by *which* can be cleared by setting seconds to zero.
When an interval timer fires, a signal is sent to the process.
- The signal sent is dependent on the timer being used;
- :const:`signal.ITIMER_REAL` will deliver :const:`SIGALRM`,
+ The signal sent is dependent on the timer being used;
+ :const:`signal.ITIMER_REAL` will deliver :const:`SIGALRM`,
:const:`signal.ITIMER_VIRTUAL` sends :const:`SIGVTALRM`,
and :const:`signal.ITIMER_PROF` will deliver :const:`SIGPROF`.
The old values are returned as a tuple: (delay, interval).
- Attempting to pass an invalid interval timer will cause a
+ Attempting to pass an invalid interval timer will cause a
:exc:`ItimerError`.
.. versionadded:: 2.6
@@ -190,7 +190,7 @@ The :mod:`signal` module defines the following functions:
will be restarted when interrupted by signal *signalnum*, otherwise system calls will
be interrupted. Returns nothing. Availability: Unix (see the man page
:manpage:`siginterrupt(3)` for further information).
-
+
Note that installing a signal handler with :func:`signal` will reset the restart
behaviour to interruptible by implicitly calling :cfunc:`siginterrupt` with a true *flag*
value for the given signal.
@@ -239,7 +239,7 @@ be sent, and the handler raises an exception. ::
signal.alarm(5)
# This open() may hang indefinitely
- fd = os.open('/dev/ttyS0', os.O_RDWR)
+ fd = os.open('/dev/ttyS0', os.O_RDWR)
signal.alarm(0) # Disable the alarm
diff --git a/Doc/library/simplexmlrpcserver.rst b/Doc/library/simplexmlrpcserver.rst
index e77ac77..1591f90 100644
--- a/Doc/library/simplexmlrpcserver.rst
+++ b/Doc/library/simplexmlrpcserver.rst
@@ -151,7 +151,7 @@ Server code::
requestHandler=RequestHandler)
server.register_introspection_functions()
- # Register pow() function; this will use the value of
+ # Register pow() function; this will use the value of
# pow.__name__ as the name, which is just 'pow'.
server.register_function(pow)
@@ -160,10 +160,10 @@ Server code::
return x + y
server.register_function(adder_function, 'add')
- # Register an instance; all the methods of the instance are
+ # Register an instance; all the methods of the instance are
# published as XML-RPC methods (in this case, just 'div').
class MyFuncs:
- def div(self, x, y):
+ def div(self, x, y):
return x // y
server.register_instance(MyFuncs())
diff --git a/Doc/library/smtplib.rst b/Doc/library/smtplib.rst
index 385f116..8facc9a 100644
--- a/Doc/library/smtplib.rst
+++ b/Doc/library/smtplib.rst
@@ -189,9 +189,9 @@ An :class:`SMTP` instance has the following methods:
Identify yourself to an ESMTP server using ``EHLO``. The hostname argument
defaults to the fully qualified domain name of the local host. Examine the
- response for ESMTP option and store them for use by :meth:`has_extn`.
- Also sets several informational attributes: the message returned by
- the server is stored as the :attr:`ehlo_resp` attribute, :attr:`does_esmtp`
+ response for ESMTP option and store them for use by :meth:`has_extn`.
+ Also sets several informational attributes: the message returned by
+ the server is stored as the :attr:`ehlo_resp` attribute, :attr:`does_esmtp`
is set to true or false depending on whether the server supports ESMTP, and
:attr:`esmtp_features` will be a dictionary containing the names of the
SMTP service extensions this server supports, and their
diff --git a/Doc/library/socket.rst b/Doc/library/socket.rst
index a7e746e..e8c2d53 100644
--- a/Doc/library/socket.rst
+++ b/Doc/library/socket.rst
@@ -184,10 +184,10 @@ The module :mod:`socket` exports the following constants and functions:
.. data:: SIO_*
RCVALL_*
-
+
Constants for Windows' WSAIoctl(). The constants are used as arguments to the
:meth:`ioctl` method of socket objects.
-
+
.. versionadded:: 2.6
.. data:: TIPC_*
@@ -222,7 +222,7 @@ The module :mod:`socket` exports the following constants and functions:
all the necessary arguments for creating the corresponding socket. *host* is a domain
name, a string representation of an IPv4/v6 address or ``None``. *port* is a string
service name such as ``'http'``, a numeric port number or ``None``.
- The rest of the arguments are optional and must be numeric if specified.
+ The rest of the arguments are optional and must be numeric if specified.
By passing ``None`` as the value of *host* and *port*, , you can pass ``NULL`` to the C API.
The :func:`getaddrinfo` function returns a list of 5-tuples with the following
@@ -588,14 +588,14 @@ correspond to Unix system calls applicable to sockets.
contents of the buffer (see the optional built-in module :mod:`struct` for a way
to decode C structures encoded as strings).
-
+
.. method:: socket.ioctl(control, option)
- :platform: Windows
-
+ :platform: Windows
+
The :meth:`ioctl` method is a limited interface to the WSAIoctl system
interface. Please refer to the MSDN documentation for more information.
-
+
.. versionadded:: 2.6
@@ -909,7 +909,7 @@ sends traffic to the first one connected successfully. ::
s.close()
print 'Received', repr(data)
-
+
The last example shows how to write a very simple network sniffer with raw
sockets on Windows. The example requires administrator privileges to modify
the interface::
@@ -918,19 +918,19 @@ the interface::
# the public network interface
HOST = socket.gethostbyname(socket.gethostname())
-
+
# create a raw socket and bind it to the public interface
s = socket.socket(socket.AF_INET, socket.SOCK_RAW, socket.IPPROTO_IP)
s.bind((HOST, 0))
-
+
# Include IP headers
s.setsockopt(socket.IPPROTO_IP, socket.IP_HDRINCL, 1)
-
+
# receive all packages
s.ioctl(socket.SIO_RCVALL, socket.RCVALL_ON)
-
+
# receive a package
print s.recvfrom(65565)
-
+
# disabled promiscuous mode
s.ioctl(socket.SIO_RCVALL, socket.RCVALL_OFF)
diff --git a/Doc/library/sqlite3.rst b/Doc/library/sqlite3.rst
index 19b80ab..d031c90 100644
--- a/Doc/library/sqlite3.rst
+++ b/Doc/library/sqlite3.rst
@@ -244,7 +244,7 @@ Connection Objects
.. method:: Connection.rollback()
- This method rolls back any changes to the database since the last call to
+ This method rolls back any changes to the database since the last call to
:meth:`commit`.
.. method:: Connection.close()
@@ -487,29 +487,29 @@ Cursor Objects
.. literalinclude:: ../includes/sqlite3/executescript.py
-.. method:: Cursor.fetchone()
-
+.. method:: Cursor.fetchone()
+
Fetches the next row of a query result set, returning a single sequence,
or :const:`None` when no more data is available.
.. method:: Cursor.fetchmany([size=cursor.arraysize])
-
+
Fetches the next set of rows of a query result, returning a list. An empty
list is returned when no more rows are available.
-
+
The number of rows to fetch per call is specified by the *size* parameter.
If it is not given, the cursor's arraysize determines the number of rows
to be fetched. The method should try to fetch as many rows as indicated by
the size parameter. If this is not possible due to the specified number of
rows not being available, fewer rows may be returned.
-
+
Note there are performance considerations involved with the *size* parameter.
For optimal performance, it is usually best to use the arraysize attribute.
If the *size* parameter is used, then it is best for it to retain the same
value from one :meth:`fetchmany` call to the next.
-
-.. method:: Cursor.fetchall()
+
+.. method:: Cursor.fetchall()
Fetches all (remaining) rows of a query result, returning a list. Note that
the cursor's arraysize attribute can affect the performance of this operation.
@@ -546,8 +546,8 @@ Cursor Objects
This read-only attribute provides the column names of the last query. To
remain compatible with the Python DB API, it returns a 7-tuple for each
- column where the last six items of each tuple are :const:`None`.
-
+ column where the last six items of each tuple are :const:`None`.
+
It is set for ``SELECT`` statements without any matching rows as well.
.. _sqlite3-row-objects:
@@ -558,7 +558,7 @@ Row Objects
.. class:: Row
A :class:`Row` instance serves as a highly optimized
- :attr:`~Connection.row_factory` for :class:`Connection` objects.
+ :attr:`~Connection.row_factory` for :class:`Connection` objects.
It tries to mimic a tuple in most of its features.
It supports mapping access by column name and index, iteration,
@@ -566,7 +566,7 @@ Row Objects
If two :class:`Row` objects have exactly the same columns and their
members are equal, they compare equal.
-
+
.. versionchanged:: 2.6
Added iteration and equality (hashability).
@@ -793,7 +793,7 @@ Controlling Transactions
------------------------
By default, the :mod:`sqlite3` module opens transactions implicitly before a
-Data Modification Language (DML) statement (i.e.
+Data Modification Language (DML) statement (i.e.
``INSERT``/``UPDATE``/``DELETE``/``REPLACE``), and commits transactions
implicitly before a non-DML, non-query statement (i. e.
anything other than ``SELECT`` or the aforementioned).
diff --git a/Doc/library/ssl.rst b/Doc/library/ssl.rst
index 4fcc2f4..30f1fea 100644
--- a/Doc/library/ssl.rst
+++ b/Doc/library/ssl.rst
@@ -48,7 +48,7 @@ Functions, Constants, and Exceptions
.. exception:: SSLError
- Raised to signal an error from the underlying SSL implementation. This
+ Raised to signal an error from the underlying SSL implementation. This
signifies some problem in the higher-level
encryption and authentication layer that's superimposed on the underlying
network connection. This error is a subtype of :exc:`socket.error`, which
@@ -173,7 +173,7 @@ Functions, Constants, and Exceptions
>>> import time
>>> time.ctime(ssl.cert_time_to_seconds("May 9 00:00:00 2007 GMT"))
'Wed May 9 00:00:00 2007'
- >>>
+ >>>
.. function:: get_server_certificate (addr, ssl_version=PROTOCOL_SSLv3, ca_certs=None)
@@ -385,7 +385,7 @@ should start with the specific certificate for the principal who "is"
the client or server, and then the certificate for the issuer of that
certificate, and then the certificate for the issuer of *that* certificate,
and so on up the chain till you get to a certificate which is *self-signed*,
-that is, a certificate which has the same subject and issuer,
+that is, a certificate which has the same subject and issuer,
sometimes called a *root certificate*. The certificates should just
be concatenated together in the certificate file. For example, suppose
we had a three certificate chain, from our server certificate to the
@@ -422,13 +422,13 @@ SSL3 or TLS1, you don't need to put the full chain in your "CA certs" file;
you only need the root certificates, and the remote peer is supposed to
furnish the other certificates necessary to chain from its certificate to
a root certificate.
-See :rfc:`4158` for more discussion of the way in which
+See :rfc:`4158` for more discussion of the way in which
certification chains can be built.
If you are going to create a server that provides SSL-encrypted
connection services, you will need to acquire a certificate for that
service. There are many ways of acquiring appropriate certificates,
-such as buying one from a certification authority. Another common
+such as buying one from a certification authority. Another common
practice is to generate a self-signed certificate. The simplest
way to do this is with the OpenSSL package, using something like
the following::
@@ -570,7 +570,7 @@ Then you'd read data from the ``connstream`` and do something with it till you a
And go back to listening for new client connections.
-
+
.. seealso::
Class :class:`socket.socket`
diff --git a/Doc/library/statvfs.rst b/Doc/library/statvfs.rst
index 63fcfa4..25355bc 100644
--- a/Doc/library/statvfs.rst
+++ b/Doc/library/statvfs.rst
@@ -4,7 +4,7 @@
.. module:: statvfs
:synopsis: Constants for interpreting the result of os.statvfs().
:deprecated:
-
+
.. deprecated:: 2.6
The :mod:`statvfs` module has been deprecated for removal in Python 3.0.
diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst
index 3dc8618..7192b1e 100644
--- a/Doc/library/stdtypes.rst
+++ b/Doc/library/stdtypes.rst
@@ -362,9 +362,9 @@ Notes:
though the result's type is not necessarily int.
(6)
- float also accepts the strings "nan" and "inf" with an optional prefix "+"
+ float also accepts the strings "nan" and "inf" with an optional prefix "+"
or "-" for Not a Number (NaN) and positive or negative infinity.
-
+
.. versionadded:: 2.6
(7)
@@ -489,7 +489,7 @@ The float type has some additional methods.
original float and with a positive denominator. Raises
:exc:`OverflowError` on infinities and a :exc:`ValueError` on
NaNs.
-
+
.. versionadded:: 2.6
Two methods support conversion to
@@ -1209,7 +1209,7 @@ string functions based on regular expressions.
Return the numeric string left filled with zeros in a string of length
*width*. A sign prefix is handled correctly. The original string is
returned if *width* is less than ``len(s)``.
-
+
.. versionadded:: 2.2.2
@@ -1221,7 +1221,7 @@ The following methods are present only on unicode objects:
otherwise. Numeric characters include digit characters, and all characters
that have the Unicode numeric value property, e.g. U+2155,
VULGAR FRACTION ONE FIFTH.
-
+
.. method:: unicode.isdecimal()
Return ``True`` if there are only decimal characters in S, ``False``
@@ -1898,7 +1898,7 @@ pairs within braces, for example: ``{'jack': 4098, 'sjoerd': 4127}`` or ``{4098:
Return the item of *d* with key *key*. Raises a :exc:`KeyError` if *key*
is not in the map.
- .. versionadded:: 2.5
+ .. versionadded:: 2.5
If a subclass of dict defines a method :meth:`__missing__`, if the key
*key* is not present, the ``d[key]`` operation calls that method with
the key *key* as argument. The ``d[key]`` operation then returns or
@@ -2217,7 +2217,7 @@ Files have the following methods:
positioning); other values are ``os.SEEK_CUR`` or ``1`` (seek relative to the
current position) and ``os.SEEK_END`` or ``2`` (seek relative to the file's
end). There is no return value.
-
+
For example, ``f.seek(2, os.SEEK_CUR)`` advances the position by two and
``f.seek(-3, os.SEEK_END)`` sets the position to the third to last.
diff --git a/Doc/library/string.rst b/Doc/library/string.rst
index c960803..673f756 100644
--- a/Doc/library/string.rst
+++ b/Doc/library/string.rst
@@ -126,7 +126,7 @@ string formatting behaviors using the same implementation as the built-in
:meth:`format` is just a wrapper that calls :meth:`vformat`.
.. method:: vformat(format_string, args, kwargs)
-
+
This function does the actual work of formatting. It is exposed as a
separate function for cases where you want to pass in a predefined
dictionary of arguments, rather than unpacking and repacking the
@@ -139,12 +139,12 @@ string formatting behaviors using the same implementation as the built-in
intended to be replaced by subclasses:
.. method:: parse(format_string)
-
+
Loop over the format_string and return an iterable of tuples
(*literal_text*, *field_name*, *format_spec*, *conversion*). This is used
by :meth:`vformat` to break the string in to either literal text, or
replacement fields.
-
+
The values in the tuple conceptually represent a span of literal text
followed by a single replacement field. If there is no literal text
(which can happen if two replacement fields occur consecutively), then
@@ -162,7 +162,7 @@ string formatting behaviors using the same implementation as the built-in
*key* parameter to :meth:`get_value`.
.. method:: get_value(key, args, kwargs)
-
+
Retrieve a given field value. The *key* argument will be either an
integer or a string. If it is an integer, it represents the index of the
positional argument in *args*; if it is a string, then it represents a
@@ -200,7 +200,7 @@ string formatting behaviors using the same implementation as the built-in
method is provided so that subclasses can override it.
.. method:: convert_field(value, conversion)
-
+
Converts the value (returned by :meth:`get_field`) given a conversion type
(as in the tuple returned by the :meth:`parse` method.) The default
version understands 'r' (repr) and 's' (str) conversion types.
@@ -229,7 +229,7 @@ The grammar for a replacement field is as follows:
element_index: `integer`
conversion: "r" | "s"
format_spec: <described in the next section>
-
+
In less formal terms, the replacement field starts with a *field_name*, which
can either be a number (for a positional argument), or an identifier (for
keyword arguments). Following this is an optional *conversion* field, which is
@@ -249,7 +249,7 @@ Some simple format string examples::
"My quest is {name}" # References keyword argument 'name'
"Weight in tons {0.weight}" # 'weight' attribute of first positional arg
"Units destroyed: {players[0]}" # First element of keyword argument 'players'.
-
+
The *conversion* field causes a type coercion before formatting. Normally, the
job of formatting a value is done by the :meth:`__format__` method of the value
itself. However, in some cases it is desirable to force a type to be formatted
@@ -292,11 +292,11 @@ effectively::
Then the outer replacement field would be evaluated, producing::
"noses "
-
+
Which is substituted into the string, yielding::
-
+
"A man with two noses "
-
+
(The extra space is because we specified a field width of 10, and because left
alignment is the default for strings.)
@@ -328,7 +328,7 @@ The general form of a *standard format specifier* is:
width: `integer`
precision: `integer`
type: "b" | "c" | "d" | "e" | "E" | "f" | "F" | "g" | "G" | "n" | "o" | "x" | "X" | "%"
-
+
The *fill* character can be any character other than '}' (which signifies the
end of the field). The presence of a fill character is signaled by the *next*
character, which must be one of the alignment options. If the second character
@@ -421,9 +421,9 @@ The available integer presentation types are:
+---------+----------------------------------------------------------+
| None | The same as ``'d'``. |
+---------+----------------------------------------------------------+
-
+
The available presentation types for floating point and decimal values are:
-
+
+---------+----------------------------------------------------------+
| Type | Meaning |
+=========+==========================================================+
diff --git a/Doc/library/stringio.rst b/Doc/library/stringio.rst
index 19e1547..f7f6771 100644
--- a/Doc/library/stringio.rst
+++ b/Doc/library/stringio.rst
@@ -52,7 +52,7 @@ Example usage::
# 'First line.\nSecond line.\n'
contents = output.getvalue()
- # Close object and discard memory buffer --
+ # Close object and discard memory buffer --
# .getvalue() will now raise an exception.
output.close()
@@ -81,7 +81,7 @@ encoded as plain ASCII strings.
Calling :func:`StringIO` with a Unicode string parameter populates
the object with the buffer representation of the Unicode string, instead of
-encoding the string.
+encoding the string.
Another difference from the :mod:`StringIO` module is that calling
:func:`StringIO` with a string parameter creates a read-only object. Unlike an
@@ -118,7 +118,7 @@ Example usage::
# 'First line.\nSecond line.\n'
contents = output.getvalue()
- # Close object and discard memory buffer --
+ # Close object and discard memory buffer --
# .getvalue() will now raise an exception.
output.close()
diff --git a/Doc/library/subprocess.rst b/Doc/library/subprocess.rst
index e0ab96d..316ee80 100644
--- a/Doc/library/subprocess.rst
+++ b/Doc/library/subprocess.rst
@@ -131,7 +131,7 @@ This module defines one class called :class:`Popen`:
Special value that can be used as the *stderr* argument to :class:`Popen` and
indicates that standard error should go into the same handle as standard
output.
-
+
Convenience Functions
^^^^^^^^^^^^^^^^^^^^^
@@ -326,7 +326,7 @@ The following attributes are also available:
The child return code, set by :meth:`poll` and :meth:`wait` (and indirectly
by :meth:`communicate`). A ``None`` value indicates that the process
hasn't terminated yet.
-
+
A negative value ``-N`` indicates that the child was terminated by signal
``N`` (Unix only).
diff --git a/Doc/library/sunaudio.rst b/Doc/library/sunaudio.rst
index a34929e..4d67b21 100644
--- a/Doc/library/sunaudio.rst
+++ b/Doc/library/sunaudio.rst
@@ -6,7 +6,7 @@
:platform: SunOS
:synopsis: Access to Sun audio hardware.
:deprecated:
-
+
.. deprecated:: 2.6
The :mod:`sunaudiodev` module has been deprecated for removal in Python 3.0.
@@ -151,7 +151,7 @@ the SIGPOLL signal. Here's an example of how you might enable this in Python::
:platform: SunOS
:synopsis: Constants for use with sunaudiodev.
:deprecated:
-
+
.. deprecated:: 2.6
The :mod:`SUNAUDIODEV` module has been deprecated for removal in Python 3.0.
diff --git a/Doc/library/sys.rst b/Doc/library/sys.rst
index fa7b7f0..1000694 100644
--- a/Doc/library/sys.rst
+++ b/Doc/library/sys.rst
@@ -402,7 +402,7 @@ always available.
The *default* argument allows to define a value which will be returned
if the object type does not provide means to retrieve the size and would
- cause a `TypeError`.
+ cause a `TypeError`.
func:`getsizeof` calls the object's __sizeof__ method and adds an additional
garbage collector overhead if the object is managed by the garbage collector.
@@ -731,7 +731,7 @@ always available.
The events have the following meaning:
- ``'call'``
+ ``'call'``
A function is called (or some other code block entered). The
global trace function is called; *arg* is ``None``; the return value
specifies the local trace function.
@@ -799,7 +799,7 @@ always available.
prompts of :func:`input` and :func:`raw_input`. The interpreter's own prompts
and (almost all of) its error messages go to ``stderr``. ``stdout`` and
``stderr`` needn't be built-in file objects: any object is acceptable as long
- as it has a :meth:`write` method that takes a string argument. (Changing these
+ as it has a :meth:`write` method that takes a string argument. (Changing these
objects doesn't affect the standard I/O streams of processes executed by
:func:`os.popen`, :func:`os.system` or the :func:`exec\*` family of functions in
the :mod:`os` module.)
diff --git a/Doc/library/tk.rst b/Doc/library/tk.rst
index 944687b..e1c25b6 100644
--- a/Doc/library/tk.rst
+++ b/Doc/library/tk.rst
@@ -22,15 +22,15 @@ classes. In addition, the internal module :mod:`_tkinter` provides a threadsafe
mechanism which allows Python and Tcl to interact.
:mod:`Tkinter`'s chief virtues are that it is fast, and that it usually comes
-bundled with Python. Although its standard documentation is weak, good
-material is available, which includes: references, tutorials, a book and
-others. :mod:`Tkinter` is also famous for having an outdated look and feel,
-which has been vastly improved in Tk 8.5. Nevertheless, there are many other
-GUI libraries that you could be interested in. For more information about
+bundled with Python. Although its standard documentation is weak, good
+material is available, which includes: references, tutorials, a book and
+others. :mod:`Tkinter` is also famous for having an outdated look and feel,
+which has been vastly improved in Tk 8.5. Nevertheless, there are many other
+GUI libraries that you could be interested in. For more information about
alternatives, see the :ref:`other-gui-packages` section.
.. toctree::
-
+
tkinter.rst
tix.rst
scrolledtext.rst
diff --git a/Doc/library/tkinter.rst b/Doc/library/tkinter.rst
index 7695403..ce8085d 100644
--- a/Doc/library/tkinter.rst
+++ b/Doc/library/tkinter.rst
@@ -284,7 +284,7 @@ perform some *action*. In C, you'd express this as someAction(fred,
someOptions), in C++, you would express this as fred.someAction(someOptions),
and in Tk, you say::
- .fred someAction someOptions
+ .fred someAction someOptions
Note that the object name, ``.fred``, starts with a dot.
@@ -490,7 +490,7 @@ Packer Options
For more extensive information on the packer and the options that it can take,
see the man pages and page 183 of John Ousterhout's book.
-anchor
+anchor
Anchor type. Denotes where the packer is to place each slave in its parcel.
expand
@@ -720,7 +720,7 @@ event. The following table lists the other event fields you can access, and how
they are denoted in Tk, which can be useful when referring to the Tk man pages.
::
- Tk Tkinter Event Field Tk Tkinter Event Field
+ Tk Tkinter Event Field Tk Tkinter Event Field
-- ------------------- -- -------------------
%f focus %A char
%h height %E send_event
diff --git a/Doc/library/trace.rst b/Doc/library/trace.rst
index 05d5d66..f79d7e5 100644
--- a/Doc/library/trace.rst
+++ b/Doc/library/trace.rst
@@ -65,13 +65,13 @@ The following command-line arguments are supported:
:option:`--ignore-module`
Accepts comma separated list of module names. Ignore each of the named
- module and its submodules (if it is a package). May be given
+ module and its submodules (if it is a package). May be given
multiple times.
:option:`--ignore-dir`
Ignore all modules and packages in the named directory and subdirectories
(multiple directories can be joined by os.pathsep). May be given multiple
- times.
+ times.
.. _trace-api:
diff --git a/Doc/library/traceback.rst b/Doc/library/traceback.rst
index d446339..1260037 100644
--- a/Doc/library/traceback.rst
+++ b/Doc/library/traceback.rst
@@ -169,10 +169,10 @@ exception and traceback::
def lumberjack():
bright_side_of_death()
-
+
def bright_side_of_death():
return tuple()[0]
-
+
try:
lumberjack()
except:
@@ -251,12 +251,12 @@ The following example shows the different ways to print and format the stack::
>>> import traceback
>>> def another_function():
... lumberstack()
- ...
+ ...
>>> def lumberstack():
... traceback.print_stack()
... print repr(traceback.extract_stack())
... print repr(traceback.format_stack())
- ...
+ ...
>>> another_function()
File "<doctest>", line 10, in <module>
another_function()
diff --git a/Doc/library/turtle.rst b/Doc/library/turtle.rst
index 5f9bf18..3155d87 100644
--- a/Doc/library/turtle.rst
+++ b/Doc/library/turtle.rst
@@ -1587,7 +1587,7 @@ The public classes of the module :mod:`turtle`
Subclass of TurtleScreen, with :ref:`four methods added <screenspecific>`.
-
+
.. class:: ScrolledCavas(master)
:param master: some Tkinter widget to contain the ScrolledCanvas, i.e.
@@ -1612,13 +1612,13 @@ The public classes of the module :mod:`turtle`
"compound" ``None`` (a compund shape has to be constructed using the
:meth:`addcomponent` method)
=========== ===========
-
+
.. method:: addcomponent(poly, fill, outline=None)
:param poly: a polygon, i.e. a tuple of pairs of numbers
:param fill: a color the *poly* will be filled with
:param outline: a color for the poly's outline (if given)
-
+
Example:
>>> poly = ((0,0),(10,-5),(0,10),(-10,-5))
@@ -1662,31 +1662,31 @@ facilities:
>>> help(Screen.bgcolor)
Help on method bgcolor in module turtle:
-
+
bgcolor(self, *args) unbound turtle.Screen method
Set or return backgroundcolor of the TurtleScreen.
-
+
Arguments (if given): a color string or three numbers
in the range 0..colormode or a 3-tuple of such numbers.
-
-
+
+
>>> screen.bgcolor("orange")
>>> screen.bgcolor()
"orange"
>>> screen.bgcolor(0.5,0,0.5)
>>> screen.bgcolor()
"#800080"
-
+
>>> help(Turtle.penup)
Help on method penup in module turtle:
-
+
penup(self) unbound turtle.Turtle method
Pull the pen up -- no drawing when moving.
-
+
Aliases: penup | pu | up
-
+
No argument
-
+
>>> turtle.penup()
- The docstrings of the functions which are derived from methods have a modified
@@ -1694,32 +1694,32 @@ facilities:
>>> help(bgcolor)
Help on function bgcolor in module turtle:
-
+
bgcolor(*args)
Set or return backgroundcolor of the TurtleScreen.
-
+
Arguments (if given): a color string or three numbers
in the range 0..colormode or a 3-tuple of such numbers.
-
+
Example::
-
+
>>> bgcolor("orange")
>>> bgcolor()
"orange"
>>> bgcolor(0.5,0,0.5)
>>> bgcolor()
"#800080"
-
+
>>> help(penup)
Help on function penup in module turtle:
-
+
penup()
Pull the pen up -- no drawing when moving.
-
+
Aliases: penup | pu | up
-
+
No argument
-
+
Example:
>>> penup()
diff --git a/Doc/library/undoc.rst b/Doc/library/undoc.rst
index 09c61d2..ac646c5 100644
--- a/Doc/library/undoc.rst
+++ b/Doc/library/undoc.rst
@@ -21,7 +21,7 @@ Some of these are very old and/or not very robust; marked with "hmm."
:mod:`ihooks`
--- Import hook support (for :mod:`rexec`; may become obsolete).
-
+
.. warning:: The :mod:`ihooks` module has been removed in Python 3.0.
@@ -54,7 +54,7 @@ Multimedia
:mod:`linuxaudiodev`
--- Play audio data on the Linux audio device. Replaced in Python 2.3 by the
:mod:`ossaudiodev` module.
-
+
.. warning:: The :mod:`linuxaudiodev` module has been removed in Python 3.0.
:mod:`sunaudio`
@@ -240,7 +240,7 @@ extensions.
:mod:`timing`
--- Measure time intervals to high resolution (use :func:`time.clock` instead).
-
+
.. warning:: The :mod:`timing` module has been removed in Python 3.0.
@@ -255,6 +255,6 @@ of reality.
:mod:`sv`
--- Interface to the "simple video" board on SGI Indigo (obsolete hardware).
-
+
.. warning:: The :mod:`sv` module has been removed in Python 3.0.
diff --git a/Doc/library/unicodedata.rst b/Doc/library/unicodedata.rst
index 83f4604..440a135 100644
--- a/Doc/library/unicodedata.rst
+++ b/Doc/library/unicodedata.rst
@@ -164,7 +164,7 @@ Examples:
File "<stdin>", line 1, in ?
ValueError: not a decimal
>>> unicodedata.category(u'A') # 'L'etter, 'u'ppercase
- 'Lu'
+ 'Lu'
>>> unicodedata.bidirectional(u'\u0660') # 'A'rabic, 'N'umber
'AN'
diff --git a/Doc/library/unittest.rst b/Doc/library/unittest.rst
index f86fda0..e52ee3a 100644
--- a/Doc/library/unittest.rst
+++ b/Doc/library/unittest.rst
@@ -595,7 +595,7 @@ failures.
TestCase.failUnlessAlmostEqual(first, second[, places[, msg]])
Test that *first* and *second* are approximately equal by computing the
- difference, rounding to the given number of decimal *places* (default 7),
+ difference, rounding to the given number of decimal *places* (default 7),
and comparing to zero.
Note that comparing a given number of decimal places is not the same as
comparing a given number of significant digits. If the values do not compare
@@ -606,7 +606,7 @@ failures.
TestCase.failIfAlmostEqual(first, second[, places[, msg]])
Test that *first* and *second* are not approximately equal by computing the
- difference, rounding to the given number of decimal *places* (default 7),
+ difference, rounding to the given number of decimal *places* (default 7),
and comparing to zero.
Note that comparing a given number of decimal places is not the same as
comparing a given number of significant digits. If the values do not compare
diff --git a/Doc/library/urllib.rst b/Doc/library/urllib.rst
index b2f96a1..1d02b1c 100644
--- a/Doc/library/urllib.rst
+++ b/Doc/library/urllib.rst
@@ -123,7 +123,7 @@ High-level interface
.. versionchanged:: 2.6
Added :meth:`getcode` to returned object and support for the
:envvar:`no_proxy` environment variable.
-
+
.. deprecated:: 2.6
The :func:`urlopen` function has been removed in Python 3.0 in favor
of :func:`urllib2.urlopen`.
diff --git a/Doc/library/urllib2.rst b/Doc/library/urllib2.rst
index 4c7c582..986e545 100644
--- a/Doc/library/urllib2.rst
+++ b/Doc/library/urllib2.rst
@@ -109,7 +109,7 @@ The following exceptions are raised as appropriate:
.. attribute:: code
- An HTTP status code as defined in `RFC 2616 <http://www.faqs.org/rfcs/rfc2616.html>`_.
+ An HTTP status code as defined in `RFC 2616 <http://www.faqs.org/rfcs/rfc2616.html>`_.
This numeric value corresponds to a value found in the dictionary of
codes as found in :attr:`BaseHTTPServer.BaseHTTPRequestHandler.responses`.
diff --git a/Doc/library/warnings.rst b/Doc/library/warnings.rst
index bb3aa44..81e7452 100644
--- a/Doc/library/warnings.rst
+++ b/Doc/library/warnings.rst
@@ -274,7 +274,7 @@ Available Functions
.. function:: warnpy3k(message[, category[, stacklevel]])
- Issue a warning related to Python 3.x deprecation. Warnings are only shown
+ Issue a warning related to Python 3.x deprecation. Warnings are only shown
when Python is started with the -3 option. Like :func:`warn` *message* must
be a string and *category* a subclass of :exc:`Warning`. :func:`warnpy3k`
is using :exc:`DeprecationWarning` as default warning class.
@@ -288,7 +288,7 @@ Available Functions
this function with an alternative implementation by assigning to
``warnings.showwarning``.
*line* is a line of source code to be included in the warning
- message; if *line* is not supplied, :func:`showwarning` will
+ message; if *line* is not supplied, :func:`showwarning` will
try to read the line specified by *filename* and *lineno*.
.. versionchanged:: 2.6
@@ -299,8 +299,8 @@ Available Functions
.. function:: formatwarning(message, category, filename, lineno[, line])
Format a warning the standard way. This returns a string which may contain
- embedded newlines and ends in a newline. *line* is
- a line of source code to be included in the warning message; if *line* is not supplied,
+ embedded newlines and ends in a newline. *line* is
+ a line of source code to be included in the warning message; if *line* is not supplied,
:func:`formatwarning` will try to read the line specified by *filename* and *lineno*.
.. versionchanged:: 2.6
diff --git a/Doc/library/webbrowser.rst b/Doc/library/webbrowser.rst
index d340b8a..4d819e6 100644
--- a/Doc/library/webbrowser.rst
+++ b/Doc/library/webbrowser.rst
@@ -160,7 +160,7 @@ Here are some simple examples::
url = 'http://www.python.org'
- # Open URL in a new tab, if a browser window is already open.
+ # Open URL in a new tab, if a browser window is already open.
webbrowser.open_new_tab(url + '/doc')
# Open URL in new window, raising the window if possible.
diff --git a/Doc/library/wsgiref.rst b/Doc/library/wsgiref.rst
index a888bf9..a97eaec 100644
--- a/Doc/library/wsgiref.rst
+++ b/Doc/library/wsgiref.rst
@@ -170,7 +170,7 @@ also provides these miscellaneous utilities:
filelike = StringIO("This is an example file-like object"*10)
wrapper = FileWrapper(filelike, blksize=5)
- for chunk in wrapper:
+ for chunk in wrapper:
print chunk
@@ -415,7 +415,7 @@ Paste" library.
from wsgiref.validate import validator
from wsgiref.simple_server import make_server
- # Our callable object which is intentionally not compliant to the
+ # Our callable object which is intentionally not compliant to the
# standard, so the validator is going to break
def simple_app(environ, start_response):
status = '200 OK' # HTTP Status
diff --git a/Doc/library/xml.etree.elementtree.rst b/Doc/library/xml.etree.elementtree.rst
index b17d510..9aa1ea3 100644
--- a/Doc/library/xml.etree.elementtree.rst
+++ b/Doc/library/xml.etree.elementtree.rst
@@ -34,7 +34,7 @@ convert it from and to XML.
A C implementation of this API is available as :mod:`xml.etree.cElementTree`.
See http://effbot.org/zone/element-index.htm for tutorials and links to other
-docs. Fredrik Lundh's page is also the location of the development version of the
+docs. Fredrik Lundh's page is also the location of the development version of the
xml.etree.ElementTree.
.. _elementtree-functions:
@@ -379,7 +379,7 @@ This is the XML file that is going to be manipulated::
<title>Example page</title>
</head>
<body>
- <p>Moved to <a href="http://example.org/">example.org</a>
+ <p>Moved to <a href="http://example.org/">example.org</a>
or <a href="http://example.com/">example.com</a>.</p>
</body>
</html>
@@ -486,9 +486,9 @@ XMLTreeBuilder Objects
:meth:`XMLTreeBuilder.feed` calls *target*\'s :meth:`start` method
for each opening tag, its :meth:`end` method for each closing tag,
-and data is processed by method :meth:`data`. :meth:`XMLTreeBuilder.close`
-calls *target*\'s method :meth:`close`.
-:class:`XMLTreeBuilder` can be used not only for building a tree structure.
+and data is processed by method :meth:`data`. :meth:`XMLTreeBuilder.close`
+calls *target*\'s method :meth:`close`.
+:class:`XMLTreeBuilder` can be used not only for building a tree structure.
This is an example of counting the maximum depth of an XML file::
>>> from xml.etree.ElementTree import XMLTreeBuilder
@@ -496,16 +496,16 @@ This is an example of counting the maximum depth of an XML file::
... maxDepth = 0
... depth = 0
... def start(self, tag, attrib): # Called for each opening tag.
- ... self.depth += 1
+ ... self.depth += 1
... if self.depth > self.maxDepth:
... self.maxDepth = self.depth
... def end(self, tag): # Called for each closing tag.
... self.depth -= 1
- ... def data(self, data):
+ ... def data(self, data):
... pass # We do not need to do anything with data.
... def close(self): # Called when all data has been parsed.
... return self.maxDepth
- ...
+ ...
>>> target = MaxDepth()
>>> parser = XMLTreeBuilder(target=target)
>>> exampleXml = """
diff --git a/Doc/library/zipfile.rst b/Doc/library/zipfile.rst
index 8e96d24..ec357bb 100644
--- a/Doc/library/zipfile.rst
+++ b/Doc/library/zipfile.rst
@@ -202,7 +202,7 @@ ZipFile Objects
.. method:: ZipFile.extractall([path[, members[, pwd]]])
- Extract all members from the archive to the current working directory. *path*
+ Extract all members from the archive to the current working directory. *path*
specifies a different directory to extract to. *members* is optional and must
be a subset of the list returned by :meth:`namelist`. *pwd* is the password
used for encrypted files.
@@ -282,9 +282,9 @@ ZipFile Objects
.. note::
- When passing a :class:`ZipInfo` instance as the *zinfo_or_acrname* parameter,
- the compression method used will be that specified in the *compress_type*
- member of the given :class:`ZipInfo` instance. By default, the
+ When passing a :class:`ZipInfo` instance as the *zinfo_or_acrname* parameter,
+ the compression method used will be that specified in the *compress_type*
+ member of the given :class:`ZipInfo` instance. By default, the
:class:`ZipInfo` constructor sets this member to :const:`ZIP_STORED`.
The following data attributes are also available:
@@ -298,9 +298,9 @@ The following data attributes are also available:
.. attribute:: ZipFile.comment
- The comment text associated with the ZIP file. If assigning a comment to a
- :class:`ZipFile` instance created with mode 'a' or 'w', this should be a
- string no longer than 65535 bytes. Comments longer than this will be
+ The comment text associated with the ZIP file. If assigning a comment to a
+ :class:`ZipFile` instance created with mode 'a' or 'w', this should be a
+ string no longer than 65535 bytes. Comments longer than this will be
truncated in the written archive when :meth:`ZipFile.close` is called.
.. _pyzipfile-objects:
@@ -329,10 +329,10 @@ The :class:`PyZipFile` constructor takes the same parameters as the
internal use only. The :meth:`writepy` method makes archives with file names
like this::
- string.pyc # Top level name
- test/__init__.pyc # Package directory
+ string.pyc # Top level name
+ test/__init__.pyc # Package directory
test/test_support.pyc # Module test.test_support
- test/bogus/__init__.pyc # Subpackage directory
+ test/bogus/__init__.pyc # Subpackage directory
test/bogus/myfile.pyc # Submodule test.bogus.myfile
diff --git a/Doc/library/zipimport.rst b/Doc/library/zipimport.rst
index 104182e..0a6ece0 100644
--- a/Doc/library/zipimport.rst
+++ b/Doc/library/zipimport.rst
@@ -148,7 +148,7 @@ Here is an example that imports a module from a ZIP archive - note that the
-------- -------
8467 1 file
$ ./python
- Python 2.3 (#1, Aug 1 2003, 19:54:32)
+ Python 2.3 (#1, Aug 1 2003, 19:54:32)
>>> import sys
>>> sys.path.insert(0, '/tmp/example.zip') # Add .zip file to front of path
>>> import jwzthreading