[Python-3000] callable()

Raymond Hettinger rhettinger at ewtllc.com
Fri Jul 21 19:10:15 CEST 2006


>>>str and unicode don't have __iter__, list, tuple and dict do:
>>>      
>>>
>>[...]
>>    
>>
>>>Should that be fixed too?
>>>      
>>>
>>Yes, please. (In Python 2.6 if you can.)
>>    
>>

If implicit SeqIter wrapping won't potentially go away until Py3.0, why 
would this go into Py2.6?  What is the benefit?

Also, IIRC, there was some move afoot to make strings not iterable at 
all and instead add a .chars() method (though it would be a bit weird 
for an object to be slicable and indexable but not iterable).

Also, I'm unclear on the goal here.  Are you trying to make it possible 
to write an isiterable() that returns True whenever __iter__ is 
present?  That would be at odds with the approach taken with 
list.__hash__ which has to be called in order to find-out it is not 
hashable.


Raymond




More information about the Python-3000 mailing list