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/071022.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 access"Martin v. Löwis" martin at v.loewis.de
Tue Feb 13 07:46:57 CET 2007
Ron Adam schrieb:
> I think it's gets a bit awkward in some situations.
> 
> 
>     if bar->'__%s__' % attr < -42: print 'Hello World'
> 
>     if bar.['__%s__' % attr] > -42: print 'Hello World'
> 
> 
> To me it's easier to parse the second one visually.


Ah, precedence.

It definitly should be a bracketed form, or else people
always wonder what the precedence is, and add parenthesis
anyway just to be on the safe side.

BTW, which of these would be correct

  (a).[b]
  (a.)[b]
  a.[(b)]
  a.([b])
  a   .  [  b  ]

and what is the semantics of

  a.[42]

Regards,
Martin
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