Steven Bethard wrote: > If a class defines only __cmp__, Python will do the appropriate > dance to make <, >, ==, etc. work right. If a class defines only > __eq__, __lt__, etc. Python will do the appropriate dance to make > cmp() work right.
With a four-way __cmp__, I wouldn't actually mind if the dance only worked one way, i.e. richcmp --> cmp. In that world, the only reason to define separate comparison operators would be if you were using them for something radically different from normal comparison. So defining __cmp__ could be defined as the standard way to implement comparison operators unless there's some reason you really can't do it that way, in which case you just have to live with cmp() not working on your type. -- Greg _______________________________________________ Python-3000 mailing list [email protected] http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com
