[Python-ideas] If branch merging
stefan at bytereef.org
Sun Jun 7 12:20:29 CEST 2015
Steven D'Aprano <steve at pearwood.info> wrote:
On Sat, Jun 06, 2015 at 11:40:55PM -0400, random832 at fastmail.us wrote:
>> Well you could always go with if aisb = a == b.
> No, that is a terrible design and a source of many bugs in languages
> that allow it.
> if a = expr: ...
> Oops, I meant to compare a == expr, instead I assigned the result of the
> expression to a.
In C I've mistyped this perhaps twice, in which case you get a compiler
It's a complete non-issue (and the construct *is* very handy).
Python-ideas mailing list
Python-ideas at python.org
Code of Conduct: http://python.org/psf/codeofconduct/
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-ideas