[Python-Dev] PEP 207 -- Rich Comparisons

Greg Ewing greg@cosc.canterbury.ac.nz
Tue, 19 Dec 2000 12:04:42 +1300 (NZDT)


[Paul Barrett]
> ...
> Can someone provide an example in mathematics where comparison
> operators are used in a non-boolean, ie. rich comparison, context.
> If so, this might shut me up!

Not exactly mathematical, but some day I'd like to create
a database access module which lets you say things like

  mydb = OpenDB("inventory")
  parts = mydb.parts
  tuples = mydb.retrieve(parts.name, parts.number).where(parts.quantity >= 42)

Of course, to really make this work I need to be able
to overload "and" and "or" as well, but that's a whole
'nother PEP...

Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,	   | A citizen of NewZealandCorp, a	  |
Christchurch, New Zealand	   | wholly-owned subsidiary of USA Inc.  |
greg@cosc.canterbury.ac.nz	   +--------------------------------------+