Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
bfdcd436
Commit
bfdcd436
authored
Oct 13, 2013
by
Serhiy Storchaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #18758: Fixed and improved cross-references.
parent
24201d49
Changes
40
Hide whitespace changes
Inline
Side-by-side
Showing
40 changed files
with
145 additions
and
126 deletions
+145
-126
Doc/faq/design.rst
Doc/faq/design.rst
+2
-1
Doc/howto/unicode.rst
Doc/howto/unicode.rst
+6
-4
Doc/howto/urllib2.rst
Doc/howto/urllib2.rst
+1
-1
Doc/library/2to3.rst
Doc/library/2to3.rst
+2
-2
Doc/library/_thread.rst
Doc/library/_thread.rst
+1
-1
Doc/library/abc.rst
Doc/library/abc.rst
+9
-9
Doc/library/asyncore.rst
Doc/library/asyncore.rst
+4
-4
Doc/library/audioop.rst
Doc/library/audioop.rst
+1
-1
Doc/library/calendar.rst
Doc/library/calendar.rst
+5
-4
Doc/library/chunk.rst
Doc/library/chunk.rst
+3
-2
Doc/library/code.rst
Doc/library/code.rst
+7
-7
Doc/library/codecs.rst
Doc/library/codecs.rst
+13
-11
Doc/library/collections.abc.rst
Doc/library/collections.abc.rst
+3
-2
Doc/library/collections.rst
Doc/library/collections.rst
+3
-3
Doc/library/configparser.rst
Doc/library/configparser.rst
+2
-1
Doc/library/dbm.rst
Doc/library/dbm.rst
+3
-2
Doc/library/difflib.rst
Doc/library/difflib.rst
+11
-9
Doc/library/exceptions.rst
Doc/library/exceptions.rst
+5
-6
Doc/library/fileinput.rst
Doc/library/fileinput.rst
+6
-5
Doc/library/ftplib.rst
Doc/library/ftplib.rst
+2
-2
Doc/library/http.server.rst
Doc/library/http.server.rst
+3
-3
Doc/library/imaplib.rst
Doc/library/imaplib.rst
+3
-2
Doc/library/inspect.rst
Doc/library/inspect.rst
+3
-2
Doc/library/io.rst
Doc/library/io.rst
+2
-2
Doc/library/itertools.rst
Doc/library/itertools.rst
+3
-3
Doc/library/mailbox.rst
Doc/library/mailbox.rst
+2
-2
Doc/library/math.rst
Doc/library/math.rst
+5
-4
Doc/library/msilib.rst
Doc/library/msilib.rst
+3
-2
Doc/library/ossaudiodev.rst
Doc/library/ossaudiodev.rst
+2
-2
Doc/library/pyexpat.rst
Doc/library/pyexpat.rst
+5
-5
Doc/library/shelve.rst
Doc/library/shelve.rst
+2
-2
Doc/library/socket.rst
Doc/library/socket.rst
+1
-1
Doc/library/socketserver.rst
Doc/library/socketserver.rst
+7
-7
Doc/library/stat.rst
Doc/library/stat.rst
+2
-2
Doc/library/telnetlib.rst
Doc/library/telnetlib.rst
+1
-1
Doc/library/time.rst
Doc/library/time.rst
+2
-2
Doc/library/unittest.mock.rst
Doc/library/unittest.mock.rst
+4
-4
Doc/library/warnings.rst
Doc/library/warnings.rst
+1
-1
Doc/library/zipfile.rst
Doc/library/zipfile.rst
+3
-2
Misc/NEWS
Misc/NEWS
+2
-0
No files found.
Doc/faq/design.rst
View file @
bfdcd436
...
@@ -634,7 +634,8 @@ Python 2.6 adds an :mod:`abc` module that lets you define Abstract Base Classes
...
@@ -634,7 +634,8 @@ Python 2.6 adds an :mod:`abc` module that lets you define Abstract Base Classes
(ABCs). You can then use :func:`isinstance` and :func:`issubclass` to check
(ABCs). You can then use :func:`isinstance` and :func:`issubclass` to check
whether an instance or a class implements a particular ABC. The
whether an instance or a class implements a particular ABC. The
:mod:`collections.abc` module defines a set of useful ABCs such as
:mod:`collections.abc` module defines a set of useful ABCs such as
:class:`Iterable`, :class:`Container`, and :class:`MutableMapping`.
:class:`~collections.abc.Iterable`, :class:`~collections.abc.Container`, and
:class:`~collections.abc.MutableMapping`.
For Python, many of the advantages of interface specifications can be obtained
For Python, many of the advantages of interface specifications can be obtained
by an appropriate test discipline for components. There is also a tool,
by an appropriate test discipline for components. There is also a tool,
...
...
Doc/howto/unicode.rst
View file @
bfdcd436
...
@@ -531,9 +531,10 @@ The solution would be to use the low-level decoding interface to catch the case
...
@@ -531,9 +531,10 @@ The solution would be to use the low-level decoding interface to catch the case
of partial coding sequences. The work of implementing this has already been
of partial coding sequences. The work of implementing this has already been
done for you: the built-in :func:`open` function can return a file-like object
done for you: the built-in :func:`open` function can return a file-like object
that assumes the file's contents are in a specified encoding and accepts Unicode
that assumes the file's contents are in a specified encoding and accepts Unicode
parameters for methods such as :meth:`read` and :meth:`write`. This works through
parameters for methods such as :meth:`~io.TextIOBase.read` and
:func:`open`\'s *encoding* and *errors* parameters which are interpreted just
:meth:`~io.TextIOBase.write`. This works through:func:`open`\'s *encoding* and
like those in :meth:`str.encode` and :meth:`bytes.decode`.
*errors* parameters which are interpreted just like those in :meth:`str.encode`
and :meth:`bytes.decode`.
Reading Unicode from a file is therefore simple::
Reading Unicode from a file is therefore simple::
...
@@ -656,7 +657,8 @@ encodings, taking a stream that returns data in encoding #1
...
@@ -656,7 +657,8 @@ encodings, taking a stream that returns data in encoding #1
and behaving like a stream returning data in encoding #2.
and behaving like a stream returning data in encoding #2.
For example, if you have an input file *f* that's in Latin-1, you
For example, if you have an input file *f* that's in Latin-1, you
can wrap it with a :class:`StreamRecoder` to return bytes encoded in UTF-8::
can wrap it with a :class:`~codecs.StreamRecoder` to return bytes encoded in
UTF-8::
new_f = codecs.StreamRecoder(f,
new_f = codecs.StreamRecoder(f,
# en/decoder: used by read() to encode its results and
# en/decoder: used by read() to encode its results and
...
...
Doc/howto/urllib2.rst
View file @
bfdcd436
...
@@ -57,7 +57,7 @@ The simplest way to use urllib.request is as follows::
...
@@ -57,7 +57,7 @@ The simplest way to use urllib.request is as follows::
html = response.read()
html = response.read()
If you wish to retrieve a resource via URL and store it in a temporary location,
If you wish to retrieve a resource via URL and store it in a temporary location,
you can do so via the :func:`urlretrieve` function::
you can do so via the :func:`
~urllib.request.
urlretrieve` function::
import urllib.request
import urllib.request
local_filename, headers = urllib.request.urlretrieve('http://python.org/')
local_filename, headers = urllib.request.urlretrieve('http://python.org/')
...
...
Doc/library/2to3.rst
View file @
bfdcd436
...
@@ -290,11 +290,11 @@ and off individually. They are described here in more detail.
...
@@ -290,11 +290,11 @@ and off individually. They are described here in more detail.
Converts the use of iterator's :meth:`~iterator.next` methods to the
Converts the use of iterator's :meth:`~iterator.next` methods to the
:func:`next` function. It also renames :meth:`next` methods to
:func:`next` function. It also renames :meth:`next` methods to
:meth:`~
object
.__next__`.
:meth:`~
iterator
.__next__`.
.. 2to3fixer:: nonzero
.. 2to3fixer:: nonzero
Renames :meth:`
~object.
__nonzero__` to :meth:`~object.__bool__`.
Renames :meth:`__nonzero__` to :meth:`~object.__bool__`.
.. 2to3fixer:: numliterals
.. 2to3fixer:: numliterals
...
...
Doc/library/_thread.rst
View file @
bfdcd436
...
@@ -177,7 +177,7 @@ In addition to these methods, lock objects can also be used via the
...
@@ -177,7 +177,7 @@ In addition to these methods, lock objects can also be used via the
equivalent to calling :func:`_thread.exit`.
equivalent to calling :func:`_thread.exit`.
* Not all built-in functions that may block waiting for I/O allow other threads
* Not all built-in functions that may block waiting for I/O allow other threads
to run. (The most popular ones (:func:`time.sleep`, :meth:`
file
.read`,
to run. (The most popular ones (:func:`time.sleep`, :meth:`
io.FileIO
.read`,
:func:`select.select`) work as expected.)
:func:`select.select`) work as expected.)
* It is not possible to interrupt the :meth:`acquire` method on a lock --- the
* It is not possible to interrupt the :meth:`acquire` method on a lock --- the
...
...
Doc/library/abc.rst
View file @
bfdcd436
...
@@ -110,19 +110,19 @@ This module provides the following class:
...
@@ -110,19 +110,19 @@ This module provides the following class:
MyIterable.register(Foo)
MyIterable.register(Foo)
The ABC ``MyIterable`` defines the standard iterable method,
The ABC ``MyIterable`` defines the standard iterable method,
:meth:`
__iter__`, as an abstract method. The implementation given here ca
n
:meth:`
~iterator.__iter__`, as an abstract method. The implementation give
n
still be called from subclasses. The :meth:`get_iterator` method is also
here can still be called from subclasses. The :meth:`get_iterator` method
part of the ``MyIterable`` abstract base class, but it does not have to b
e
is also part of the ``MyIterable`` abstract base class, but it does not hav
e
overridden in non-abstract derived classes.
to be
overridden in non-abstract derived classes.
The :meth:`__subclasshook__` class method defined here says that any class
The :meth:`__subclasshook__` class method defined here says that any class
that has an :meth:`
__iter__` method in its :attr:`__dict__` (or in that of
that has an :meth:`
~iterator.__iter__` method in its
one of its base classes, accessed via the :attr:`__mro__` list) is
:attr:`~object.__dict__` (or in that of one of its base classes, accessed
considered a ``MyIterable`` too.
via the :attr:`~class.__mro__` list) is
considered a ``MyIterable`` too.
Finally, the last line makes ``Foo`` a virtual subclass of ``MyIterable``,
Finally, the last line makes ``Foo`` a virtual subclass of ``MyIterable``,
even though it does not define an :meth:`
__iter__` method (it uses the
even though it does not define an :meth:`
~iterator.__iter__` method (it uses
old-style iterable protocol, defined in terms of :meth:`__len__` and
the
old-style iterable protocol, defined in terms of :meth:`__len__` and
:meth:`__getitem__`). Note that this will not make ``get_iterator``
:meth:`__getitem__`). Note that this will not make ``get_iterator``
available as a method of ``Foo``, so it is provided separately.
available as a method of ``Foo``, so it is provided separately.
...
...
Doc/library/asyncore.rst
View file @
bfdcd436
...
@@ -53,10 +53,10 @@ any that have been added to the map during asynchronous service) is closed.
...
@@ -53,10 +53,10 @@ any that have been added to the map during asynchronous service) is closed.
channels have been closed. All arguments are optional. The *count*
channels have been closed. All arguments are optional. The *count*
parameter defaults to None, resulting in the loop terminating only when all
parameter defaults to None, resulting in the loop terminating only when all
channels have been closed. The *timeout* argument sets the timeout
channels have been closed. The *timeout* argument sets the timeout
parameter for the appropriate :func:`
select` or :func:`poll` call, measured
parameter for the appropriate :func:`
~select.select` or :func:`~select.poll`
in seconds; the default is 30 seconds. The *use_poll* parameter, if true,
call, measured in seconds; the default is 30 seconds. The *use_poll*
indicates that :func:`poll` should be used in preference to :func:`select`
parameter, if true, indicates that :func:`~select.poll` should be used in
(the default is ``False``).
preference to :func:`~select.select`
(the default is ``False``).
The *map* parameter is a dictionary whose items are the channels to watch.
The *map* parameter is a dictionary whose items are the channels to watch.
As channels are closed they are deleted from their map. If *map* is
As channels are closed they are deleted from their map. If *map* is
...
...
Doc/library/audioop.rst
View file @
bfdcd436
...
@@ -241,7 +241,7 @@ to be stateless (i.e. to be able to tolerate packet loss) you should not only
...
@@ -241,7 +241,7 @@ to be stateless (i.e. to be able to tolerate packet loss) you should not only
transmit the data but also the state. Note that you should send the *initial*
transmit the data but also the state. Note that you should send the *initial*
state (the one you passed to :func:`lin2adpcm`) along to the decoder, not the
state (the one you passed to :func:`lin2adpcm`) along to the decoder, not the
final state (as returned by the coder). If you want to use
final state (as returned by the coder). If you want to use
:
func:`struct.s
truct` to store the state in binary you can code the first
:
class:`struct.S
truct` to store the state in binary you can code the first
element (the predicted value) in 16 bits and the second (the delta index) in 8.
element (the predicted value) in 16 bits and the second (the delta index) in 8.
The ADPCM coders have never been tried against other ADPCM coders, only against
The ADPCM coders have never been tried against other ADPCM coders, only against
...
...
Doc/library/calendar.rst
View file @
bfdcd436
...
@@ -272,10 +272,11 @@ For simple text calendars this module provides the following functions.
...
@@ -272,10 +272,11 @@ For simple text calendars this module provides the following functions.
.. function:: timegm(tuple)
.. function:: timegm(tuple)
An unrelated but handy function that takes a time tuple such as returned by the
An unrelated but handy function that takes a time tuple such as returned by
:func:`gmtime` function in the :mod:`time` module, and returns the corresponding
the :func:`~time.gmtime` function in the :mod:`time` module, and returns the
Unix timestamp value, assuming an epoch of 1970, and the POSIX encoding. In
corresponding Unix timestamp value, assuming an epoch of 1970, and the POSIX
fact, :func:`time.gmtime` and :func:`timegm` are each others' inverse.
encoding. In fact, :func:`time.gmtime` and :func:`timegm` are each others'
inverse.
The :mod:`calendar` module exports the following data attributes:
The :mod:`calendar` module exports the following data attributes:
...
...
Doc/library/chunk.rst
View file @
bfdcd436
...
@@ -54,8 +54,9 @@ instance will fail with a :exc:`EOFError` exception.
...
@@ -54,8 +54,9 @@ instance will fail with a :exc:`EOFError` exception.
Class which represents a chunk. The *file* argument is expected to be a
Class which represents a chunk. The *file* argument is expected to be a
file-like object. An instance of this class is specifically allowed. The
file-like object. An instance of this class is specifically allowed. The
only method that is needed is :meth:`read`. If the methods :meth:`seek` and
only method that is needed is :meth:`~io.IOBase.read`. If the methods
:meth:`tell` are present and don't raise an exception, they are also used.
:meth:`~io.IOBase.seek` and :meth:`~io.IOBase.tell` are present and don't
raise an exception, they are also used.
If these methods are present and raise an exception, they are expected to not
If these methods are present and raise an exception, they are expected to not
have altered the object. If the optional argument *align* is true, chunks
have altered the object. If the optional argument *align* is true, chunks
are assumed to be aligned on 2-byte boundaries. If *align* is false, no
are assumed to be aligned on 2-byte boundaries. If *align* is false, no
...
...
Doc/library/code.rst
View file @
bfdcd436
...
@@ -29,13 +29,13 @@ build applications which provide an interactive interpreter prompt.
...
@@ -29,13 +29,13 @@ build applications which provide an interactive interpreter prompt.
.. function:: interact(banner=None, readfunc=None, local=None)
.. function:: interact(banner=None, readfunc=None, local=None)
Convenience function to run a read-eval-print loop. This creates a new
instance
Convenience function to run a read-eval-print loop. This creates a new
of :class:`InteractiveConsole` and sets *readfunc* to be used as the
instance of :class:`InteractiveConsole` and sets *readfunc* to be used as
:meth:`raw_input` method, if provided. If *local* is provided, it is passed to
the :meth:`InteractiveConsole.raw_input` method, if provided. If *local* is
the :class:`InteractiveConsole` constructor for use as the default namespace
for
provided, it is passed to the :class:`InteractiveConsole` constructor
for
the interpreter loop. The :meth:`interact` method of the instance is then run
use as the default namespace for the interpreter loop. The :meth:`interact`
with *banner* passed as the banner to use, if provided. The console object is
method of the instance is then run with *banner* passed as the banner to
discarded after use.
use, if provided. The console object is
discarded after use.
.. function:: compile_command(source, filename="<input>", symbol="single")
.. function:: compile_command(source, filename="<input>", symbol="single")
...
...
Doc/library/codecs.rst
View file @
bfdcd436
...
@@ -65,9 +65,9 @@ It defines the following functions:
...
@@ -65,9 +65,9 @@ It defines the following functions:
The various functions or classes take the following arguments:
The various functions or classes take the following arguments:
*encode* and *decode*: These must be functions or methods which have the same
*encode* and *decode*: These must be functions or methods which have the same
interface as the :meth:`
encode`/:meth:`decode` methods of Codec instances (see
interface as the :meth:`
~Codec.encode`/:meth:`~Codec.decode` methods of Codec
Codec Interface). The functions/methods are expected to work in a stateles
s
instances (see :ref:`Codec Interface <codec-objects>`). The functions/method
s
mode.
are expected to work in a stateless
mode.
*incrementalencoder* and *incrementaldecoder*: These have to be factory
*incrementalencoder* and *incrementaldecoder*: These have to be factory
functions providing the following interface:
functions providing the following interface:
...
@@ -333,8 +333,8 @@ implement the file protocols.
...
@@ -333,8 +333,8 @@ implement the file protocols.
The :class:`Codec` class defines the interface for stateless encoders/decoders.
The :class:`Codec` class defines the interface for stateless encoders/decoders.
To simplify and standardize error handling, the :meth:`encode` and
To simplify and standardize error handling, the :meth:`
~Codec.
encode` and
:meth:`decode`
methods may implement different error handling schemes by
:meth:`
~Codec.
decode`
methods may implement different error handling schemes by
providing the *errors* string argument. The following string values are defined
providing the *errors* string argument. The following string values are defined
and implemented by all standard Python codecs:
and implemented by all standard Python codecs:
...
@@ -428,12 +428,14 @@ interfaces of the stateless encoder and decoder:
...
@@ -428,12 +428,14 @@ interfaces of the stateless encoder and decoder:
The :class:`IncrementalEncoder` and :class:`IncrementalDecoder` classes provide
The :class:`IncrementalEncoder` and :class:`IncrementalDecoder` classes provide
the basic interface for incremental encoding and decoding. Encoding/decoding the
the basic interface for incremental encoding and decoding. Encoding/decoding the
input isn't done with one call to the stateless encoder/decoder function, but
input isn't done with one call to the stateless encoder/decoder function, but
with multiple calls to the :meth:`encode`/:meth:`decode` method of the
with multiple calls to the
incremental encoder/decoder. The incremental encoder/decoder keeps track of the
:meth:`~IncrementalEncoder.encode`/:meth:`~IncrementalDecoder.decode`
method of
encoding/decoding process during method calls.
the incremental encoder/decoder. The incremental encoder/decoder keeps track of
the encoding/decoding process during method calls.
The joined output of calls to the :meth:`encode`/:meth:`decode` method is the
same as if all the single inputs were joined into one, and this input was
The joined output of calls to the
:meth:`~IncrementalEncoder.encode`/:meth:`~IncrementalDecoder.decode`
method is
the same as if all the single inputs were joined into one, and this input was
encoded/decoded with the stateless encoder/decoder.
encoded/decoded with the stateless encoder/decoder.
...
...
Doc/library/collections.abc.rst
View file @
bfdcd436
...
@@ -98,8 +98,9 @@ ABC Inherits from Abstract Methods Mixin
...
@@ -98,8 +98,9 @@ ABC Inherits from Abstract Methods Mixin
.. class:: Iterator
.. class:: Iterator
ABC for classes that provide the :meth:`__iter__` and :meth:`__next__` methods.
ABC for classes that provide the :meth:`~iterator.__iter__` and
See also the definition of :term:`iterator`.
:meth:`~iterator.__next__` methods. See also the definition of
:term:`iterator`.
.. class:: Sequence
.. class:: Sequence
MutableSequence
MutableSequence
...
...
Doc/library/collections.rst
View file @
bfdcd436
...
@@ -974,9 +974,9 @@ reverse iteration using :func:`reversed`.
...
@@ -974,9 +974,9 @@ reverse iteration using :func:`reversed`.
Equality tests between :class:`OrderedDict` objects are order-sensitive
Equality tests between :class:`OrderedDict` objects are order-sensitive
and are implemented as ``list(od1.items())==list(od2.items())``.
and are implemented as ``list(od1.items())==list(od2.items())``.
Equality tests between :class:`OrderedDict` objects and other
Equality tests between :class:`OrderedDict` objects and other
:class:`
Mapping` objects are order-insensitive like regular dictionaries.
:class:`
~collections.abc.Mapping` objects are order-insensitive like regular
This allows :class:`OrderedDict` objects to be substituted anywhere a
dictionaries. This allows :class:`OrderedDict` objects to be substituted
regular dictionary is used.
anywhere a
regular dictionary is used.
The :class:`OrderedDict` constructor and :meth:`update` method both accept
The :class:`OrderedDict` constructor and :meth:`update` method both accept
keyword arguments, but their order is lost because Python's function call
keyword arguments, but their order is lost because Python's function call
...
...
Doc/library/configparser.rst
View file @
bfdcd436
...
@@ -371,7 +371,8 @@ are changed on a section proxy, they are actually mutated in the original
...
@@ -371,7 +371,8 @@ are changed on a section proxy, they are actually mutated in the original
parser.
parser.
:mod:`configparser` objects behave as close to actual dictionaries as possible.
:mod:`configparser` objects behave as close to actual dictionaries as possible.
The mapping interface is complete and adheres to the ``MutableMapping`` ABC.
The mapping interface is complete and adheres to the
:class:`~collections.abc.MutableMapping` ABC.
However, there are a few differences that should be taken into account:
However, there are a few differences that should be taken into account:
* By default, all keys in sections are accessible in a case-insensitive manner
* By default, all keys in sections are accessible in a case-insensitive manner
...
...
Doc/library/dbm.rst
View file @
bfdcd436
...
@@ -317,8 +317,9 @@ The module defines the following:
...
@@ -317,8 +317,9 @@ The module defines the following:
database has to be created. It defaults to octal ``0o666`` (and will be modified
database has to be created. It defaults to octal ``0o666`` (and will be modified
by the prevailing umask).
by the prevailing umask).
In addition to the methods provided by the :class:`collections.MutableMapping` class,
In addition to the methods provided by the
:class:`dumbdbm` objects provide the following method:
:class:`collections.abc.MutableMapping` class, :class:`dumbdbm` objects
provide the following method:
.. method:: dumbdbm.sync()
.. method:: dumbdbm.sync()
...
...
Doc/library/difflib.rst
View file @
bfdcd436
...
@@ -143,8 +143,8 @@ diffs. For comparing directories and files, see also, the :mod:`filecmp` module.
...
@@ -143,8 +143,8 @@ diffs. For comparing directories and files, see also, the :mod:`filecmp` module.
By default, the diff control lines (those with ``***`` or ``---``) are created
By default, the diff control lines (those with ``***`` or ``---``) are created
with a trailing newline. This is helpful so that inputs created from
with a trailing newline. This is helpful so that inputs created from
:func:`
fil
e.readlines` result in diffs that are suitable for use with
:func:`
io.IOBas
e.readlines` result in diffs that are suitable for use with
:func:`
fil
e.writelines` since both the inputs and outputs have trailing
:func:`
io.IOBas
e.writelines` since both the inputs and outputs have trailing
newlines.
newlines.
For inputs that do not have trailing newlines, set the *lineterm* argument to
For inputs that do not have trailing newlines, set the *lineterm* argument to
...
@@ -275,8 +275,8 @@ diffs. For comparing directories and files, see also, the :mod:`filecmp` module.
...
@@ -275,8 +275,8 @@ diffs. For comparing directories and files, see also, the :mod:`filecmp` module.
By default, the diff control lines (those with ``---``, ``+++``, or ``@@``) are
By default, the diff control lines (those with ``---``, ``+++``, or ``@@``) are
created with a trailing newline. This is helpful so that inputs created from
created with a trailing newline. This is helpful so that inputs created from
:func:`
fil
e.readlines` result in diffs that are suitable for use with
:func:`
io.IOBas
e.readlines` result in diffs that are suitable for use with
:func:`
fil
e.writelines` since both the inputs and outputs have trailing
:func:`
io.IOBas
e.writelines` since both the inputs and outputs have trailing
newlines.
newlines.
For inputs that do not have trailing newlines, set the *lineterm* argument to
For inputs that do not have trailing newlines, set the *lineterm* argument to
...
@@ -629,10 +629,12 @@ The :class:`Differ` class has this constructor:
...
@@ -629,10 +629,12 @@ The :class:`Differ` class has this constructor:
Compare two sequences of lines, and generate the delta (a sequence of lines).
Compare two sequences of lines, and generate the delta (a sequence of lines).
Each sequence must contain individual single-line strings ending with newlines.
Each sequence must contain individual single-line strings ending with
Such sequences can be obtained from the :meth:`readlines` method of file-like
newlines. Such sequences can be obtained from the
objects. The delta generated also consists of newline-terminated strings, ready
:meth:`~io.IOBase.readlines` method of file-like objects. The delta
to be printed as-is via the :meth:`writelines` method of a file-like object.
generated also consists of newline-terminated strings, ready to be
printed as-is via the :meth:`~io.IOBase.writelines` method of a
file-like object.
.. _differ-examples:
.. _differ-examples:
...
@@ -642,7 +644,7 @@ Differ Example
...
@@ -642,7 +644,7 @@ Differ Example
This example compares two texts. First we set up the texts, sequences of
This example compares two texts. First we set up the texts, sequences of
individual single-line strings ending with newlines (such sequences can also be
individual single-line strings ending with newlines (such sequences can also be
obtained from the :meth:`readlines` method of file-like objects):
obtained from the :meth:`
~io.BaseIO.
readlines` method of file-like objects):
>>> text1 = ''' 1. Beautiful is better than ugly.
>>> text1 = ''' 1. Beautiful is better than ugly.
... 2. Explicit is better than implicit.
... 2. Explicit is better than implicit.
...
...
Doc/library/exceptions.rst
View file @
bfdcd436
...
@@ -146,10 +146,9 @@ The following exceptions are the exceptions that are usually raised.
...
@@ -146,10 +146,9 @@ The following exceptions are the exceptions that are usually raised.
.. exception:: EOFError
.. exception:: EOFError
Raised when one of the built-in functions (:func:`input` or :func:`raw_input`)
Raised when the :func:`input` function hits an end-of-file condition (EOF)
hits an end-of-file condition (EOF) without reading any data. (N.B.: the
without reading any data. (N.B.: the :meth:`io.IOBase.read` and
:meth:`file.read` and :meth:`file.readline` methods return an empty string
:meth:`io.IOBase.readline` methods return an empty string when they hit EOF.)
when they hit EOF.)
.. exception:: FloatingPointError
.. exception:: FloatingPointError
...
@@ -360,7 +359,7 @@ The following exceptions are the exceptions that are usually raised.
...
@@ -360,7 +359,7 @@ The following exceptions are the exceptions that are usually raised.
executed, and so that a debugger can execute a script without running the risk
executed, and so that a debugger can execute a script without running the risk
of losing control. The :func:`os._exit` function can be used if it is
of losing control. The :func:`os._exit` function can be used if it is
absolutely positively necessary to exit immediately (for example, in the child
absolutely positively necessary to exit immediately (for example, in the child
process after a call to :func:`fork`).
process after a call to :func:`
os.
fork`).
The exception inherits from :exc:`BaseException` instead of :exc:`Exception` so
The exception inherits from :exc:`BaseException` instead of :exc:`Exception` so
that it is not accidentally caught by code that catches :exc:`Exception`. This
that it is not accidentally caught by code that catches :exc:`Exception`. This
...
@@ -623,7 +622,7 @@ module for more information.
...
@@ -623,7 +622,7 @@ module for more information.
.. exception:: BytesWarning
.. exception:: BytesWarning
Base class for warnings related to :class:`bytes` and :class:`b
uffer
`.
Base class for warnings related to :class:`bytes` and :class:`b
ytearray
`.
.. exception:: ResourceWarning
.. exception:: ResourceWarning
...
...
Doc/library/fileinput.rst
View file @
bfdcd436
...
@@ -136,11 +136,12 @@ available for subclassing as well:
...
@@ -136,11 +136,12 @@ available for subclassing as well:
Class :class:`FileInput` is the implementation; its methods :meth:`filename`,
Class :class:`FileInput` is the implementation; its methods :meth:`filename`,
:meth:`fileno`, :meth:`lineno`, :meth:`filelineno`, :meth:`isfirstline`,
:meth:`fileno`, :meth:`lineno`, :meth:`filelineno`, :meth:`isfirstline`,
:meth:`isstdin`, :meth:`nextfile` and :meth:`close` correspond to the functions
:meth:`isstdin`, :meth:`nextfile` and :meth:`close` correspond to the
of the same name in the module. In addition it has a :meth:`readline` method
functions of the same name in the module. In addition it has a
which returns the next input line, and a :meth:`__getitem__` method which
:meth:`~io.TextIOBase.readline` method which returns the next input line,
implements the sequence behavior. The sequence must be accessed in strictly
and a :meth:`__getitem__` method which implements the sequence behavior.
sequential order; random access and :meth:`readline` cannot be mixed.
The sequence must be accessed in strictly sequential order; random access
and :meth:`~io.TextIOBase.readline` cannot be mixed.
With *mode* you can specify which file mode will be passed to :func:`open`. It
With *mode* you can specify which file mode will be passed to :func:`open`. It
must be one of ``'r'``, ``'rU'``, ``'U'`` and ``'rb'``.
must be one of ``'r'``, ``'rU'``, ``'U'`` and ``'rb'``.
...
...
Doc/library/ftplib.rst
View file @
bfdcd436
...
@@ -272,7 +272,7 @@ followed by ``lines`` for the text version or ``binary`` for the binary version.
...
@@ -272,7 +272,7 @@ followed by ``lines`` for the text version or ``binary`` for the binary version.
Store a file in binary transfer mode. *cmd* should be an appropriate
Store a file in binary transfer mode. *cmd* should be an appropriate
``STOR`` command: ``"STOR filename"``. *file* is a :term:`file object`
``STOR`` command: ``"STOR filename"``. *file* is a :term:`file object`
(opened in binary mode) which is read until EOF using its :meth:`read`
(opened in binary mode) which is read until EOF using its :meth:`
~io.IOBase.
read`
method in blocks of size *blocksize* to provide the data to be stored.
method in blocks of size *blocksize* to provide the data to be stored.
The *blocksize* argument defaults to 8192. *callback* is an optional single
The *blocksize* argument defaults to 8192. *callback* is an optional single
parameter callable that is called on each block of data after it is sent.
parameter callable that is called on each block of data after it is sent.
...
@@ -286,7 +286,7 @@ followed by ``lines`` for the text version or ``binary`` for the binary version.
...
@@ -286,7 +286,7 @@ followed by ``lines`` for the text version or ``binary`` for the binary version.
Store a file in ASCII transfer mode. *cmd* should be an appropriate
Store a file in ASCII transfer mode. *cmd* should be an appropriate
``STOR`` command (see :meth:`storbinary`). Lines are read until EOF from the
``STOR`` command (see :meth:`storbinary`). Lines are read until EOF from the
:term:`file object` *file* (opened in binary mode) using its :meth:`readline`
:term:`file object` *file* (opened in binary mode) using its :meth:`
~io.IOBase.
readline`
method to provide the data to be stored. *callback* is an optional single
method to provide the data to be stored. *callback* is an optional single
parameter callable that is called on each line after it is sent.
parameter callable that is called on each line after it is sent.
...
...
Doc/library/http.server.rst
View file @
bfdcd436
...
@@ -29,8 +29,8 @@ handler. Code to create and run the server looks like this::
...
@@ -29,8 +29,8 @@ handler. Code to create and run the server looks like this::
.. class:: HTTPServer(server_address, RequestHandlerClass)
.. class:: HTTPServer(server_address, RequestHandlerClass)
This class builds on the :class:`
TCPServer` class by storing the server
This class builds on the :class:`
~socketserver.TCPServer` class by storing
address as instance variables named :attr:`server_name` and
the server
address as instance variables named :attr:`server_name` and
:attr:`server_port`. The server is accessible by the handler, typically
:attr:`server_port`. The server is accessible by the handler, typically
through the handler's :attr:`server` instance variable.
through the handler's :attr:`server` instance variable.
...
@@ -319,7 +319,7 @@ of which this module provides three different variants:
...
@@ -319,7 +319,7 @@ of which this module provides three different variants:
file's contents are returned; otherwise a directory listing is generated
file's contents are returned; otherwise a directory listing is generated
by calling the :meth:`list_directory` method. This method uses
by calling the :meth:`list_directory` method. This method uses
:func:`os.listdir` to scan the directory, and returns a ``404`` error
:func:`os.listdir` to scan the directory, and returns a ``404`` error
response if the :func:`listdir` fails.
response if the :func:`
~os.
listdir` fails.
If the request was mapped to a file, it is opened and the contents are
If the request was mapped to a file, it is opened and the contents are
returned. Any :exc:`OSError` exception in opening the requested file is
returned. Any :exc:`OSError` exception in opening the requested file is
...
...
Doc/library/imaplib.rst
View file @
bfdcd436
...
@@ -310,8 +310,9 @@ An :class:`IMAP4` instance has the following methods:
...
@@ -310,8 +310,9 @@ An :class:`IMAP4` instance has the following methods:
Opens socket to *port* at *host*. This method is implicitly called by
Opens socket to *port* at *host*. This method is implicitly called by
the :class:`IMAP4` constructor. The connection objects established by this
the :class:`IMAP4` constructor. The connection objects established by this
method will be used in the ``read``, ``readline``, ``send``, and ``shutdown``
method will be used in the :meth:`IMAP4.read`, :meth:`IMAP4.readline`,
methods. You may override this method.
:meth:`IMAP4.send`, and :meth:`IMAP4.shutdown` methods. You may override
this method.
.. method:: IMAP4.partial(message_num, message_part, start, length)
.. method:: IMAP4.partial(message_num, message_part, start, length)
...
...
Doc/library/inspect.rst
View file @
bfdcd436
...
@@ -906,8 +906,9 @@ but avoids executing code when it fetches attributes.
...
@@ -906,8 +906,9 @@ but avoids executing code when it fetches attributes.
that raise AttributeError). It can also return descriptors objects
that raise AttributeError). It can also return descriptors objects
instead of instance members.
instead of instance members.
If the instance :attr:`__dict__` is shadowed by another member (for example a
If the instance :attr:`~object.__dict__` is shadowed by another member (for
property) then this function will be unable to find instance members.
example a property) then this function will be unable to find instance
members.
.. versionadded:: 3.2
.. versionadded:: 3.2
...
...
Doc/library/io.rst
View file @
bfdcd436
...
@@ -157,7 +157,7 @@ standard stream implementations.
...
@@ -157,7 +157,7 @@ standard stream implementations.
The abstract base classes also provide default implementations of some
The abstract base classes also provide default implementations of some
methods in order to help implementation of concrete stream classes. For
methods in order to help implementation of concrete stream classes. For
example, :class:`BufferedIOBase` provides unoptimized implementations of
example, :class:`BufferedIOBase` provides unoptimized implementations of
``readinto()`` and ``readline()`
`.
:meth:`~IOBase.readinto` and :meth:`~IOBase.readline
`.
At the top of the I/O hierarchy is the abstract base class :class:`IOBase`. It
At the top of the I/O hierarchy is the abstract base class :class:`IOBase`. It
defines the basic interface to a stream. Note, however, that there is no
defines the basic interface to a stream. Note, however, that there is no
...
@@ -228,7 +228,7 @@ I/O Base Classes
...
@@ -228,7 +228,7 @@ I/O Base Classes
The basic type used for binary data read from or written to a file is
The basic type used for binary data read from or written to a file is
:class:`bytes`. :class:`bytearray`\s are accepted too, and in some cases
:class:`bytes`. :class:`bytearray`\s are accepted too, and in some cases
(such as :
class
:`readinto`) required. Text I/O classes work with
(such as :
meth
:`readinto`) required. Text I/O classes work with
:class:`str` data.
:class:`str` data.
Note that calling any method (even inquiries) on a closed stream is
Note that calling any method (even inquiries) on a closed stream is
...
...
Doc/library/itertools.rst
View file @
bfdcd436
...
@@ -88,9 +88,9 @@ loops that truncate the stream.
...
@@ -88,9 +88,9 @@ loops that truncate the stream.
.. function:: accumulate(iterable[, func])
.. function:: accumulate(iterable[, func])
Make an iterator that returns accumulated sums. Elements may be any addable
Make an iterator that returns accumulated sums. Elements may be any addable
type including :class:`
Decimal` or :class:`Fraction`. If the optional
type including :class:`
~decimal.Decimal` or :class:`~fractions.Fraction`.
*func* argument is supplied, it should be a function of two arguments
If the optional *func* argument is supplied, it should be a function of two
and it will be used instead of addition.
a
rguments a
nd it will be used instead of addition.
Equivalent to::
Equivalent to::
...
...
Doc/library/mailbox.rst
View file @
bfdcd436
...
@@ -1009,7 +1009,7 @@ When a :class:`MaildirMessage` instance is created based upon a
...
@@ -1009,7 +1009,7 @@ When a :class:`MaildirMessage` instance is created based upon a
Set the "From " line to *from_*, which should be specified without a
Set the "From " line to *from_*, which should be specified without a
leading "From " or trailing newline. For convenience, *time_* may be
leading "From " or trailing newline. For convenience, *time_* may be
specified and will be formatted appropriately and appended to *from_*. If
specified and will be formatted appropriately and appended to *from_*. If
*time_* is specified, it should be a :class:`struct_time` instance, a
*time_* is specified, it should be a :class:`
time.
struct_time` instance, a
tuple suitable for passing to :meth:`time.strftime`, or ``True`` (to use
tuple suitable for passing to :meth:`time.strftime`, or ``True`` (to use
:meth:`time.gmtime`).
:meth:`time.gmtime`).
...
@@ -1380,7 +1380,7 @@ When a :class:`BabylMessage` instance is created based upon an
...
@@ -1380,7 +1380,7 @@ When a :class:`BabylMessage` instance is created based upon an
Set the "From " line to *from_*, which should be specified without a
Set the "From " line to *from_*, which should be specified without a
leading "From " or trailing newline. For convenience, *time_* may be
leading "From " or trailing newline. For convenience, *time_* may be
specified and will be formatted appropriately and appended to *from_*. If
specified and will be formatted appropriately and appended to *from_*. If
*time_* is specified, it should be a :class:`struct_time` instance, a
*time_* is specified, it should be a :class:`
time.
struct_time` instance, a
tuple suitable for passing to :meth:`time.strftime`, or ``True`` (to use
tuple suitable for passing to :meth:`time.strftime`, or ``True`` (to use
:meth:`time.gmtime`).
:meth:`time.gmtime`).
...
...
Doc/library/math.rst
View file @
bfdcd436
...
@@ -31,7 +31,7 @@ Number-theoretic and representation functions
...
@@ -31,7 +31,7 @@ Number-theoretic and representation functions
Return the ceiling of *x*, the smallest integer greater than or equal to *x*.
Return the ceiling of *x*, the smallest integer greater than or equal to *x*.
If *x* is not a float, delegates to ``x.__ceil__()``, which should return an
If *x* is not a float, delegates to ``x.__ceil__()``, which should return an
:class:`Integral` value.
:class:`
~numbers.
Integral` value.
.. function:: copysign(x, y)
.. function:: copysign(x, y)
...
@@ -53,7 +53,7 @@ Number-theoretic and representation functions
...
@@ -53,7 +53,7 @@ Number-theoretic and representation functions
Return the floor of *x*, the largest integer less than or equal to *x*.
Return the floor of *x*, the largest integer less than or equal to *x*.
If *x* is not a float, delegates to ``x.__floor__()``, which should return an
If *x* is not a float, delegates to ``x.__floor__()``, which should return an
:class:`Integral` value.
:class:`
~numbers.
Integral` value.
.. function:: fmod(x, y)
.. function:: fmod(x, y)
...
@@ -133,8 +133,9 @@ Number-theoretic and representation functions
...
@@ -133,8 +133,9 @@ Number-theoretic and representation functions
.. function:: trunc(x)
.. function:: trunc(x)
Return the :class:`Real` value *x* truncated to an :class:`Integral` (usually
Return the :class:`~numbers.Real` value *x* truncated to an
an integer). Delegates to ``x.__trunc__()``.
:class:`~numbers.Integral` (usually an integer). Delegates to
``x.__trunc__()``.
Note that :func:`frexp` and :func:`modf` have a different call/return pattern
Note that :func:`frexp` and :func:`modf` have a different call/return pattern
...
...
Doc/library/msilib.rst
View file @
bfdcd436
...
@@ -429,8 +429,9 @@ GUI classes
...
@@ -429,8 +429,9 @@ GUI classes
-----------
-----------
:mod:`msilib` provides several classes that wrap the GUI tables in an MSI
:mod:`msilib` provides several classes that wrap the GUI tables in an MSI
database. However, no standard user interface is provided; use :mod:`bdist_msi`
database. However, no standard user interface is provided; use
to create MSI files with a user-interface for installing Python packages.
:mod:`~distutils.command.bdist_msi` to create MSI files with a user-interface
for installing Python packages.
.. class:: Control(dlg, name)
.. class:: Control(dlg, name)
...
...
Doc/library/ossaudiodev.rst
View file @
bfdcd436
...
@@ -169,11 +169,11 @@ and (read-only) attributes:
...
@@ -169,11 +169,11 @@ and (read-only) attributes:
be used in a :keyword:`with` statement.
be used in a :keyword:`with` statement.
The following methods each map to exactly one :func:`ioctl` system call. The
The following methods each map to exactly one :
c:
func:`ioctl` system call. The
correspondence is obvious: for example, :meth:`setfmt` corresponds to the
correspondence is obvious: for example, :meth:`setfmt` corresponds to the
``SNDCTL_DSP_SETFMT`` ioctl, and :meth:`sync` to ``SNDCTL_DSP_SYNC`` (this can
``SNDCTL_DSP_SETFMT`` ioctl, and :meth:`sync` to ``SNDCTL_DSP_SYNC`` (this can
be useful when consulting the OSS documentation). If the underlying
be useful when consulting the OSS documentation). If the underlying
:func:`ioctl` fails, they all raise :exc:`OSError`.
:
c:
func:`ioctl` fails, they all raise :exc:`OSError`.
.. method:: oss_audio_device.nonblock()
.. method:: oss_audio_device.nonblock()
...
...
Doc/library/pyexpat.rst
View file @
bfdcd436
...
@@ -484,8 +484,8 @@ ExpatError Exceptions
...
@@ -484,8 +484,8 @@ ExpatError Exceptions
.. attribute:: ExpatError.code
.. attribute:: ExpatError.code
Expat's internal error number for the specific error. The
Expat's internal error number for the specific error. The
:data:`errors.messages
` dictionary maps these error numbers to Expat's error
:data:`errors.messages
<xml.parsers.expat.errors.messages>` dictionary maps
messages. For example::
these error numbers to Expat's error
messages. For example::
from xml.parsers.expat import ParserCreate, ExpatError, errors
from xml.parsers.expat import ParserCreate, ExpatError, errors
...
@@ -495,9 +495,9 @@ ExpatError Exceptions
...
@@ -495,9 +495,9 @@ ExpatError Exceptions
except ExpatError as err:
except ExpatError as err:
print("Error:", errors.messages[err.code])
print("Error:", errors.messages[err.code])
The :mod:`
errors` module also provides error message constants and a
The :mod:`
~xml.parsers.expat.errors` module also provides error message
dictionary :data:`~errors.codes` mapping these messages back to the error
constants and a dictionary :data:`~xml.parsers.expat.errors.codes` mapping
codes, see below.
these messages back to the error
codes, see below.
.. attribute:: ExpatError.lineno
.. attribute:: ExpatError.lineno
...
...
Doc/library/shelve.rst
View file @
bfdcd436
...
@@ -103,8 +103,8 @@ Restrictions
...
@@ -103,8 +103,8 @@ Restrictions
.. class:: Shelf(dict, protocol=None, writeback=False, keyencoding='utf-8')
.. class:: Shelf(dict, protocol=None, writeback=False, keyencoding='utf-8')
A subclass of :class:`collections.
MutableMapping` which stores pickled values
A subclass of :class:`collections.
abc.MutableMapping` which stores pickled
in the *dict* object.
values
in the *dict* object.
By default, version 0 pickles are used to serialize values. The version of the
By default, version 0 pickles are used to serialize values. The version of the
pickle protocol can be specified with the *protocol* parameter. See the
pickle protocol can be specified with the *protocol* parameter. See the
...
...
Doc/library/socket.rst
View file @
bfdcd436
...
@@ -275,7 +275,7 @@ The module :mod:`socket` exports the following constants and functions:
...
@@ -275,7 +275,7 @@ The module :mod:`socket` exports the following constants and functions:
RCVALL_*
RCVALL_*
Constants for Windows' WSAIoctl(). The constants are used as arguments to the
Constants for Windows' WSAIoctl(). The constants are used as arguments to the
:meth:`ioctl` method of socket objects.
:meth:`
~socket.socket.
ioctl` method of socket objects.
.. data:: TIPC_*
.. data:: TIPC_*
...
...
Doc/library/socketserver.rst
View file @
bfdcd436
...
@@ -111,13 +111,13 @@ can be implemented by using a synchronous server and doing an explicit fork in
...
@@ -111,13 +111,13 @@ can be implemented by using a synchronous server and doing an explicit fork in
the request handler class :meth:`handle` method.
the request handler class :meth:`handle` method.
Another approach to handling multiple simultaneous requests in an environment
Another approach to handling multiple simultaneous requests in an environment
that supports neither threads nor :func:`
fork` (or where these are too expensive
that supports neither threads nor :func:`
~os.fork` (or where these are too
or inappropriate for the service) is to maintain an explicit table of partially
expensive or inappropriate for the service) is to maintain an explicit table of
finished requests and to use :func:`select` to decide which request to work on
partially finished requests and to use :func:`~select.select` to decide which
next (or whether to handle a new incoming request). This is particularly
request to work on next (or whether to handle a new incoming request). This is
important for stream services where each client can potentially be connected for
particularly important for stream services where each client can potentially be
a long time (if threads or subprocesses cannot be used). See :mod:`asyncore`
connected for a long time (if threads or subprocesses cannot be used). See
for another way to manage this.
:mod:`asyncore`
for another way to manage this.
.. XXX should data and methods be intermingled, or separate?
.. XXX should data and methods be intermingled, or separate?
how should the distinction between class and instance variables be drawn?
how should the distinction between class and instance variables be drawn?
...
...
Doc/library/stat.rst
View file @
bfdcd436
:mod:`stat` --- Interpreting :func:`stat` results
:mod:`stat` --- Interpreting :func:`
~os.
stat` results
=================================================
=================================================
====
.. module:: stat
.. module:: stat
:synopsis: Utilities for interpreting the results of os.stat(),
:synopsis: Utilities for interpreting the results of os.stat(),
...
...
Doc/library/telnetlib.rst
View file @
bfdcd436
...
@@ -185,7 +185,7 @@ Telnet Objects
...
@@ -185,7 +185,7 @@ Telnet Objects
Read until one from a list of a regular expressions matches.
Read until one from a list of a regular expressions matches.
The first argument is a list of regular expressions, either compiled
The first argument is a list of regular expressions, either compiled
(:
class:`re.RegexObject` instances
) or uncompiled (byte strings). The
(:
ref:`regex objects <re-objects>`
) or uncompiled (byte strings). The
optional second argument is a timeout, in seconds; the default is to block
optional second argument is a timeout, in seconds; the default is to block
indefinitely.
indefinitely.
...
...
Doc/library/time.rst
View file @
bfdcd436
...
@@ -677,8 +677,8 @@ The module defines the following functions and data items:
...
@@ -677,8 +677,8 @@ The module defines the following functions and data items:
of many format specifiers in :func:`strftime` and :func:`strptime`.
of many format specifiers in :func:`strftime` and :func:`strptime`.
Module :mod:`calendar`
Module :mod:`calendar`
General calendar-related functions. :func:`
timegm` is the inverse of
General calendar-related functions. :func:`
~calendar.timegm` is the
:func:`gmtime` from this module.
inverse of
:func:`gmtime` from this module.
.. rubric:: Footnotes
.. rubric:: Footnotes
...
...
Doc/library/unittest.mock.rst
View file @
bfdcd436
...
@@ -210,8 +210,8 @@ the `new_callable` argument to `patch`.
...
@@ -210,8 +210,8 @@ the `new_callable` argument to `patch`.
Accessing any attribute not in this list will raise an `AttributeError`.
Accessing any attribute not in this list will raise an `AttributeError`.
If `spec` is an object (rather than a list of strings) then
If `spec` is an object (rather than a list of strings) then
:attr:`
__class__` returns the class of the spec object. This allows mock
s
:attr:`
~instance.__class__` returns the class of the spec object. Thi
s
to pass `isinstance` tests.
allows mocks
to pass `isinstance` tests.
* `spec_set`: A stricter variant of `spec`. If used, attempting to *set*
* `spec_set`: A stricter variant of `spec`. If used, attempting to *set*
or get an attribute on the mock that isn't on the object passed as
or get an attribute on the mock that isn't on the object passed as
...
@@ -1969,8 +1969,8 @@ mock_open
...
@@ -1969,8 +1969,8 @@ mock_open
default) then a `MagicMock` will be created for you, with the API limited
default) then a `MagicMock` will be created for you, with the API limited
to methods or attributes available on standard file handles.
to methods or attributes available on standard file handles.
`read_data` is a string for the `
read` method of the file handle to return.
`read_data` is a string for the `
~io.IOBase.read` method of the file handle
This is an empty string by default.
to return.
This is an empty string by default.
Using `open` as a context manager is a great way to ensure your file handles
Using `open` as a context manager is a great way to ensure your file handles
are closed properly and is becoming common::
are closed properly and is becoming common::
...
...
Doc/library/warnings.rst
View file @
bfdcd436
...
@@ -89,7 +89,7 @@ following warnings category classes are currently defined:
...
@@ -89,7 +89,7 @@ following warnings category classes are currently defined:
| | Unicode. |
| | Unicode. |
+----------------------------------+-----------------------------------------------+
+----------------------------------+-----------------------------------------------+
| :exc:`BytesWarning` | Base category for warnings related to |
| :exc:`BytesWarning` | Base category for warnings related to |
| | :class:`bytes` and :class:`b
uffer`.
|
| | :class:`bytes` and :class:`b
ytearray`.
|
+----------------------------------+-----------------------------------------------+
+----------------------------------+-----------------------------------------------+
| :exc:`ResourceWarning` | Base category for warnings related to |
| :exc:`ResourceWarning` | Base category for warnings related to |
| | resource usage. |
| | resource usage. |
...
...
Doc/library/zipfile.rst
View file @
bfdcd436
...
@@ -213,8 +213,9 @@ ZipFile Objects
...
@@ -213,8 +213,9 @@ ZipFile Objects
.. note::
.. note::
The file-like object is read-only and provides the following methods:
The file-like object is read-only and provides the following methods:
:meth:`!read`, :meth:`!readline`, :meth:`!readlines`, :meth:`!__iter__`,
:meth:`~io.BufferedIOBase.read`, :meth:`~io.IOBase.readline`,
:meth:`!__next__`.
:meth:`~io.IOBase.readlines`, :meth:`__iter__`,
:meth:`~iterator.__next__`.
.. note::
.. note::
...
...
Misc/NEWS
View file @
bfdcd436
...
@@ -495,6 +495,8 @@ Tests
...
@@ -495,6 +495,8 @@ Tests
Documentation
Documentation
-------------
-------------
-
Issue
#
18758
:
Fixed
and
improved
cross
-
references
.
-
Issue
#
18743
:
Fix
references
to
non
-
existant
"StringIO"
module
.
-
Issue
#
18743
:
Fix
references
to
non
-
existant
"StringIO"
module
.
-
Issue
#
18783
:
Removed
existing
mentions
of
Python
long
type
in
docstrings
,
-
Issue
#
18783
:
Removed
existing
mentions
of
Python
long
type
in
docstrings
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment