Tiago Katcipis | 17 May 20:16
Picon

Best way to define comparison

Im writing a class on python and i want to implement the == and != operators on it. I have read about __cmp__ and about __eq__ for == and __ne__ for ! =. My question is... who is the better to use? and if there is no better what are the advantages and disvantages of them. Some articles talk about using cmp, and others about the eq...its a little confusing :-(


_______________________________________________
Tutor maillist  -  Tutor <at> python.org
http://mail.python.org/mailman/listinfo/tutor

Gmane