? 'in' operator and fallback to __getitem__

Marco Mariani marco at sferacarta.com
Mon May 18 11:24:02 EDT 2009


timh wrote:

> However strange things happen to the name passed to __getitem__ in the
> following example (and in fact in all varients I have triend the name/
> key passed to __getitem__ is always the integer 0

I think it's scanning the container as a sequence and not as a mapping, 
hence the access by index.




More information about the Python-list mailing list