[Patches] [ python-Patches-428320 ] rich comparisons as operator.__lt__ etc.

noreply@sourceforge.net noreply@sourceforge.net
Tue, 29 May 2001 07:58:38 -0700


Patches item #428320, was updated on 2001-05-29 07:58
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=428320&group_id=5470

Category: library
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Nobody/Anonymous (nobody)
Summary: rich comparisons as operator.__lt__ etc.

Initial Comment:
Rich Comparisons (PEP 207) introduce new special names
in classes (__lt__, __le__, __eq__, etc.). They should
be available in the 'operator' module just like the
other special names (__add__ and the like).

This patch introduce 12 new names in 'operator': lt,
le, eq, ne, gt, ge, __lt__, __le__, __eq__, __ne__,
__gt__, __ge__. The first 6 are provided for uniformity
with the rest of the module but I am not sure whether
it is a good idea to clutter a namespace with names
only two letters long; for example, could names like
'eq' accidentally break existing programs using

  from operator import *

?


----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=428320&group_id=5470