[Python-ideas] Anaphoric if

Andrey Fedorov anfedorov at gmail.com
Sun Apr 25 01:01:06 CEST 2010


On Sat, Apr 24, 2010 at 6:48 PM, Guido van Rossum <guido at python.org> wrote:

> On Sat, Apr 24, 2010 at 1:00 AM, Nick Coghlan <ncoghlan at gmail.com> wrote:
> > Raymond Hettinger wrote:
> >> Yes, this has come up before.
> >> FWIW, I'm +1 on the idea,
> >> especially if it can be also applied to while-loops.
> >> It looks very readable
> >
> > Agreed, of the sundry embedded assignment proposals that come up
> > semi-regularly, adding "as" clauses to if and while statements is the
> > most viable (although possibly still not a good idea).
>
> It is not a good idea. In particular it is a mistake to assume that
> endowing if- and while-statements with special syntax is going to
> solve anything -- the problem is more generally that *expressions*
> can't have such effects (in Python) and there's nothing particularly
> special about the top-level expression in an if-statement.


What about endowing if/while statements with syntax to assign names to their
entire predicates only?

- Andrey
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20100424/663922f7/attachment.html>


More information about the Python-ideas mailing list