[Python-ideas] [Python-Dev] yield * (Re: Missing operator.call)

Leif Walsh leif.walsh at gmail.com
Sun Feb 8 09:29:18 CET 2009


On Sun, Feb 8, 2009 at 3:14 AM, Steven D'Aprano <steve at pearwood.info> wrote:
> It's not just silly looking, it's the same construct used repeatedly, in
> many different places in code. It is a basic principle of programming that
> anytime you have blocks of code that are almost identical, you should factor
> out the common code into it's own routine. See "Don't Repeat Yourself" and
> "Once And Only Once" for similar ideas:

Sure, but it's only factoring out one or two lines.  I dunno.  If it's
not too intrusive to the parser, I guess it's not such a bad idea, but
it just seems like it's more work than it's worth.  Besides, most
applications I can think of that require you to build a generator
around another number of generators also require some kind of
manipulation of each data item generated, which this construct doesn't
allow.  It's a decent proposal, and looks nice enough, but I'm not
convinced it's a good use of our time (not that it's up to me though).

-- 
Cheers,
Leif



More information about the Python-ideas mailing list