[Chicago] Asynchronous I/O in Python 3 (and more analogies)

Feihong Hsu feihong.hsu at gmail.com
Sat Jul 13 03:30:42 CEST 2013

I've upload the slides from last night's talk:

And also pushed the repository for all the examples and demos from the
talk: https://github.com/feihong/tulip-talk

There were a few loose threads from last night that I'd like to address.


Someone had asked me about Tornado, and I said that I didn't have an
opinion on it. That's actually not true, I just somehow forgot my own
opinion. I looked into Tornado a while back and decided against using it
because it doesn't work on Windows (Twisted, gevent, Tulip, etc. all do).
I'm not saying that Tornado sucks, but I prefer a cross-platform solution
for a lot of my projects.

To continue my analogy, if programming with Twisted is like being a
mystical ninja warrior, than programming with Tornado is like being a
mystical ninja warrior who suffers from some kind of childhood trauma that
prevents his shadow clones from fighting killer robots. I'd hire the
Tornado ninja for a fight in Hell, but I'd leave him behind if there was a
brouhaha at the Isaac Asimov museum.

Gevent and eventlet.

Someone brought up gevent, and claimed that it's easier to use than Twisted
and Tulip. I have to agree -- greenlets hide all the messy details so you
don't need to worry about callbacks or yield from syntax. I don't have any
personal experience with greenlets, but here is a very recent article that
addresses the pros and cons:
http://mrjoes.github.io/2013/06/21/python-realtime.html. I'll also note
that gevent and eventlet aren't yet compatible with Python 3 (although the
greenlet module has been ported, so it's just a matter of time).

I don't love talking about things I don't understand, but I love making
analogies, so I'll leave you with this: Programming with greenlets is like
running around while juggling three standard beanbag balls (apparently this
is called joggling). Some people you encounter will be AMAZED that you can
joggle at all (usually the very old or the very young). Other bystanders
will annoyingly ask if you can also joggle cats, shotguns, flamethrowers,
your mom, etc. (these people are typically hipsters, Republicans, ninjas,
or your dad). After a while you get distracted by all the dumbass questions
and you drop all your balls -- one of them goes down a storm drain, another
plops into a mud puddle, the last one bounces into your crotch for some
reason and you're so mad you hurl it into the sun and swear off joggling
forever. Then the next day you're back out there joggling, because hey it's
a free country and some people like it so shut up you hater.

Wishing you a wunderbar weekend,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/chicago/attachments/20130712/fd2c4b2d/attachment.html>

More information about the Chicago mailing list