[EMAIL PROTECTED] wrote:

I rather like it!  I prefer writing obj.spam to obj["spam"]!  I wonder if
there is a technical downside to this use of Python?

P.S.

Certainly makes writing 'print obj.spam, obj.spam, obj.eggs, obj.bacon,
obj.sausages, "and", obj.spam' a lot easier ;-)

Of course this whole thing of substituting attribute access for dictionary keys only works as long as the keys are strings with the same syntax as Python identifiers, so one shouldn't go completely overboard. "To the man with a hammer everything looks like a nail", and so on.

regards
 Steve
--
Steve Holden               http://www.holdenweb.com/
Python Web Programming  http://pydish.holdenweb.com/
Holden Web LLC      +1 703 861 4237  +1 800 494 3119
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to