Manipulating MySQL Sets

MRAB python at mrabarnett.plus.com
Sat Dec 12 18:36:06 EST 2009


Victor Subervi wrote:
> On Sat, Dec 12, 2009 at 5:11 PM, Carsten Haese <carsten.haese at gmail.com 
> <mailto:carsten.haese at gmail.com>> wrote:
> 
>     Victor Subervi wrote:
>      > Hi;
>      > What type does python consider a MySQL Set??
> 
>     Let's take a look:
> 
[snip]
> 
>     Looks like a string to me.
> 
> 
> Yep, sure does, but it isn't. Again:
> 
>               if isinstance(colValue[0], (str, int, long, float, long, 
> complex, unicode, list, buffer, xrange, tuple)):
>                 pass
>               else:
>                 print 'XXX'
> 
> and those "strings" printed triple-X. It ain't no string. Besides, if it 
> were a string, I'd be able to slice it, wouldn't I? Can't slice it either.
> 
If you want to know what type colValue[0] is, print type(colValue[0]).



More information about the Python-list mailing list