Bruno Desthuilliers wrote:
> George Sakkis a écrit :
> > This is ok - in theory. In practice I've found that e.g. strings are
> > more often than not handled as scalars although they are typically
> > iterables.
> >>> hasattr('', '__iter__')
> False
>>> hasattr('', '__iter__') or hasattr('', '__getitem__')
True
> > Also tuples may or may not be considered as iterables,
> > depending on what they are used for.
>
> >>> hasattr((), '__setitem__')
> False
> >>> hasattr('', '__setitem__')
> False
What does __setitem__ have to do with iterability ?
--
http://mail.python.org/mailman/listinfo/python-list