Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #5654

Re: in search of graceful co-routines

References <4DD2AA99.3010508@simplistix.co.uk> <BANLkTin228brtPfuRrsEqscO1015gVKCTw@mail.gmail.com> <4DD358B3.2060308@simplistix.co.uk>
From Ian Kelly <ian.g.kelly@gmail.com>
Date 2011-05-17 23:46 -0600
Subject Re: in search of graceful co-routines
Newsgroups comp.lang.python
Message-ID <mailman.1741.1305697618.9059.python-list@python.org> (permalink)

Show all headers | View raw


On Tue, May 17, 2011 at 11:27 PM, Chris Withers <chris@simplistix.co.uk> wrote:
> Yes, but it's this kind of birds nest I'm trying to avoid...

I was actually kind of hoping you might see it that way.  That's about
as simple as you're going to get using a generator for this, though.
I'll second Terry's suggestion on this:  forget using a generator for
the provider, and instead create an iterator class with regular
methods to decouple the push logic from the pull logic.  I think
you'll be glad that you did.

Cheers,
Ian

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: in search of graceful co-routines Ian Kelly <ian.g.kelly@gmail.com> - 2011-05-17 23:46 -0600

csiph-web