Python 1.6 The balanced language

Alex Martelli aleaxit at yahoo.com
Mon Sep 11 04:02:53 EDT 2000


"Greg Ewing" <see at my.signature> wrote in message
news:39BC3600.2A909BFB at my.signature...
> Neel Krishnaswami wrote:
> >
> > >>> def squares(n):
> > ...
> > ...         suspend s
>
> Wouldn't "yield" sound better than "suspend"?
> It's not s which is being suspended!

True.  The "suspend" verb has a precedent in the Icon programming
language, though (and possibly others...?). "suspend_returning" is
what we MEAN (suspend THIS procedure, returning s).  Maybe "yield"
is indeed a good verb for this... it's surely more concise:-).

As usual (as I remember, you're not enthusiastic about this:-) we
must take care about breaking perfectly good existing Python code
which uses yield (or suspend) as identifiers.  Some languages are
designed to be able to add unlimited amounts of keywords (Perl
comes to mind: that is part of why all identifier uses have to be
"stropped" in Perl -- marked with $ or & or @ etc -- it's so that
"barewords" can be reserved for possible future keywords...); some
aren't, and Python falls in this latter category (and I wouldn't
have it otherwise, personally:-).


Alex






More information about the Python-list mailing list