unorderable error: less ok, equal ok, less-or-equal gives unorderable error!

Ethan Furman ethan at stoneleaf.us
Mon Jun 30 15:52:51 EDT 2014


On 06/30/2014 12:34 PM, Peter Otten wrote:
> RainyDay wrote:
>>
>>      def __eq__(self, other):
>>          return self._loc == getattr(other, "_loc", None)
>
> Note that None is not a good default when _loc is expected to be a tuple:

In this case None is not being returned, but will be comparid with self._loc, so RainyDay is good there.

--
~Ethan~



More information about the Python-list mailing list