MySQL set and enum, calling values

Carsten Haese carsten.haese at gmail.com
Fri Dec 11 14:12:35 EST 2009


Victor Subervi wrote:
> [...] if I go to print, say,
> colFieldValues[20], which is a set, it prints out the whole set:
> set('Extra-small','Small','Medium','Large','XLarge','XXLarge','XXXLarge')
> But if I print out colFieldValues[20][0], it prints out "s".

The only reasonable explanation of this behavior is that despite all
your wishing for it to be a set, colFieldValues[20] is in fact not a
set, but rather a string. It is a string containing the letter s,
followed by the letter e, followed by the letter t, followed by an
openening parenthesis, and so on.

> Also, how can I test
> for it? It's an instance of string. How do I know if it's a set?

That's a fantastic question. Python thinks it's a string. What makes you
think it's a set?

--
Carsten Haese
http://informixdb.sourceforge.net




More information about the Python-list mailing list