Why '==' ??

Mel Wilson mwilson at the-wire.com
Thu Apr 1 14:33:24 EST 2004


In article <8089854e.0403312324.7de8710c at posting.google.com>,
michael at foord.net (Fuzzyman) wrote:
>Having said that I *Still* think that :
>
>if a = 3:
>is unambiguous - so there's no real reason that the interpreter should
>wag it's finger and say ... "you forgot to put in one of the '=' and I
>refuse to continue until you do" :-)

It causes trouble in the larger language..

    if a == 0:
        some_thing()

works, and

    c = a == 0
    if c:
        some_thing()

works the same
but

    c = a = 0
    if c:
        some_thing()

has the opposite effect to your proposed

    if a = 0:           # (not real python syntax)
        some_thing()



        Regards.        Mel.



More information about the Python-list mailing list