[Python-checkins] peps: Add subsections about dependencies, namespace and event loop policy.
guido.van.rossum
python-checkins at python.org
Thu Dec 13 05:26:31 CET 2012
http://hg.python.org/peps/rev/5736321433fc
changeset: 4601:5736321433fc
user: Guido van Rossum <guido at google.com>
date: Wed Dec 12 20:26:20 2012 -0800
summary:
Add subsections about dependencies, namespace and event loop policy.
files:
pep-3156.txt | 53 +++++++++++++++++++++++++++++++++++++++-
1 files changed, 52 insertions(+), 1 deletions(-)
diff --git a/pep-3156.txt b/pep-3156.txt
--- a/pep-3156.txt
+++ b/pep-3156.txt
@@ -12,7 +12,7 @@
Abstract
========
-A concrete proposal for asynchronous I/O in Python 3, starting with
+This is a proposal for asynchronous I/O in Python 3, starting with
Python 3.3. Consider this the concrete proposal that is missing from
PEP 3153. The proposal includes a pluggable event loop API, transport
and protocol abstractions similar to those in Twisted, and a
@@ -86,6 +86,57 @@
Specification
=============
+Dependencies
+------------
+
+Python 3.3 is required. No new language or standard library features
+beyond Python 3.3 are required. No third-party modules or packages
+are required.
+
+Module Namespace
+----------------
+
+The specification here will live in a new toplevel package. Different
+components will live in separate submodules of that package. The
+package will import common APIs from their respective submodules and
+make them available as package attributes (similar to the way the
+email package works).
+
+The name of the toplevel package is currently unspecified. The
+reference implementation uses the name 'tulip', but the name will
+change to something more boring if and when the implementation is
+moved into the standard library (hopefully for Python 3.4).
+
+Until the boring name is chosen, this PEP will use 'tulip' as the
+toplevel package name. Classes and functions given without a module
+name are assumed to be accessed via the toplevel package.
+
+Getting and Setting the Event Loop
+----------------------------------
+
+To get the current event loop, use ``get_event_loop()``. This returns
+an instance of the ``EventLoop`` class defined below or an equivalent
+object. It is possible that ``get_event_loop()`` returns a different
+object depending on the current thread, or depending on some other
+notion of context.
+
+To set the current event loop, use ``set_event_loop(eventloop)``,
+where ``eventloop`` is an instance of the ``EventLoop`` class or
+equivalent. This uses the same notion of context as
+``get_event_loop()``.
+
+To change the way ``get_event_loop()`` and ``set_event_loop()`` work
+(including their notion of context), call
+``set_event_loop_policy(policy)``, where ``policy`` is an event loop
+policy object. The policy object can be any object that has methods
+``get_event_loop()`` and ``set_event_loop(eventloop)`` behaving like
+the functions described above. The default event loop policy is an
+instance of the class ``EventLoopPolicy``. The current event loop
+policy object can be retrieved by calling ``get_event_loop_policy()``.
+
+Event Loop Interface
+--------------------
+
TBD.
--
Repository URL: http://hg.python.org/peps
More information about the Python-checkins
mailing list