[EMAIL PROTECTED] wrote:
> hey fredrik,
>
> i don't understand what you are saying
Do what he showed in the Python interactive shell,
> Fredrik Lundh wrote:
> > 'food' or 'drink' doesn't do what you think it does:
> >
> > >>> 'food' or 'drink'
> > 'food'
> >
> > >>> {'class': 'food' or 'drink'}
> > {'class': 'food'}
"or" returns the first true element, anything but False or None, I
think... so 'food' (a string) is true, and always will return in that
code.
http://diveintopython.org/power_of_introspection/and_or.html
Brett
--
http://mail.python.org/mailman/listinfo/python-list