Commit 96d5c541 authored by Serhiy Storchaka's avatar Serhiy Storchaka

Issue #18757: Improved cross-references in the concurrent package.

parents 0acbcb5b 9e0ae539
......@@ -40,7 +40,7 @@ Executor Objects
.. method:: map(func, *iterables, timeout=None)
Equivalent to ``map(func, *iterables)`` except *func* is executed
Equivalent to :func:`map(func, *iterables) <map>` except *func* is executed
asynchronously and several calls to *func* may be made concurrently. The
returned iterator raises a :exc:`TimeoutError` if
:meth:`~iterator.__next__` is called and the result isn't available
......
This diff is collapsed.
......@@ -54,13 +54,15 @@ The :mod:`queue` module defines the following classes and exceptions:
.. exception:: Empty
Exception raised when non-blocking :meth:`get` (or :meth:`get_nowait`) is called
Exception raised when non-blocking :meth:`~Queue.get` (or
:meth:`~Queue.get_nowait`) is called
on a :class:`Queue` object which is empty.
.. exception:: Full
Exception raised when non-blocking :meth:`put` (or :meth:`put_nowait`) is called
Exception raised when non-blocking :meth:`~Queue.put` (or
:meth:`~Queue.put_nowait`) is called
on a :class:`Queue` object which is full.
......@@ -181,6 +183,6 @@ Example of how to wait for enqueued tasks to be completed::
context.
:class:`collections.deque` is an alternative implementation of unbounded
queues with fast atomic :func:`append` and :func:`popleft` operations that
do not require locking.
queues with fast atomic :meth:`~collections.deque.append` and
:meth:`~collections.deque.popleft` operations that do not require locking.
......@@ -81,7 +81,7 @@ The module defines the following:
This is a straightforward interface to the Unix :c:func:`select` system call.
The first three arguments are sequences of 'waitable objects': either
integers representing file descriptors or objects with a parameterless method
named :meth:`fileno` returning such an integer:
named :meth:`~io.IOBase.fileno` returning such an integer:
* *rlist*: wait until ready for reading
* *wlist*: wait until ready for writing
......@@ -107,8 +107,8 @@ The module defines the following:
objects <file object>` (e.g. ``sys.stdin``, or objects returned by
:func:`open` or :func:`os.popen`), socket objects returned by
:func:`socket.socket`. You may also define a :dfn:`wrapper` class yourself,
as long as it has an appropriate :meth:`fileno` method (that really returns
a file descriptor, not just a random integer).
as long as it has an appropriate :meth:`~io.IOBase.fileno` method (that
really returns a file descriptor, not just a random integer).
.. note::
......@@ -122,7 +122,7 @@ The module defines the following:
.. attribute:: PIPE_BUF
The minimum number of bytes which can be written without blocking to a pipe
when the pipe has been reported as ready for writing by :func:`select`,
when the pipe has been reported as ready for writing by :func:`~select.select`,
:func:`poll` or another interface in this module. This doesn't apply
to other kind of file-like objects such as sockets.
......@@ -171,10 +171,10 @@ object.
.. method:: devpoll.register(fd[, eventmask])
Register a file descriptor with the polling object. Future calls to the
:meth:`poll` method will then check whether the file descriptor has any pending
I/O events. *fd* can be either an integer, or an object with a :meth:`fileno`
method that returns an integer. File objects implement :meth:`fileno`, so they
can also be used as the argument.
:meth:`poll` method will then check whether the file descriptor has any
pending I/O events. *fd* can be either an integer, or an object with a
:meth:`~io.IOBase.fileno` method that returns an integer. File objects
implement :meth:`!fileno`, so they can also be used as the argument.
*eventmask* is an optional bitmask describing the type of events you want to
check for. The constants are the same that with :c:func:`poll`
......@@ -200,7 +200,7 @@ object.
Remove a file descriptor being tracked by a polling object. Just like the
:meth:`register` method, *fd* can be an integer or an object with a
:meth:`fileno` method that returns an integer.
:meth:`~io.IOBase.fileno` method that returns an integer.
Attempting to remove a file descriptor that was never registered is
safely ignored.
......@@ -317,10 +317,10 @@ linearly scanned again. :c:func:`select` is O(highest file descriptor), while
.. method:: poll.register(fd[, eventmask])
Register a file descriptor with the polling object. Future calls to the
:meth:`poll` method will then check whether the file descriptor has any pending
I/O events. *fd* can be either an integer, or an object with a :meth:`fileno`
method that returns an integer. File objects implement :meth:`fileno`, so they
can also be used as the argument.
:meth:`poll` method will then check whether the file descriptor has any
pending I/O events. *fd* can be either an integer, or an object with a
:meth:`~io.IOBase.fileno` method that returns an integer. File objects
implement :meth:`!fileno`, so they can also be used as the argument.
*eventmask* is an optional bitmask describing the type of events you want to
check for, and can be a combination of the constants :const:`POLLIN`,
......@@ -359,7 +359,7 @@ linearly scanned again. :c:func:`select` is O(highest file descriptor), while
Remove a file descriptor being tracked by a polling object. Just like the
:meth:`register` method, *fd* can be an integer or an object with a
:meth:`fileno` method that returns an integer.
:meth:`~io.IOBase.fileno` method that returns an integer.
Attempting to remove a file descriptor that was never registered causes a
:exc:`KeyError` exception to be raised.
......@@ -424,8 +424,8 @@ http://www.freebsd.org/cgi/man.cgi?query=kqueue&sektion=2
Value used to identify the event. The interpretation depends on the filter
but it's usually the file descriptor. In the constructor ident can either
be an int or an object with a fileno() function. kevent stores the integer
internally.
be an int or an object with a :meth:`~io.IOBase.fileno` method. kevent
stores the integer internally.
.. attribute:: kevent.filter
......
......@@ -76,7 +76,7 @@ use cases, the underlying :class:`Popen` interface can be used directly.
Run command with arguments. Wait for command to complete. If the return
code was zero then return, otherwise raise :exc:`CalledProcessError`. The
:exc:`CalledProcessError` object will have the return code in the
:attr:`returncode` attribute.
:attr:`~CalledProcessError.returncode` attribute.
The arguments shown above are merely the most common ones, described below
in :ref:`frequently-used-arguments` (hence the use of keyword-only notation
......@@ -122,8 +122,8 @@ use cases, the underlying :class:`Popen` interface can be used directly.
If the return code was non-zero it raises a :exc:`CalledProcessError`. The
:exc:`CalledProcessError` object will have the return code in the
:attr:`returncode` attribute and any output in the :attr:`output`
attribute.
:attr:`~CalledProcessError.returncode` attribute and any output in the
:attr:`~CalledProcessError.output` attribute.
The arguments shown above are merely the most common ones, described below
in :ref:`frequently-used-arguments` (hence the use of keyword-only notation
......@@ -617,14 +617,14 @@ Instances of the :class:`Popen` class have the following methods:
.. method:: Popen.poll()
Check if child process has terminated. Set and return :attr:`returncode`
attribute.
Check if child process has terminated. Set and return
:attr:`~Popen.returncode` attribute.
.. method:: Popen.wait(timeout=None)
Wait for child process to terminate. Set and return :attr:`returncode`
attribute.
Wait for child process to terminate. Set and return
:attr:`~Popen.returncode` attribute.
If the process does not terminate after *timeout* seconds, raise a
:exc:`TimeoutExpired` exception. It is safe to catch this exception and
......@@ -868,8 +868,8 @@ In this section, "a becomes b" means that b can be used as a replacement for a.
In addition, the replacements using :func:`check_output` will fail with a
:exc:`CalledProcessError` if the requested operation produces a non-zero
return code. The output is still available as the ``output`` attribute of
the raised exception.
return code. The output is still available as the
:attr:`~CalledProcessError.output` attribute of the raised exception.
In the following examples, we assume that the relevant functions have already
been imported from the :mod:`subprocess` module.
......
......@@ -63,7 +63,7 @@ This module defines the following functions:
Set a trace function for all threads started from the :mod:`threading` module.
The *func* will be passed to :func:`sys.settrace` for each thread, before its
:meth:`run` method is called.
:meth:`~Thread.run` method is called.
.. function:: setprofile(func)
......@@ -72,7 +72,7 @@ This module defines the following functions:
Set a profile function for all threads started from the :mod:`threading` module.
The *func* will be passed to :func:`sys.setprofile` for each thread, before its
:meth:`run` method is called.
:meth:`~Thread.run` method is called.
.. function:: stack_size([size])
......@@ -825,10 +825,11 @@ This class represents an action that should be run only after a certain amount
of time has passed --- a timer. :class:`Timer` is a subclass of :class:`Thread`
and as such also functions as an example of creating custom threads.
Timers are started, as with threads, by calling their :meth:`start` method. The
timer can be stopped (before its action has begun) by calling the :meth:`cancel`
method. The interval the timer will wait before executing its action may not be
exactly the same as the interval specified by the user.
Timers are started, as with threads, by calling their :meth:`~Timer.start`
method. The timer can be stopped (before its action has begun) by calling the
:meth:`~Timer.cancel` method. The interval the timer will wait before
executing its action may not be exactly the same as the interval specified by
the user.
For example::
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment