In article <[email protected]>,
Lawrence D'Oliveiro <[email protected]_zealand> wrote:
>In message <[email protected]>, Aahz wrote:
>>
>> It helps to remember that names and namespaces are in many
>> ways syntactic sugar for dicts or lists.
>
>Interesting, though, that Python insists on maintaining a distinction
>between c["x"] and c.x, whereas JavaScript doesn't bother.
Why do you say "insists"?
class AttrDict:
def __getitem__(self, key):
return getattr(self, key)
--
Aahz ([email protected]) <*> http://www.pythoncraft.com/
"as long as we like the same operating system, things are cool." --piranha
--
http://mail.python.org/mailman/listinfo/python-list