Skip to content

Commit aa06900

Browse files
committed
Merged revisions 68750,68776-68777,68811,68842,68859 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r68750 | benjamin.peterson | 2009-01-18 16:47:04 -0600 (Sun, 18 Jan 2009) | 1 line fix encoding cookie case ........ r68776 | benjamin.peterson | 2009-01-19 10:17:54 -0600 (Mon, 19 Jan 2009) | 1 line move BufferedIOBase into the base class section ........ r68777 | benjamin.peterson | 2009-01-19 10:18:27 -0600 (Mon, 19 Jan 2009) | 1 line add email address ........ r68811 | benjamin.peterson | 2009-01-20 12:58:27 -0600 (Tue, 20 Jan 2009) | 1 line fix url ........ r68842 | andrew.kuchling | 2009-01-20 20:16:26 -0600 (Tue, 20 Jan 2009) | 1 line Markup fixes ........ r68859 | georg.brandl | 2009-01-22 12:29:28 -0600 (Thu, 22 Jan 2009) | 2 lines Clarify wording. ........
1 parent 83b9730 commit aa06900

6 files changed

Lines changed: 64 additions & 62 deletions

File tree

Doc/documenting/markup.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,8 @@ Inline markup
285285
As said before, Sphinx uses interpreted text roles to insert semantic markup in
286286
documents.
287287

288-
Variable names are an exception, they should be marked simply with ``*var*``.
288+
Names of local variables, such as function/method arguments, are an exception,
289+
they should be marked simply with ``*var*``.
289290

290291
For all other roles, you have to write ``:rolename:`content```.
291292

@@ -310,7 +311,7 @@ a matching identifier is found:
310311

311312
.. describe:: data
312313

313-
The name of a module-level variable.
314+
The name of a module-level variable or constant.
314315

315316
.. describe:: const
316317

Doc/library/io.rst

Lines changed: 53 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -328,59 +328,6 @@ I/O Base Classes
328328
``len(b)``, since if the write fails, an :exc:`IOError` will be raised).
329329

330330

331-
Raw File I/O
332-
------------
333-
334-
.. class:: FileIO(name[, mode])
335-
336-
:class:`FileIO` represents a file containing bytes data. It implements
337-
the :class:`RawIOBase` interface (and therefore the :class:`IOBase`
338-
interface, too).
339-
340-
The *mode* can be ``'r'``, ``'w'`` or ``'a'`` for reading (default), writing,
341-
or appending. The file will be created if it doesn't exist when opened for
342-
writing or appending; it will be truncated when opened for writing. Add a
343-
``'+'`` to the mode to allow simultaneous reading and writing.
344-
345-
In addition to the attributes and methods from :class:`IOBase` and
346-
:class:`RawIOBase`, :class:`FileIO` provides the following data
347-
attributes and methods:
348-
349-
.. attribute:: mode
350-
351-
The mode as given in the constructor.
352-
353-
.. attribute:: name
354-
355-
The file name. This is the file descriptor of the file when no name is
356-
given in the constructor.
357-
358-
.. method:: read([n])
359-
360-
Read and return at most *n* bytes. Only one system call is made, so it is
361-
possible that less data than was requested is returned. Use :func:`len`
362-
on the returned bytes object to see how many bytes were actually returned.
363-
(In non-blocking mode, ``None`` is returned when no data is available.)
364-
365-
.. method:: readall()
366-
367-
Read and return the entire file's contents in a single bytes object. As
368-
much as immediately available is returned in non-blocking mode. If the
369-
EOF has been reached, ``b''`` is returned.
370-
371-
.. method:: write(b)
372-
373-
Write the bytes or bytearray object, *b*, to the file, and return
374-
the number actually written. Only one system call is made, so it
375-
is possible that only some of the data is written.
376-
377-
Note that the inherited ``readinto()`` method should not be used on
378-
:class:`FileIO` objects.
379-
380-
381-
Buffered Streams
382-
----------------
383-
384331
.. class:: BufferedIOBase
385332

386333
Base class for streams that support buffering. It inherits :class:`IOBase`.
@@ -438,6 +385,59 @@ Buffered Streams
438385
underlying raw stream cannot accept more data at the moment.
439386

440387

388+
Raw File I/O
389+
------------
390+
391+
.. class:: FileIO(name[, mode])
392+
393+
:class:`FileIO` represents a file containing bytes data. It implements
394+
the :class:`RawIOBase` interface (and therefore the :class:`IOBase`
395+
interface, too).
396+
397+
The *mode* can be ``'r'``, ``'w'`` or ``'a'`` for reading (default), writing,
398+
or appending. The file will be created if it doesn't exist when opened for
399+
writing or appending; it will be truncated when opened for writing. Add a
400+
``'+'`` to the mode to allow simultaneous reading and writing.
401+
402+
In addition to the attributes and methods from :class:`IOBase` and
403+
:class:`RawIOBase`, :class:`FileIO` provides the following data
404+
attributes and methods:
405+
406+
.. attribute:: mode
407+
408+
The mode as given in the constructor.
409+
410+
.. attribute:: name
411+
412+
The file name. This is the file descriptor of the file when no name is
413+
given in the constructor.
414+
415+
.. method:: read([n])
416+
417+
Read and return at most *n* bytes. Only one system call is made, so it is
418+
possible that less data than was requested is returned. Use :func:`len`
419+
on the returned bytes object to see how many bytes were actually returned.
420+
(In non-blocking mode, ``None`` is returned when no data is available.)
421+
422+
.. method:: readall()
423+
424+
Read and return the entire file's contents in a single bytes object. As
425+
much as immediately available is returned in non-blocking mode. If the
426+
EOF has been reached, ``b''`` is returned.
427+
428+
.. method:: write(b)
429+
430+
Write the bytes or bytearray object, *b*, to the file, and return
431+
the number actually written. Only one system call is made, so it
432+
is possible that only some of the data is written.
433+
434+
Note that the inherited ``readinto()`` method should not be used on
435+
:class:`FileIO` objects.
436+
437+
438+
Buffered Streams
439+
----------------
440+
441441
.. class:: BytesIO([initial_bytes])
442442

443443
A stream implementation using an in-memory bytes buffer. It inherits

Doc/library/subprocess.rst

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,11 +160,12 @@ This module also defines four shortcut functions:
160160

161161
Run command with arguments and return its output as a byte string.
162162

163-
If the exit code was non-zero it raises a CalledProcessError. The
164-
CalledProcessError object will have the return code in the returncode
165-
attribute and output in the output attribute.
163+
If the exit code was non-zero it raises a :exc:`CalledProcessError`. The
164+
:exc:`CalledProcessError` object will have the return code in the
165+
:attr:`returncode`
166+
attribute and output in the :attr:`output` attribute.
166167

167-
The arguments are the same as for the Popen constructor. Example:
168+
The arguments are the same as for the :class:`Popen` constructor. Example:
168169

169170
>>> subprocess.check_output(["ls", "-l", "/dev/null"])
170171
'crw-rw-rw- 1 root root 1, 3 Oct 18 2007 /dev/null\n'

Doc/library/symtable.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
:synopsis: Interface to the compiler's internal symbol tables.
66

77
.. moduleauthor:: Jeremy Hylton <jeremy@alum.mit.edu>
8-
.. sectionauthor:: Benjamin Peterson
8+
.. sectionauthor:: Benjamin Peterson <benjamin@python.org>
99

1010

1111
Symbol tables are generated by the compiler from AST just before bytecode is

Lib/heapq.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# -*- coding: Latin-1 -*-
1+
# -*- coding: latin-1 -*-
22

33
"""Heap queue algorithm (a.k.a. priority queue).
44

Objects/stringlib/fastsearch.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
/* fast search/count implementation, based on a mix between boyer-
77
moore and horspool, with a few more bells and whistles on the top.
8-
for some more background, see: http://effbot.org/stringlib */
8+
for some more background, see: http://effbot.org/stringlib.htm */
99

1010
/* note: fastsearch may access s[n], which isn't a problem when using
1111
Python's ordinary string types, but may cause problems if you're

0 commit comments

Comments
 (0)