diff options
author | Benjamin Peterson <benjamin@python.org> | 2009-01-23 03:26:36 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2009-01-23 03:26:36 (GMT) |
commit | aa069003471ab31c896cec807d7121c6a457aa0e (patch) | |
tree | 717a52bb9f7fbc44b8e0a923f6daf818d19c8313 | |
parent | 83b97306ae902d68baaf55b10d0be2a78150f41f (diff) | |
download | cpython-aa069003471ab31c896cec807d7121c6a457aa0e.zip cpython-aa069003471ab31c896cec807d7121c6a457aa0e.tar.gz cpython-aa069003471ab31c896cec807d7121c6a457aa0e.tar.bz2 |
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.
........
-rw-r--r-- | Doc/documenting/markup.rst | 5 | ||||
-rw-r--r-- | Doc/library/io.rst | 106 | ||||
-rw-r--r-- | Doc/library/subprocess.rst | 9 | ||||
-rw-r--r-- | Doc/library/symtable.rst | 2 | ||||
-rw-r--r-- | Lib/heapq.py | 2 | ||||
-rw-r--r-- | Objects/stringlib/fastsearch.h | 2 |
6 files changed, 64 insertions, 62 deletions
diff --git a/Doc/documenting/markup.rst b/Doc/documenting/markup.rst index 82c75cf..a919468 100644 --- a/Doc/documenting/markup.rst +++ b/Doc/documenting/markup.rst @@ -285,7 +285,8 @@ Inline markup As said before, Sphinx uses interpreted text roles to insert semantic markup in documents. -Variable names are an exception, they should be marked simply with ``*var*``. +Names of local variables, such as function/method arguments, are an exception, +they should be marked simply with ``*var*``. For all other roles, you have to write ``:rolename:`content```. @@ -310,7 +311,7 @@ a matching identifier is found: .. describe:: data - The name of a module-level variable. + The name of a module-level variable or constant. .. describe:: const diff --git a/Doc/library/io.rst b/Doc/library/io.rst index 45c99b5..df0e7e9 100644 --- a/Doc/library/io.rst +++ b/Doc/library/io.rst @@ -328,59 +328,6 @@ I/O Base Classes ``len(b)``, since if the write fails, an :exc:`IOError` will be raised). -Raw File I/O ------------- - -.. class:: FileIO(name[, mode]) - - :class:`FileIO` represents a file containing bytes data. It implements - the :class:`RawIOBase` interface (and therefore the :class:`IOBase` - interface, too). - - The *mode* can be ``'r'``, ``'w'`` or ``'a'`` for reading (default), writing, - or appending. The file will be created if it doesn't exist when opened for - writing or appending; it will be truncated when opened for writing. Add a - ``'+'`` to the mode to allow simultaneous reading and writing. - - In addition to the attributes and methods from :class:`IOBase` and - :class:`RawIOBase`, :class:`FileIO` provides the following data - attributes and methods: - - .. attribute:: mode - - The mode as given in the constructor. - - .. attribute:: name - - The file name. This is the file descriptor of the file when no name is - given in the constructor. - - .. method:: read([n]) - - Read and return at most *n* bytes. Only one system call is made, so it is - possible that less data than was requested is returned. Use :func:`len` - on the returned bytes object to see how many bytes were actually returned. - (In non-blocking mode, ``None`` is returned when no data is available.) - - .. method:: readall() - - Read and return the entire file's contents in a single bytes object. As - much as immediately available is returned in non-blocking mode. If the - EOF has been reached, ``b''`` is returned. - - .. method:: write(b) - - Write the bytes or bytearray object, *b*, to the file, and return - the number actually written. Only one system call is made, so it - is possible that only some of the data is written. - - Note that the inherited ``readinto()`` method should not be used on - :class:`FileIO` objects. - - -Buffered Streams ----------------- - .. class:: BufferedIOBase Base class for streams that support buffering. It inherits :class:`IOBase`. @@ -438,6 +385,59 @@ Buffered Streams underlying raw stream cannot accept more data at the moment. +Raw File I/O +------------ + +.. class:: FileIO(name[, mode]) + + :class:`FileIO` represents a file containing bytes data. It implements + the :class:`RawIOBase` interface (and therefore the :class:`IOBase` + interface, too). + + The *mode* can be ``'r'``, ``'w'`` or ``'a'`` for reading (default), writing, + or appending. The file will be created if it doesn't exist when opened for + writing or appending; it will be truncated when opened for writing. Add a + ``'+'`` to the mode to allow simultaneous reading and writing. + + In addition to the attributes and methods from :class:`IOBase` and + :class:`RawIOBase`, :class:`FileIO` provides the following data + attributes and methods: + + .. attribute:: mode + + The mode as given in the constructor. + + .. attribute:: name + + The file name. This is the file descriptor of the file when no name is + given in the constructor. + + .. method:: read([n]) + + Read and return at most *n* bytes. Only one system call is made, so it is + possible that less data than was requested is returned. Use :func:`len` + on the returned bytes object to see how many bytes were actually returned. + (In non-blocking mode, ``None`` is returned when no data is available.) + + .. method:: readall() + + Read and return the entire file's contents in a single bytes object. As + much as immediately available is returned in non-blocking mode. If the + EOF has been reached, ``b''`` is returned. + + .. method:: write(b) + + Write the bytes or bytearray object, *b*, to the file, and return + the number actually written. Only one system call is made, so it + is possible that only some of the data is written. + + Note that the inherited ``readinto()`` method should not be used on + :class:`FileIO` objects. + + +Buffered Streams +---------------- + .. class:: BytesIO([initial_bytes]) A stream implementation using an in-memory bytes buffer. It inherits diff --git a/Doc/library/subprocess.rst b/Doc/library/subprocess.rst index da3d007..8a88c0f 100644 --- a/Doc/library/subprocess.rst +++ b/Doc/library/subprocess.rst @@ -160,11 +160,12 @@ This module also defines four shortcut functions: Run command with arguments and return its output as a byte string. - If the exit code was non-zero it raises a CalledProcessError. The - CalledProcessError object will have the return code in the returncode - attribute and output in the output attribute. + If the exit code was non-zero it raises a :exc:`CalledProcessError`. The + :exc:`CalledProcessError` object will have the return code in the + :attr:`returncode` + attribute and output in the :attr:`output` attribute. - The arguments are the same as for the Popen constructor. Example: + The arguments are the same as for the :class:`Popen` constructor. Example: >>> subprocess.check_output(["ls", "-l", "/dev/null"]) 'crw-rw-rw- 1 root root 1, 3 Oct 18 2007 /dev/null\n' diff --git a/Doc/library/symtable.rst b/Doc/library/symtable.rst index ee24823..28306e6 100644 --- a/Doc/library/symtable.rst +++ b/Doc/library/symtable.rst @@ -5,7 +5,7 @@ :synopsis: Interface to the compiler's internal symbol tables. .. moduleauthor:: Jeremy Hylton <jeremy@alum.mit.edu> -.. sectionauthor:: Benjamin Peterson +.. sectionauthor:: Benjamin Peterson <benjamin@python.org> Symbol tables are generated by the compiler from AST just before bytecode is diff --git a/Lib/heapq.py b/Lib/heapq.py index 24997bf..192e982 100644 --- a/Lib/heapq.py +++ b/Lib/heapq.py @@ -1,4 +1,4 @@ -# -*- coding: Latin-1 -*- +# -*- coding: latin-1 -*- """Heap queue algorithm (a.k.a. priority queue). diff --git a/Objects/stringlib/fastsearch.h b/Objects/stringlib/fastsearch.h index 8f79c36..23bccfb 100644 --- a/Objects/stringlib/fastsearch.h +++ b/Objects/stringlib/fastsearch.h @@ -5,7 +5,7 @@ /* fast search/count implementation, based on a mix between boyer- moore and horspool, with a few more bells and whistles on the top. - for some more background, see: http://effbot.org/stringlib */ + for some more background, see: http://effbot.org/stringlib.htm */ /* note: fastsearch may access s[n], which isn't a problem when using Python's ordinary string types, but may cause problems if you're |