A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2012-November/122559.html below:

[Python-Dev] chained assignment weirdity

[Python-Dev] chained assignment weirdity [Python-Dev] chained assignment weirdityMRAB python at mrabarnett.plus.com
Tue Nov 6 16:32:23 CET 2012
On 2012-11-06 15:02, Rob Cliffe wrote:
>
> On 06/11/2012 12:01, Nick Coghlan wrote:
>>
>> As noted, it's really only counterintuitive if your intuition is
>> primed to expect C style right to left chained assignments.
>>
>> Python, on the other hand, is able to preserve primarily left to right
>> evaluation in this case with only the far right hand expression
>> needing to be evaluated out of order.
>>
> It strikes me that a really intuitive language (at least for Westerners
> who read left-to-right) would write assignments as
>      expression --> target
> and then the order of assignment in
>      expression -> target1 -> target2
> could be the natural left-to-right one.

That would make augmented assignment more difficult. For example, how
would you write the equivalent of "x -= y"?

> [Sorry, this is more appropriate to Python-ideas, but I couldn't resist
> adding my 2c.]
> Rob Cliffe


More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4