[Python-Dev] Iterable String Redux (aka String ABC)

Georg Brandl g.brandl at gmx.net
Fri May 30 08:21:44 CEST 2008


Greg Ewing schrieb:
> Georg Brandl wrote:
>> Greg Ewing schrieb:
>  >
>>> Doesn't isinstance(x, basestring) already cover that?
>> 
>> That doesn't cover UserString, for example.
> 
> A better solution to that might be to have UserString
> inherit from basestring.

But with that argument you could throw out the whole ABC machinery,
just let all lists inherit from list, all dicts from dict, etc.

Georg

-- 
Thus spake the Lord: Thou shalt indent with four spaces. No more, no less.
Four shall be the number of spaces thou shalt indent, and the number of thy
indenting shall be four. Eight shalt thou not indent, nor either indent thou
two, excepting that thou then proceed to four. Tabs are right out.



More information about the Python-Dev mailing list