R. David Murray added the comment:

Well, it is consistent with plain reasoning if you remember that (a) python is 
a dynamic language and (b) python assignments do not return values (this is a 
core principle in the language design), which means that (c) the chained 
assignment form is a shorthand.  Of course, you do then have to look up what it 
is a shorthand *for*, but if you approached another language's chained 
assignment with a Python mindset, you'd also have to look it up to find out 
what rules applied to that language.

It is hard not to make assumptions based on other languages you've learned.  
Interestingly, when I did a quick google for what other languages do for 
chained assignment I didn't come up with much.  Looks like most don't support 
it, or if they do they do so as a side effect of an assignment returning a 
value.

So, yes, Python is a unique language.  There are usually good underlying 
reasons for the various design decision made (not always, but very very often).

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue17022>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to