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/071015.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 accessRon Adam rrr at ronadam.com
Tue Feb 13 04:01:57 CET 2007
Barry Warsaw wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> On Feb 12, 2007, at 7:32 PM, Guido van Rossum wrote:
> 
>> Oh, now I am definitely in favor of .[]! I read it in gmail in FireFox
>> which uses a small variable-pitch font whose dot is a single pixel.
>> The .() example was hard to find; the .[] jumped out immediately.
>> (When do you ever see self[anything]?)
> 
> Raymond's -> suggestion was nice.

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.


Ron
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