[issue1714448] if something as x:

Matthew Barnett report at bugs.python.org
Sun Mar 15 03:45:41 CET 2009


Matthew Barnett <python at mrabarnett.plus.com> added the comment:

At the moment binding occurs either right-to-left with "=", eg.

    x = y

where "x" is the new name, or left-to-right, eg.

    import x as y

where "y" is the new name.

If the order is to be right-to-left then using "as" seems to be the best
choice.

On the other hand, if there should be a form of binding explicitly for
use in an expression in order to prevent accidental use of "=" then the
order should probably be the same as "=", ie right-to-left, and a new
symbol is needed (using punctuation feels preferable somehow, because
"=" uses punctuation).

The only symbol I can think of is "~=".

How does this:

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

look compared to:

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

IMHO, of course.

----------
nosy: +mrabarnett

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


More information about the Python-bugs-list mailing list