Skip to content

Commit b40222a

Browse files
author
georg.brandl
committed
Remove tabs from the documentation.
git-svn-id: http://svn.python.org/projects/python/trunk@68221 6015fed2-1504-0410-9fe1-9d1591cc4771
1 parent 8d21a92 commit b40222a

20 files changed

+163
-166
lines changed

Doc/extending/newtypes.rst

+16-16
Original file line numberDiff line numberDiff line change
@@ -840,8 +840,8 @@ As you can see, the source code closely resembles the :class:`Noddy` examples in
840840
previous sections. We will break down the main differences between them. ::
841841

842842
typedef struct {
843-
PyListObject list;
844-
int state;
843+
PyListObject list;
844+
int state;
845845
} Shoddy;
846846

847847
The primary difference for derived type objects is that the base type's object
@@ -854,10 +854,10 @@ be safely cast to both *PyListObject\** and *Shoddy\**. ::
854854
static int
855855
Shoddy_init(Shoddy *self, PyObject *args, PyObject *kwds)
856856
{
857-
if (PyList_Type.tp_init((PyObject *)self, args, kwds) < 0)
858-
return -1;
859-
self->state = 0;
860-
return 0;
857+
if (PyList_Type.tp_init((PyObject *)self, args, kwds) < 0)
858+
return -1;
859+
self->state = 0;
860+
return 0;
861861
}
862862

863863
In the :attr:`__init__` method for our type, we can see how to call through to
@@ -876,18 +876,18 @@ the module's :cfunc:`init` function. ::
876876
PyMODINIT_FUNC
877877
initshoddy(void)
878878
{
879-
PyObject *m;
879+
PyObject *m;
880880

881-
ShoddyType.tp_base = &PyList_Type;
882-
if (PyType_Ready(&ShoddyType) < 0)
883-
return;
881+
ShoddyType.tp_base = &PyList_Type;
882+
if (PyType_Ready(&ShoddyType) < 0)
883+
return;
884884

885-
m = Py_InitModule3("shoddy", NULL, "Shoddy module");
886-
if (m == NULL)
887-
return;
885+
m = Py_InitModule3("shoddy", NULL, "Shoddy module");
886+
if (m == NULL)
887+
return;
888888

889-
Py_INCREF(&ShoddyType);
890-
PyModule_AddObject(m, "Shoddy", (PyObject *) &ShoddyType);
889+
Py_INCREF(&ShoddyType);
890+
PyModule_AddObject(m, "Shoddy", (PyObject *) &ShoddyType);
891891
}
892892

893893
Before calling :cfunc:`PyType_Ready`, the type structure must have the
@@ -1167,7 +1167,7 @@ structure::
11671167
typedef struct PyMethodDef {
11681168
char *ml_name; /* method name */
11691169
PyCFunction ml_meth; /* implementation function */
1170-
int ml_flags; /* flags */
1170+
int ml_flags; /* flags */
11711171
char *ml_doc; /* docstring */
11721172
} PyMethodDef;
11731173

Doc/howto/curses.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ So, to display a reverse-video status line on the top line of the screen, you
297297
could code::
298298

299299
stdscr.addstr(0, 0, "Current mode: Typing mode",
300-
curses.A_REVERSE)
300+
curses.A_REVERSE)
301301
stdscr.refresh()
302302

303303
The curses library also supports color on those terminals that provide it, The

Doc/howto/regex.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -917,7 +917,7 @@ module::
917917

918918
InternalDate = re.compile(r'INTERNALDATE "'
919919
r'(?P<day>[ 123][0-9])-(?P<mon>[A-Z][a-z][a-z])-'
920-
r'(?P<year>[0-9][0-9][0-9][0-9])'
920+
r'(?P<year>[0-9][0-9][0-9][0-9])'
921921
r' (?P<hour>[0-9][0-9]):(?P<min>[0-9][0-9]):(?P<sec>[0-9][0-9])'
922922
r' (?P<zonen>[-+])(?P<zoneh>[0-9][0-9])(?P<zonem>[0-9][0-9])'
923923
r'"')

Doc/howto/sockets.rst

+21-21
Original file line numberDiff line numberDiff line change
@@ -190,33 +190,33 @@ length message::
190190
'''
191191

192192
def __init__(self, sock=None):
193-
if sock is None:
194-
self.sock = socket.socket(
195-
socket.AF_INET, socket.SOCK_STREAM)
196-
else:
197-
self.sock = sock
193+
if sock is None:
194+
self.sock = socket.socket(
195+
socket.AF_INET, socket.SOCK_STREAM)
196+
else:
197+
self.sock = sock
198198

199199
def connect(self, host, port):
200-
self.sock.connect((host, port))
200+
self.sock.connect((host, port))
201201

202202
def mysend(self, msg):
203-
totalsent = 0
204-
while totalsent < MSGLEN:
205-
sent = self.sock.send(msg[totalsent:])
206-
if sent == 0:
207-
raise RuntimeError, \
208-
"socket connection broken"
209-
totalsent = totalsent + sent
203+
totalsent = 0
204+
while totalsent < MSGLEN:
205+
sent = self.sock.send(msg[totalsent:])
206+
if sent == 0:
207+
raise RuntimeError, \
208+
"socket connection broken"
209+
totalsent = totalsent + sent
210210

211211
def myreceive(self):
212-
msg = ''
213-
while len(msg) < MSGLEN:
214-
chunk = self.sock.recv(MSGLEN-len(msg))
215-
if chunk == '':
216-
raise RuntimeError, \
217-
"socket connection broken"
218-
msg = msg + chunk
219-
return msg
212+
msg = ''
213+
while len(msg) < MSGLEN:
214+
chunk = self.sock.recv(MSGLEN-len(msg))
215+
if chunk == '':
216+
raise RuntimeError, \
217+
"socket connection broken"
218+
msg = msg + chunk
219+
return msg
220220

221221
The sending code here is usable for almost any messaging scheme - in Python you
222222
send strings, and you can use ``len()`` to determine its length (even if it has

Doc/howto/unicode.rst

+34-34
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ For a while people just wrote programs that didn't display accents. I remember
3030
looking at Apple ][ BASIC programs, published in French-language publications in
3131
the mid-1980s, that had lines like these::
3232

33-
PRINT "FICHIER EST COMPLETE."
34-
PRINT "CARACTERE NON ACCEPTE."
33+
PRINT "FICHIER EST COMPLETE."
34+
PRINT "CARACTERE NON ACCEPTE."
3535

3636
Those messages should contain accents, and they just look wrong to someone who
3737
can read French.
@@ -89,11 +89,11 @@ standard, a code point is written using the notation U+12ca to mean the
8989
character with value 0x12ca (4810 decimal). The Unicode standard contains a lot
9090
of tables listing characters and their corresponding code points::
9191

92-
0061 'a'; LATIN SMALL LETTER A
93-
0062 'b'; LATIN SMALL LETTER B
94-
0063 'c'; LATIN SMALL LETTER C
95-
...
96-
007B '{'; LEFT CURLY BRACKET
92+
0061 'a'; LATIN SMALL LETTER A
93+
0062 'b'; LATIN SMALL LETTER B
94+
0063 'c'; LATIN SMALL LETTER C
95+
...
96+
007B '{'; LEFT CURLY BRACKET
9797

9898
Strictly, these definitions imply that it's meaningless to say 'this is
9999
character U+12ca'. U+12ca is a code point, which represents some particular
@@ -597,19 +597,19 @@ encoding and a list of Unicode strings will be returned, while passing an 8-bit
597597
path will return the 8-bit versions of the filenames. For example, assuming the
598598
default filesystem encoding is UTF-8, running the following program::
599599

600-
fn = u'filename\u4500abc'
601-
f = open(fn, 'w')
602-
f.close()
600+
fn = u'filename\u4500abc'
601+
f = open(fn, 'w')
602+
f.close()
603603

604-
import os
605-
print os.listdir('.')
606-
print os.listdir(u'.')
604+
import os
605+
print os.listdir('.')
606+
print os.listdir(u'.')
607607

608608
will produce the following output::
609609

610-
amk:~$ python t.py
611-
['.svn', 'filename\xe4\x94\x80abc', ...]
612-
[u'.svn', u'filename\u4500abc', ...]
610+
amk:~$ python t.py
611+
['.svn', 'filename\xe4\x94\x80abc', ...]
612+
[u'.svn', u'filename\u4500abc', ...]
613613

614614
The first list contains UTF-8-encoded filenames, and the second list contains
615615
the Unicode versions.
@@ -703,26 +703,26 @@ Version 1.02: posted August 16 2005. Corrects factual errors.
703703
- [ ] Unicode introduction
704704
- [ ] ASCII
705705
- [ ] Terms
706-
- [ ] Character
707-
- [ ] Code point
708-
- [ ] Encodings
709-
- [ ] Common encodings: ASCII, Latin-1, UTF-8
706+
- [ ] Character
707+
- [ ] Code point
708+
- [ ] Encodings
709+
- [ ] Common encodings: ASCII, Latin-1, UTF-8
710710
- [ ] Unicode Python type
711-
- [ ] Writing unicode literals
712-
- [ ] Obscurity: -U switch
713-
- [ ] Built-ins
714-
- [ ] unichr()
715-
- [ ] ord()
716-
- [ ] unicode() constructor
717-
- [ ] Unicode type
718-
- [ ] encode(), decode() methods
711+
- [ ] Writing unicode literals
712+
- [ ] Obscurity: -U switch
713+
- [ ] Built-ins
714+
- [ ] unichr()
715+
- [ ] ord()
716+
- [ ] unicode() constructor
717+
- [ ] Unicode type
718+
- [ ] encode(), decode() methods
719719
- [ ] Unicodedata module for character properties
720720
- [ ] I/O
721-
- [ ] Reading/writing Unicode data into files
722-
- [ ] Byte-order marks
723-
- [ ] Unicode filenames
721+
- [ ] Reading/writing Unicode data into files
722+
- [ ] Byte-order marks
723+
- [ ] Unicode filenames
724724
- [ ] Writing Unicode programs
725-
- [ ] Do everything in Unicode
726-
- [ ] Declaring source code encodings (PEP 263)
725+
- [ ] Do everything in Unicode
726+
- [ ] Declaring source code encodings (PEP 263)
727727
- [ ] Other issues
728-
- [ ] Building Python (UCS2, UCS4)
728+
- [ ] Building Python (UCS2, UCS4)

Doc/library/abc.rst

+6-6
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,15 @@ This module provides the following class:
4343
Register *subclass* as a "virtual subclass" of this ABC. For
4444
example::
4545

46-
from abc import ABCMeta
46+
from abc import ABCMeta
4747

48-
class MyABC:
49-
__metaclass__ = ABCMeta
48+
class MyABC:
49+
__metaclass__ = ABCMeta
5050

51-
MyABC.register(tuple)
51+
MyABC.register(tuple)
5252

53-
assert issubclass(tuple, MyABC)
54-
assert isinstance((), MyABC)
53+
assert issubclass(tuple, MyABC)
54+
assert isinstance((), MyABC)
5555

5656
You can also override this method in an abstract base class:
5757

Doc/library/collections.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ ABC Inherits Abstract Methods Mixin
5353
:class:`Hashable` ``__hash__``
5454
:class:`Iterable` ``__iter__``
5555
:class:`Iterator` :class:`Iterable` ``__next__`` ``__iter__``
56-
:class:`Sized` ``__len__``
56+
:class:`Sized` ``__len__``
5757
:class:`Callable` ``__call__``
5858

5959
:class:`Sequence` :class:`Sized`, ``__getitem__`` ``__contains__``. ``__iter__``, ``__reversed__``.
@@ -80,7 +80,7 @@ ABC Inherits Abstract Methods Mixin
8080
:class:`MutableMapping` :class:`Mapping` ``__getitem__`` Inherited Mapping methods and
8181
``__setitem__``, ``pop``, ``popitem``, ``clear``, ``update``,
8282
``__delitem__``, and ``setdefault``
83-
``__iter__``, and
83+
``__iter__``, and
8484
``__len__``
8585

8686
:class:`MappingView` :class:`Sized` ``__len__``
@@ -96,7 +96,7 @@ particular functionality, for example::
9696

9797
size = None
9898
if isinstance(myvar, collections.Sized):
99-
size = len(myvar)
99+
size = len(myvar)
100100

101101
Several of the ABCs are also useful as mixins that make it easier to develop
102102
classes supporting container APIs. For example, to write a class supporting

Doc/library/gettext.rst

+9-12
Original file line numberDiff line numberDiff line change
@@ -648,10 +648,9 @@ translation until later. A classic example is::
648648

649649
animals = ['mollusk',
650650
'albatross',
651-
'rat',
652-
'penguin',
653-
'python',
654-
]
651+
'rat',
652+
'penguin',
653+
'python', ]
655654
# ...
656655
for a in animals:
657656
print a
@@ -666,10 +665,9 @@ Here is one way you can handle this situation::
666665

667666
animals = [_('mollusk'),
668667
_('albatross'),
669-
_('rat'),
670-
_('penguin'),
671-
_('python'),
672-
]
668+
_('rat'),
669+
_('penguin'),
670+
_('python'), ]
673671

674672
del _
675673

@@ -692,10 +690,9 @@ Another way to handle this is with the following example::
692690

693691
animals = [N_('mollusk'),
694692
N_('albatross'),
695-
N_('rat'),
696-
N_('penguin'),
697-
N_('python'),
698-
]
693+
N_('rat'),
694+
N_('penguin'),
695+
N_('python'), ]
699696

700697
# ...
701698
for a in animals:

Doc/library/multiprocessing.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Windows.
3737
>>> from multiprocessing import Pool
3838
>>> p = Pool(5)
3939
>>> def f(x):
40-
... return x*x
40+
... return x*x
4141
...
4242
>>> p.map(f, [1,2,3])
4343
Process PoolWorker-1:

Doc/library/optparse.rst

+6-6
Original file line numberDiff line numberDiff line change
@@ -548,8 +548,8 @@ Continuing with the parser defined above, adding an
548548
:class:`OptionGroup` to a parser is easy::
549549

550550
group = OptionGroup(parser, "Dangerous Options",
551-
"Caution: use these options at your own risk. "
552-
"It is believed that some of them bite.")
551+
"Caution: use these options at your own risk. "
552+
"It is believed that some of them bite.")
553553
group.add_option("-g", action="store_true", help="Group option.")
554554
parser.add_option_group(group)
555555

@@ -563,12 +563,12 @@ This would result in the following help output::
563563
-q, --quiet be vewwy quiet (I'm hunting wabbits)
564564
-fFILE, --file=FILE write output to FILE
565565
-mMODE, --mode=MODE interaction mode: one of 'novice', 'intermediate'
566-
[default], 'expert'
566+
[default], 'expert'
567567

568568
Dangerous Options:
569-
Caution: use of these options is at your own risk. It is believed that
570-
some of them bite.
571-
-g Group option.
569+
Caution: use of these options is at your own risk. It is believed that
570+
some of them bite.
571+
-g Group option.
572572

573573
.. _optparse-printing-version-string:
574574

Doc/library/sched.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ Example::
5858
... print time.time()
5959
... Timer(5, print_time, ()).start()
6060
... Timer(10, print_time, ()).start()
61-
... time.sleep(11) # sleep while time-delay events execute
61+
... time.sleep(11) # sleep while time-delay events execute
6262
... print time.time()
6363
...
6464
>>> print_some_times()

0 commit comments

Comments
 (0)