Another Sets Problem
Emile van Sebille
emile at fenx.com
Tue Dec 29 11:34:50 EST 2009
On 12/29/2009 5:51 AM Victor Subervi said...
> > # print 'XXX', types[x]
> > elif types[x][0:3] == 'set':
> > for f in field:
> > print '<td>AAA%s</td>\n' % (field)
> > else:
> > print 'YYY'
> >
> > 1) If I uncomment the commented line, it throws this error:
> >
> What happens if you *don't* uncomment the commented line?
>
>
> As I mentioned, it prints BOTH the AAA and the YYY lines! The AAA is
> printed with something like this:
> AAASet([purple:223344])
Yes -- that's what a for-else does. See
http://www.ibiblio.org/swaroopch/byteofpython/read/for-loop.html for
example.
Emile
More information about the Python-list
mailing list