Proposal: min(None, x) and max(None, x) return x

Samuele Pedroni pedronis at bluewin.ch
Fri Nov 22 11:33:03 EST 2002


This should always/everywhere do the trick:

class _SupBehavior(object):
  def __repr__(self): return 'Sup'
  def __ge__(self,o): return True
  def __gt__(self,o): return self is not o
  def __lt__(self,o): return False
  def __le__(self,o): return self is o

Sup=_SupBehavior()





More information about the Python-list mailing list