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/2007-February/070976.html below:

[Python-Dev] New syntax for 'dynamic' attribute access

[Python-Dev] New syntax for 'dynamic' attribute access [Python-Dev] New syntax for 'dynamic' attribute accessTon van Vliet ton.vanvliet at skynet.be
Mon Feb 12 18:52:43 CET 2007
On Mon, 12 Feb 2007 18:50:35 +1100, you wrote:

>Yes and no. My point is that it's extremely similar to existing 
>syntax. (Worse yet, it looks the same but for what's possibly the 
>smallest and hardest-to-see character in any character set)
>
>"foo(baz)" vs "foo.(baz)" is... not good.

To me (as a newbee to the language) I only see possible confusion if one gives 'static' looking examples like:

  x.(foo) += 1
  
which does indeed look a bit like a function call.
 
However when giving more 'dynamic' looking examples like:

  x.('foo_%d' % n) += 1
  
I don't get confused at all and intuitively recognize the intention immediately. In this example I consider the parenthesis 'grouping operators' (which would not be the case when square brackets would have been used)
  
So, +1 for the idea from me, since the main intention is to use it in a 'dynamic' context, and there it would improve readability.

All IMHO as a newbee of course :)

Ton.
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