Overloading and? was <RE: Should I prefer an external database>

Bjorn Pettersen BPettersen at NAREX.com
Tue Apr 22 20:16:56 EDT 2003


> From: Andrew Dalke [mailto:adalke at mindspring.com] 
> 
> Bjorn Pettersen:
> > From: Ian Bicking [mailto:ianb at colorstudy.com]
> [... + SQLObject example]
> 
> > for paper in Paper.select(AND(Paper.q.title == 'foo',
> >                               Paper.q.author.startswith('Bob'))):
> 
> > Does anyone know the reason for not allowing an overload of the and
> > operator?
> 
> The 'and' and 'or' operators work on the boolean-ness of the objects,
> and apply short-circuit behaviour.  This is different than 
> other binary
> operators, which don't short-circuit.

Ah! Thanks.

-- bjorn





More information about the Python-list mailing list