On 5 December 2015 at 12:56, Noufal Ibrahim KV <nou...@nibrahim.net.in> wrote: > > > So I came across this today.. > > >>> class Number(object): > ... def __init__(self, n): > ... self.n = n > ... > >>> m = Number(10) > >>> n = Number(5) > >>> > >>> m < n > True > > This is documented like so > > > If no __cmp__(), __eq__() or __ne__() operation is defined, class > > instances are compared by object identity (“address”). > > over here https://docs.python.org/2/reference/datamodel.html#object.__cmp__
Maybe because that was the historical way that C did it? I agree that the Python 3 exception makes more sense. Regards, Gora _______________________________________________ BangPypers mailing list BangPypers@python.org https://mail.python.org/mailman/listinfo/bangpypers