Python language suggestion

Moshe Zadka moshez at zadka.site.co.il
Sun Jan 14 08:14:57 EST 2001


On Sat, 13 Jan 2001, "Chris Ryland" <cpr at emsoftware.com> wrote:

> Why doesn't the attribute reference (primary "." identifier) work for any
> dictionary-like object?
> 
> E.g., why doesn't
> 
> f = {'a': 1, 'b': 2}
> print f.a
> 
> work while
> 
> f['a']
> 
> does? (I mean from a language design standpoint, not why doesn't it work
> currently.)

f = {'keys' : 1 }
f.keys() -> ['keys']
f['keys'] -> 1
-- 
Moshe Zadka <sig at zadka.site.co.il>
This is a signature anti-virus. 
Please stop the spread of signature viruses!




More information about the Python-list mailing list