Closed cknv closed 8 years ago
This should close #95 by making the Node give up comparisons with things that are not of its class.
Node
I went with returning NotImplemented as that gives other a chance to do the comparison.
NotImplemented
other
I thought about using
if not isinstance(other, type(self)): ...
But I don't really know what is the preferred style, so I just went with the simpler.
Thanks again for the good patch! :-D
I didn't know about the NotImplemented technique, nice.
This should close #95 by making the
Node
give up comparisons with things that are not of its class.I went with returning
NotImplemented
as that givesother
a chance to do the comparison.I thought about using
But I don't really know what is the preferred style, so I just went with the simpler.