Square bracket and dot notations?

Asen Bozhilov asen.bozhilov at gmail.com
Sat Jun 11 16:41:50 EDT 2011


Terry Reedy wrote:

> Right. d.items is a dict method. d['items'] is whatever you assign.
> Named tuples in the collections modules, which allow access to fields
> through .name as well as [index], have the name class problem. All the
> methods are therefore given leading underscore names to avoid this. [But
> there still could be a clash if someone used field names with leading
> underscores!]  

Scripting languages as JavaScript, Python and other so dynamic
languages allow user to shoot in his feet. I think the developer
should learning the curves of the language before start writing
complex applications. That was the goal of this thread.





More information about the Python-list mailing list