Jervis Whitley <[email protected]> added the comment:
> Regarding the proposed syntax:
> if (f() == 'spam') -> name:
> newname = name.replace('p', 'h')
> Surely that should assign the *bool* result of comparing f()
> with 'spam' to name? Doing anything else is opening the door to a
> world of pain.
You are correct. It does assign the result of the bool. I have
made an error in creating the example. This is what happens when
I copy and paste and don't check the result.
should read
if f -> name:
# use name, (pointless example but in line with the OP's suggestion)
Thanks for picking this up.
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue1714448>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com