req: OO SQL gen module?

Kragen Sitaker kragen at dnaco.net
Mon Mar 6 15:24:17 EST 2000


In article <38C2E097.BA3C38E8 at roguewave.com>,
Bjorn Pettersen  <bjorn at roguewave.com> wrote:
>A while ago I was attempting to swig a c++ library that did exactly this, but
>ran into problems when I couldn't overload the individual comparison operators
>for a python class, e.g. consider (assuming Table.__getitem__() returns a Column
>object):
>
>    t = Table('foo')
>    s = Select( t['col1'], t['col2'] )
>    s.where( t['col3'] > 5 )  # oops, not possible

That would be nice syntactic sugar, but you could just as easily say
s.where(greater(t['col3'], 5)), couldn't you?
-- 
<kragen at pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
The Internet stock bubble didn't burst on 1999-11-08.  Hurrah!
<URL:http://www.pobox.com/~kragen/bubble.html>
The power didn't go out on 2000-01-01 either.  :)



More information about the Python-list mailing list