summaryrefslogtreecommitdiffstats
path: root/Doc/library
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2009-01-03 21:26:05 (GMT)
committerGeorg Brandl <georg@python.org>2009-01-03 21:26:05 (GMT)
commita1c6a1cea5af1d3c7682a8e99b001b0904480e4d (patch)
tree85461d1ba5237440b36f253b197779190226a294 /Doc/library
parent48310cd3f2e02ced9ae836ccbcb67e9af3097d62 (diff)
downloadcpython-a1c6a1cea5af1d3c7682a8e99b001b0904480e4d.zip
cpython-a1c6a1cea5af1d3c7682a8e99b001b0904480e4d.tar.gz
cpython-a1c6a1cea5af1d3c7682a8e99b001b0904480e4d.tar.bz2
Merged revisions 68221 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r68221 | georg.brandl | 2009-01-03 22:04:55 +0100 (Sat, 03 Jan 2009) | 2 lines Remove tabs from the documentation. ........
Diffstat (limited to 'Doc/library')
-rw-r--r--Doc/library/abc.rst12
-rw-r--r--Doc/library/collections.rst6
-rw-r--r--Doc/library/gettext.rst21
-rw-r--r--Doc/library/multiprocessing.rst2
-rw-r--r--Doc/library/optparse.rst12
-rw-r--r--Doc/library/sched.rst2
-rw-r--r--Doc/library/socket.rst30
7 files changed, 41 insertions, 44 deletions
diff --git a/Doc/library/abc.rst b/Doc/library/abc.rst
index bf3b0b1..8ab90cc 100644
--- a/Doc/library/abc.rst
+++ b/Doc/library/abc.rst
@@ -42,15 +42,15 @@ This module provides the following class:
Register *subclass* as a "virtual subclass" of this ABC. For
example::
- from abc import ABCMeta
+ from abc import ABCMeta
- class MyABC(metaclass=ABCMeta):
- pass
+ class MyABC(metaclass=ABCMeta):
+ pass
- MyABC.register(tuple)
+ MyABC.register(tuple)
- assert issubclass(tuple, MyABC)
- assert isinstance((), MyABC)
+ assert issubclass(tuple, MyABC)
+ assert isinstance((), MyABC)
You can also override this method in an abstract base class:
diff --git a/Doc/library/collections.rst b/Doc/library/collections.rst
index f41abd6..4045d2e 100644
--- a/Doc/library/collections.rst
+++ b/Doc/library/collections.rst
@@ -41,7 +41,7 @@ ABC Inherits Abstract Methods Mixin
:class:`Hashable` ``__hash__``
:class:`Iterable` ``__iter__``
:class:`Iterator` :class:`Iterable` ``__next__`` ``__iter__``
-:class:`Sized` ``__len__``
+:class:`Sized` ``__len__``
:class:`Callable` ``__call__``
:class:`Sequence` :class:`Sized`, ``__getitem__`` ``__contains__``. ``__iter__``, ``__reversed__``.
@@ -68,7 +68,7 @@ ABC Inherits Abstract Methods Mixin
:class:`MutableMapping` :class:`Mapping` ``__getitem__`` Inherited Mapping methods and
``__setitem__``, ``pop``, ``popitem``, ``clear``, ``update``,
``__delitem__``, and ``setdefault``
- ``__iter__``, and
+ ``__iter__``, and
``__len__``
:class:`MappingView` :class:`Sized` ``__len__``
@@ -84,7 +84,7 @@ particular functionality, for example::
size = None
if isinstance(myvar, collections.Sized):
- size = len(myvar)
+ size = len(myvar)
Several of the ABCs are also useful as mixins that make it easier to develop
classes supporting container APIs. For example, to write a class supporting
diff --git a/Doc/library/gettext.rst b/Doc/library/gettext.rst
index cd229e7..a295c0e 100644
--- a/Doc/library/gettext.rst
+++ b/Doc/library/gettext.rst
@@ -551,10 +551,9 @@ translation until later. A classic example is::
animals = ['mollusk',
'albatross',
- 'rat',
- 'penguin',
- 'python',
- ]
+ 'rat',
+ 'penguin',
+ 'python', ]
# ...
for a in animals:
print(a)
@@ -569,10 +568,9 @@ Here is one way you can handle this situation::
animals = [_('mollusk'),
_('albatross'),
- _('rat'),
- _('penguin'),
- _('python'),
- ]
+ _('rat'),
+ _('penguin'),
+ _('python'), ]
del _
@@ -595,10 +593,9 @@ Another way to handle this is with the following example::
animals = [N_('mollusk'),
N_('albatross'),
- N_('rat'),
- N_('penguin'),
- N_('python'),
- ]
+ N_('rat'),
+ N_('penguin'),
+ N_('python'), ]
# ...
for a in animals:
diff --git a/Doc/library/multiprocessing.rst b/Doc/library/multiprocessing.rst
index 7e44423..e5dd1ed 100644
--- a/Doc/library/multiprocessing.rst
+++ b/Doc/library/multiprocessing.rst
@@ -35,7 +35,7 @@ Windows.
>>> from multiprocessing import Pool
>>> p = Pool(5)
>>> def f(x):
- ... return x*x
+ ... return x*x
...
>>> p.map(f, [1,2,3])
Process PoolWorker-1:
diff --git a/Doc/library/optparse.rst b/Doc/library/optparse.rst
index 3805d96..4e9bb23 100644
--- a/Doc/library/optparse.rst
+++ b/Doc/library/optparse.rst
@@ -543,8 +543,8 @@ Continuing with the parser defined above, adding an
:class:`OptionGroup` to a parser is easy::
group = OptionGroup(parser, "Dangerous Options",
- "Caution: use these options at your own risk. "
- "It is believed that some of them bite.")
+ "Caution: use these options at your own risk. "
+ "It is believed that some of them bite.")
group.add_option("-g", action="store_true", help="Group option.")
parser.add_option_group(group)
@@ -558,12 +558,12 @@ This would result in the following help output::
-q, --quiet be vewwy quiet (I'm hunting wabbits)
-fFILE, --file=FILE write output to FILE
-mMODE, --mode=MODE interaction mode: one of 'novice', 'intermediate'
- [default], 'expert'
+ [default], 'expert'
Dangerous Options:
- Caution: use of these options is at your own risk. It is believed that
- some of them bite.
- -g Group option.
+ Caution: use of these options is at your own risk. It is believed that
+ some of them bite.
+ -g Group option.
.. _optparse-printing-version-string:
diff --git a/Doc/library/sched.rst b/Doc/library/sched.rst
index cab7f60..f93c9b5 100644
--- a/Doc/library/sched.rst
+++ b/Doc/library/sched.rst
@@ -58,7 +58,7 @@ Example::
... print(time.time())
... Timer(5, print_time, ()).start()
... Timer(10, print_time, ()).start()
- ... time.sleep(11) # sleep while time-delay events execute
+ ... time.sleep(11) # sleep while time-delay events execute
... print(time.time())
...
>>> print_some_times()
diff --git a/Doc/library/socket.rst b/Doc/library/socket.rst
index c2e3d91..f399dae 100644
--- a/Doc/library/socket.rst
+++ b/Doc/library/socket.rst
@@ -797,17 +797,17 @@ sends traffic to the first one connected successfully. ::
socket.SOCK_STREAM, 0, socket.AI_PASSIVE):
af, socktype, proto, canonname, sa = res
try:
- s = socket.socket(af, socktype, proto)
+ s = socket.socket(af, socktype, proto)
except socket.error as msg:
- s = None
- continue
+ s = None
+ continue
try:
- s.bind(sa)
- s.listen(1)
+ s.bind(sa)
+ s.listen(1)
except socket.error as msg:
- s.close()
- s = None
- continue
+ s.close()
+ s = None
+ continue
break
if s is None:
print('could not open socket')
@@ -832,16 +832,16 @@ sends traffic to the first one connected successfully. ::
for res in socket.getaddrinfo(HOST, PORT, socket.AF_UNSPEC, socket.SOCK_STREAM):
af, socktype, proto, canonname, sa = res
try:
- s = socket.socket(af, socktype, proto)
+ s = socket.socket(af, socktype, proto)
except socket.error as msg:
- s = None
- continue
+ s = None
+ continue
try:
- s.connect(sa)
+ s.connect(sa)
except socket.error as msg:
- s.close()
- s = None
- continue
+ s.close()
+ s = None
+ continue
break
if s is None:
print('could not open socket')