Enumerating formatting strings

Greg Ewing greg at cosc.canterbury.ac.nz
Thu Apr 21 01:08:37 EDT 2005


Peter Otten wrote:
> Greg Ewing wrote:
>>
>>This seems to happen even with a custom subclass of tuple,
>>so it must be doing an exact type check.
> 
> No, it doesn't do an exact type check, but always calls the tuple method:

I guess you mean len(). On further investigation,
this seems to be right, except that it doesn't
invoke a __len__ defined in a custom subclass.
So there's something in there hard-coded to
expect a built-in tuple.

In any case, the original idea isn't possible.

-- 
Greg Ewing, Computer Science Dept,
University of Canterbury,	
Christchurch, New Zealand
http://www.cosc.canterbury.ac.nz/~greg



More information about the Python-list mailing list