Implicit lists

Christian Tismer tismer at tismer.com
Thu Jan 30 22:36:51 EST 2003


Alex Martelli wrote:

...

>>But i agree that grouping into 'non-iterables except strings and
>>unicode' on one side and everything else on the other side most
>>often makes sense.
> 
> 
> Yes, as long as you also include "instances of UserString and
> the like" among "strings and unicode".  Personally, I prefer to
> talk of "string-like objects", and my favourite way to check if
> an object is string-like is to see if thatobject+'' raises an
> exception -- if it doesn't, it's stringlike enough for me.

Besides th fact that I believe strings as sequences
should be deprecated, since nobody makes use of it,
but everybody fights it...
... I can't see the relevance of UserString.
Wasn't getting rid of UserAnything one of the reasons
for the introduction of the unified type/class system?
UserString is only a compatibility module, IMHO.

But maybe we could simplify matters by providing something
like a stringlike() inquiry function.
Strings being seen as sequences always have been a PITA
for me, especially in user argument lists vs non lists.

ciao - chris






More information about the Python-list mailing list