[Python-ideas] Anaphoric if

Chris Rebert pyideas at rebertia.com
Sat Apr 24 01:18:19 CEST 2010


On Fri, Apr 23, 2010 at 1:47 PM, Andrey Fedorov <anfedorov at gmail.com> wrote:
> I imagine this has been covered before, but somehow my Google-foo is
> failing. What are people's opinions about having an anaphoric-if syntax
> sugar like:
>
> if foo() as x:
>     ... x
>
> meaning
>
> x = foo()
> if x:
>     ... x

Master Yoda had me google "python-ideas if assignment", which was fruitful:

[Python-ideas] Inline assignment expression:
http://mail.python.org/pipermail/python-ideas/2009-March/003423.html

Post in same thread summarizing rejection reasons:
http://mail.python.org/pipermail/python-ideas/2009-March/003440.html

Cheers,
Chris
--
The moratorium makes this pointless anyways.
http://blog.rebertia.com



More information about the Python-ideas mailing list