Python Asynchronous I/O library (pyasynchio) [currently win-only]

Fredrik Lundh fredrik at pythonware.com
Thu Sep 1 04:51:22 EDT 2005


Vladimir Sukhoy wrote:

> This Python library is created to support asynchronous I/O
> (Input/Output) operations. Unlike most platform-independent asynch I/O
> libraries, pyasynchio is simple. You do not have to know much about
> programming and anything about AIO in particular to use pyasynchio.
> Unlike, for example, famous asyncore library, pyasynchio does not
> require you to use some object-oriented approaches, implement certain
> interfaces or do anything similar.

nice.

(but I'm not sure writing large if-else trees and state machines is that
much easier than implementing hook methods, whether you know much
about programming or not.  have you considered the case where you
want your program to handle *different* protocols?  how do you
associate state with sockets in your programming model?)

(and why return dictionaries?  wouldn't an ordinary object be a better
choice in this case?  evt['type'] isn't really that pythonic compared to
evt.type.  an attribute-based approach also lets you delay construction
of Python objects until the client code actually attempts to use it).

(and given that the users will have to check the type and success fields
for every single event, wouldn't it be better to return those as separate
values: "for op, ok, event in apoll.poll(): if op == '...': ...")

</F> 






More information about the Python-list mailing list