On Friday 07 May 2010, Martin Aspeli elucidated thus:
>> Ah, I didn't realise it supported __getitem__ as well
as
>> __getattr__. Does it also support .get()?
>
> No, sorry. Although rare, I didn't want to hide a real <get/>
> attribute.
Yeah, makes sense.
To be honest, I think it'd have been better to choose either
attribute or dict notation. Having both is confusing and leads to
divergent practices and documentation. Zope 2 made that mistake with
various things (like request keys) and it was never a good idea.
FWIW, I like the choice. Key notation is useful for cycling through a
list of keys, and attribute notation is nice when you know your list of
attributes before hand, and makes for cleaner code. But you are right:
it does require a coding standard to be in place.
j
--
Joshua Kugler
Part-Time System Admin/Programmer
http://www.eeinternet.com
PGP Key:
http://pgp.mit.edu/ ID 0x73B13B6A