[issue1714448] if something as x:

Steven D'Aprano report at bugs.python.org
Sun Mar 15 01:30:19 CET 2009


Steven D'Aprano <steve at pearwood.info> added the comment:

What's wrong with this?

ob = map[x][y].overpay
if ob:
   ob.blit(x, y)


Is this proposal just about saving one line?

If we allow this, how many of the following will be allowed?

if expr as name: <block>
while expr as name: <block>
expr as name  # alternative to "name = expr"

Frankly, the only one that seems to be useful to me is the second.

As for using "->", please no, there are plenty of languages that use 
line noise, but Python doesn't need to be one of them.

----------
nosy: +stevenjd

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue1714448>
_______________________________________


More information about the Python-bugs-list mailing list