Specifing arguments type for a function

George Sakkis george.sakkis at gmail.com
Fri Jun 23 08:26:35 EDT 2006


Dennis Lee Bieber wrote:
> On 22 Jun 2006 22:55:00 -0700, "George Sakkis" <george.sakkis at gmail.com>
> declaimed the following in comp.lang.python:
>
>
> > Ok, I'll try once more: What does __setitem__ have to do with
> > **iterability**, not mutability or indexability ? I was commenting on
> > Maric's post that although some objects are typically iterable, they
> > are often treated as atomic by some/many/most applications  (e.g.
> > strings). It's not rocket science.
> >
> 	And the absence of the setitem would indicate such an object -- it
> may be iterable in terms of retrieving subparts, but atomic WRT
> modification.
>
> 	That, at least, is how I interpreted the introduction of the test...

Applications that don't need to treat strings as iterables of
characters wouldn't do so even if strings were mutable. Atomicity has
to do with whether something is considered to be composite or not, not
whether it can be modified.

George




More information about the Python-list mailing list