[Python-checkins] peps: Tweaks.

guido.van.rossum python-checkins at python.org
Tue Dec 18 01:46:59 CET 2012


http://hg.python.org/peps/rev/afd42b077500
changeset: 4619:afd42b077500
user: Guido van Rossum <guido at google.com>
date: Mon Dec 17 16:46:54 2012 -0800
summary:
 Tweaks.
files:
 pep-3156.txt | 24 +++++++++++++++++++-----
 1 files changed, 19 insertions(+), 5 deletions(-)
diff --git a/pep-3156.txt b/pep-3156.txt
--- a/pep-3156.txt
+++ b/pep-3156.txt
@@ -236,7 +236,8 @@
 remarks as for ``getaddrinfo()``.
 
 - ``create_transport(...)``. Creates a transport. Returns a Future.
- TBD: Signature. Do we pass in a protocol or protocol class?
+ TBD: Signature. Do we pass in a protocol or protocol factory?
+ TBD: Should this be called create_connection()?
 
 - ``start_serving(...)``. Enters a loop that accepts connections.
 TBD: Signature. There are two possibilities:
@@ -290,7 +291,10 @@
 used to cancel the callback. Note that, unlike ``call_later()``,
 the callback may be called many times. Calling ``add_reader()``
 again for the same file descriptor implicitly cancels the previous
- callback for that file descriptor.
+ callback for that file descriptor. (TBD: Returning a
+ ``DelayedCall`` that can be cancelled seems awkward. Let's forget
+ about that.) (TBD: Change this to raise an exception if a handler
+ is already set.)
 
 - ``add_writer(fd, callback, *args)``. Like ``add_reader()``,
 but registers the callback for writing instead of for reading.
@@ -300,11 +304,19 @@
 currently set for the file descriptor. (The reason for providing
 this alternate interface is that it is often more convenient to
 remember the file descriptor than to remember the ``DelayedCall``
- object.)
+ object.) (TBD: Return ``True`` if a handler was removed, ``False``
+ if not.)
 
 - ``remove_writer(fd)``. This is to ``add_writer()`` as
 ``remove_reader()`` is to ``add_reader()``.
 
+TBD: What about multiple callbacks per fd? The current semantics is
+that ``add_reader()/add_writer()`` replace a previously registered
+callback.
+
+TBD: Should ``remove_*()`` return a bool telling is whether it removed
+anything?
+
 The following methods for doing async I/O on sockets are optional.
 They are alternative to the previous set of optional methods, intended
 for transport implementations on Windows using IOCP (if the event loop
@@ -411,7 +423,8 @@
 TBD: Public attribute recording the realtime value when the callback
 is scheduled? (Since this is needed anyway for storing it in a heap.)
 
-TBD: A better name for the class?
+TBD: A better name for the class? Reasonable suggestions so far:
+``Callback``, ``Call``, ``Handler`` (my current favorite).
 
 Futures
 -------
@@ -427,7 +440,8 @@
 - ``cancelled()``.
 
 - ``running()``. Note that the meaning of this method is essentially
- "cannot be cancelled and isn't done yet".
+ "cannot be cancelled and isn't done yet". (TBD: Would be nice if
+ this could be set *and* cleared in some cases, e.g. sock_recv().)
 
 - ``done()``.
 
-- 
Repository URL: http://hg.python.org/peps


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /