Specifing arguments type for a function

Bruno Desthuilliers onurb at xiludom.gro
Fri Jun 23 09:39:57 EDT 2006


George Sakkis wrote:
> 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.

Sure. Do you have any generic solution for this ?


-- 
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in 'onurb at xiludom.gro'.split('@')])"



More information about the Python-list mailing list