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
7f4cc222
Commit
7f4cc222
authored
Aug 24, 2013
by
Serhiy Storchaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #18757: Improved cross-references in the concurrent package.
parent
8d18986f
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
91 additions
and
77 deletions
+91
-77
Doc/library/concurrent.futures.rst
Doc/library/concurrent.futures.rst
+1
-1
Doc/library/multiprocessing.rst
Doc/library/multiprocessing.rst
+52
-41
Doc/library/queue.rst
Doc/library/queue.rst
+6
-4
Doc/library/select.rst
Doc/library/select.rst
+16
-16
Doc/library/subprocess.rst
Doc/library/subprocess.rst
+9
-9
Doc/library/threading.rst
Doc/library/threading.rst
+7
-6
No files found.
Doc/library/concurrent.futures.rst
View file @
7f4cc222
...
...
@@ -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
...
...
Doc/library/multiprocessing.rst
View file @
7f4cc222
This diff is collapsed.
Click to expand it.
Doc/library/queue.rst
View file @
7f4cc222
...
...
@@ -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.
Doc/library/select.rst
View file @
7f4cc222
...
...
@@ -78,7 +78,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
...
...
@@ -104,8 +104,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::
...
...
@@ -119,7 +119,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.
...
...
@@ -147,10 +147,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`
...
...
@@ -176,7 +176,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.
...
...
@@ -288,10 +288,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`,
...
...
@@ -330,7 +330,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.
...
...
@@ -390,8 +390,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
...
...
Doc/library/subprocess.rst
View file @
7f4cc222
...
...
@@ -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
...
...
@@ -607,14 +607,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
...
...
@@ -860,8 +860,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.
...
...
Doc/library/threading.rst
View file @
7f4cc222
...
...
@@ -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::
...
...
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