Single string vs list of strings

greg greg at cosc.canterbury.ac.nz
Fri Oct 31 04:54:33 EDT 2008


Grant Edwards wrote:

> Checking to see if something is a sequence of strings is a bit
> trickier, since a string is actually a sequence of strings.

For that reason I'd just check whether it's a string,
and if it's anything else, assume it's a sequence of
strings. You'll find out soon enough if it doesn't
support indexing or iterating or whatever you want to
do with it.

-- 
Greg



More information about the Python-list mailing list