[Python-checkins] cpython: asyncio: sort some methods

victor.stinner python-checkins at python.org
Mon Dec 2 17:52:46 CET 2013


http://hg.python.org/cpython/rev/74bd800edb90
changeset:   87710:74bd800edb90
user:        Victor Stinner <victor.stinner at gmail.com>
date:        Mon Dec 02 17:52:31 2013 +0100
summary:
  asyncio: sort some methods

files:
  Doc/library/asyncio.rst |  162 ++++++++++++++-------------
  1 files changed, 85 insertions(+), 77 deletions(-)


diff --git a/Doc/library/asyncio.rst b/Doc/library/asyncio.rst
--- a/Doc/library/asyncio.rst
+++ b/Doc/library/asyncio.rst
@@ -367,7 +367,7 @@
 
 Run subprocesses asynchronously using the :mod:`subprocess` module.
 
-.. method:: BaseEventLoop.subprocess_shell(protocol_factory, cmd, \*, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=False, shell=True, bufsize=0, \*\*kwargs)
+.. method:: BaseEventLoop.subprocess_exec(protocol_factory, \*args, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=False, shell=False, bufsize=0, \*\*kwargs)
 
    XXX
 
@@ -375,7 +375,7 @@
 
    See the constructor of the :class:`subprocess.Popen` class for parameters.
 
-.. method:: BaseEventLoop.subprocess_exec(protocol_factory, \*args, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=False, shell=False, bufsize=0, \*\*kwargs)
+.. method:: BaseEventLoop.subprocess_shell(protocol_factory, cmd, \*, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=False, shell=True, bufsize=0, \*\*kwargs)
 
    XXX
 
@@ -978,29 +978,9 @@
 
       Transport.
 
-   .. method:: write(data)
-
-      XXX
-
-   .. method:: writelines(data)
-
-      XXX
-
-   .. method:: write_eof()
-
-      XXX
-
-   .. method:: can_write_eof()
-
-      XXX
-
    .. method:: close()
 
-      XXX
-
-   .. method:: get_extra_info(name, default=None)
-
-      XXX
+      Close the transport: see :meth:`BaseTransport.close`.
 
    .. method:: drain()
 
@@ -1018,6 +998,31 @@
       that Future is completed, which will happen when the buffer is
       (partially) drained and the protocol is resumed.
 
+   .. method:: get_extra_info(name, default=None)
+
+      Return optional transport information: see
+      :meth:`BaseTransport.get_extra_info`.
+
+   .. method:: write(data)
+
+      Write some *data* bytes to the transport: see
+      :meth:`WriteTransport.write`.
+
+   .. method:: writelines(data)
+
+      Write a list (or any iterable) of data bytes to the transport:
+      see :meth:`WriteTransport.writelines`.
+
+   .. method:: can_write_eof()
+
+      Return :const:`True` if the transport supports :meth:`write_eof`,
+      :const:`False` if not. See :meth:`WriteTransport.can_write_eof`.
+
+   .. method:: write_eof()
+
+      Close the write end of the transport after flushing buffered data:
+      see :meth:`WriteTransport.write_eof`.
+
 
 .. class:: StreamReader(limit=_DEFAULT_LIMIT, loop=None)
 
@@ -1025,6 +1030,14 @@
 
       Get the exception.
 
+   .. method:: feed_eof()
+
+      XXX
+
+   .. method:: feed_data(data)
+
+      XXX
+
    .. method:: set_exception(exc)
 
       Set the exception.
@@ -1033,27 +1046,19 @@
 
       Set the transport.
 
-   .. method:: feed_eof()
-
-      XXX
-
-   .. method:: feed_data(data)
-
-      XXX
-
    .. method:: read(n=-1)
 
       XXX
 
       This method returns a :ref:`coroutine <coroutine>`.
 
-   .. method:: readexactly(n)
+   .. method:: readline()
 
       XXX
 
       This method returns a :ref:`coroutine <coroutine>`.
 
-   .. method:: readline()
+   .. method:: readexactly(n)
 
       XXX
 
@@ -1222,6 +1227,12 @@
    method.  The :meth:`wait` method blocks until the flag is true. The flag is
    initially false.
 
+   .. method:: clear()
+
+      Reset the internal flag to false. Subsequently, coroutines calling
+      :meth:`wait` will block until :meth:`set` is called to set the internal
+      flag to true again.
+
    .. method:: is_set()
 
       Return ``True`` if and only if the internal flag is true.
@@ -1232,12 +1243,6 @@
       true are awakened. Coroutine that call :meth:`wait` once the flag is true
       will not block at all.
 
-   .. method:: clear()
-
-      Reset the internal flag to false. Subsequently, coroutines calling
-      :meth:`wait` will block until :meth:`set` is called to set the internal
-      flag to true again.
-
    .. method:: wait()
 
       Block until the internal flag is true.
@@ -1260,6 +1265,28 @@
 
    A new :class:`Lock` object is created and used as the underlying lock.
 
+   .. method:: notify(n=1)
+
+      By default, wake up one coroutine waiting on this condition, if any.
+      If the calling coroutine has not acquired the lock when this method is
+      called, a :exc:`RuntimeError` is raised.
+
+      This method wakes up at most *n* of the coroutines waiting for the
+      condition variable; it is a no-op if no coroutines are waiting.
+
+      .. note::
+
+         An awakened coroutine does not actually return from its :meth:`wait`
+         call until it can reacquire the lock. Since :meth:`notify` does not
+         release the lock, its caller should.
+
+   .. method:: notify_all()
+
+      Wake up all threads waiting on this condition. This method acts like
+      :meth:`notify`, but wakes up all waiting threads instead of one. If the
+      calling thread has not acquired the lock when this method is called, a
+      :exc:`RuntimeError` is raised.
+
    .. method:: wait()
 
       Wait until notified.
@@ -1283,28 +1310,6 @@
 
       This method returns a :ref:`coroutine <coroutine>`.
 
-   .. method:: notify(n=1)
-
-      By default, wake up one coroutine waiting on this condition, if any.
-      If the calling coroutine has not acquired the lock when this method is
-      called, a :exc:`RuntimeError` is raised.
-
-      This method wakes up at most *n* of the coroutines waiting for the
-      condition variable; it is a no-op if no coroutines are waiting.
-
-      .. note::
-
-         An awakened coroutine does not actually return from its :meth:`wait`
-         call until it can reacquire the lock. Since :meth:`notify` does not
-         release the lock, its caller should.
-
-   .. method:: notify_all()
-
-      Wake up all threads waiting on this condition. This method acts like
-      :meth:`notify`, but wakes up all waiting threads instead of one. If the
-      calling thread has not acquired the lock when this method is called, a
-      :exc:`RuntimeError` is raised.
-
 
 .. class:: Semaphore(value=1, \*, loop=None)
 
@@ -1321,10 +1326,6 @@
    defaults to ``1``. If the value given is less than ``0``, :exc:`ValueError`
    is raised.
 
-   .. method:: locked()
-
-      Returns ``True`` if semaphore can not be acquired immediately.
-
    .. method:: acquire()
 
       Acquire a semaphore.
@@ -1336,6 +1337,10 @@
 
       This method returns a :ref:`coroutine <coroutine>`.
 
+   .. method:: locked()
+
+      Returns ``True`` if semaphore can not be acquired immediately.
+
    .. method:: release()
 
       Release a semaphore, incrementing the internal counter by one. When it
@@ -1415,6 +1420,7 @@
 
       Number of items allowed in the queue.
 
+
 .. class:: PriorityQueue
 
    A subclass of :class:`Queue`; retrieves entries in priority order (lowest
@@ -1422,16 +1428,30 @@
 
    Entries are typically tuples of the form: (priority number, data).
 
+
 .. class:: LifoQueue
 
     A subclass of :class:`Queue` that retrieves most recently added entries
     first.
 
+
 .. class:: JoinableQueue
 
    A subclass of :class:`Queue` with :meth:`task_done` and :meth:`join`
    methods.
 
+   .. method:: join()
+
+      Block until all items in the queue have been gotten and processed.
+
+      The count of unfinished tasks goes up whenever an item is added to the
+      queue. The count goes down whenever a consumer thread calls
+      :meth:`task_done` to indicate that the item was retrieved and all work on
+      it is complete.  When the count of unfinished tasks drops to zero,
+      :meth:`join` unblocks.
+
+      This method returns a :ref:`coroutine <coroutine>`.
+
    .. method:: task_done()
 
       Indicate that a formerly enqueued task is complete.
@@ -1447,18 +1467,6 @@
       Raises :exc:`ValueError` if called more times than there were items
       placed in the queue.
 
-   .. method:: join()
-
-      Block until all items in the queue have been gotten and processed.
-
-      The count of unfinished tasks goes up whenever an item is added to the
-      queue. The count goes down whenever a consumer thread calls
-      :meth:`task_done` to indicate that the item was retrieved and all work on
-      it is complete.  When the count of unfinished tasks drops to zero,
-      :meth:`join` unblocks.
-
-      This method returns a :ref:`coroutine <coroutine>`.
-
 
 Examples
 --------

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list