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/122561.html below:

[Python-Dev] chained assignment weirdity

[Python-Dev] chained assignment weirdity [Python-Dev] chained assignment weirditySerhiy Storchaka storchaka at gmail.com
Tue Nov 6 17:14:38 CET 2012
On 06.11.12 14:01, Nick Coghlan wrote:
> 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.

I'm surprised, but it is really so.

   >>> {}[print('foo')] = print('bar')
   bar
   foo

I was expecting "foo" before "bar".

Another counterintuitive (and possible wrong) example:

   >>> {print('foo'): print('bar')}
   bar
   foo
   {None: None}


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