Curious assignment behaviour

David C. Ullrich ullrich at math.okstate.edu
Wed Oct 17 13:11:53 EDT 2001


On Wed, 17 Oct 2001 15:05:49 +1300, Greg Ewing
<greg at cosc.canterbury.ac.nz> wrote:

>"David C. Ullrich" wrote:
>> 
>> If one argued that
>> one would have to explain why "Let 42 = x" doesn't fly.
>
>Why shouldn't it fly? It's an unconventional way of
>putting it, but it means the same thing, mathematically
>speaking.

I disagree - in a "Let this = that" statement the order
of this and that is significant.

What if you already have x = 42 and y = 24, and you
say "let x = y" ? Does that set x to 24 (yes) or
does it set y to 42?

>-- 
>Greg Ewing, Computer Science Dept, University of Canterbury,	  
>Christchurch, New Zealand
>To get my email address, please visit my web page:	  
>http://www.cosc.canterbury.ac.nz/~greg




More information about the Python-list mailing list