Hi all,
I am beginner in Python. What is interesting for me is that Python
interpreter treats in different way dot and square bracket notations.
I am coming from JavaScript where both notations lead prototype chain
lookup.
In Python it seems square bracket and dot notations lead lookup
On 2011.06.11 04:41 AM, Asen Bozhilov wrote:
Hi all,
I am beginner in Python. What is interesting for me is that Python
interpreter treats in different way dot and square bracket notations.
I am coming from JavaScript where both notations lead prototype chain
lookup.
In Python it seems
Asen Bozhilov asen.bozhi...@gmail.com writes:
I am beginner in Python. What is interesting for me is that Python
interpreter treats in different way dot and square bracket notations.
I am coming from JavaScript where both notations lead prototype chain
lookup.
Run, don't walk, to the Python
On 11 Giu, 11:41, Asen Bozhilov asen.bozhi...@gmail.com wrote:
Hi all,
I am beginner in Python. What is interesting for me is that Python
interpreter treats in different way dot and square bracket notations.
I am coming from JavaScript where both notations lead prototype chain
lookup
? By items I mean items which are accessible
trough square bracket notation.
I really like Pythonic way here. Square bracket and dot notations
allow me to create an object which can be true hash map and
meanwhile to support independent methods from its keys. I could have
an item and a property
which are accessible
trough square bracket notation.
.attributes are inherited. [index-or-key] items are not.
I really like Pythonic way here. Square bracket and dot notations
allow me to create an object which can be true hash map and
meanwhile to support independent methods from its keys. I
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