class inheritance

Carl Banks pavlovevidence at gmail.com
Tue Mar 16 02:03:15 CET 2010


On Mar 15, 4:34 pm, JLundell <jlund... at pobox.com> wrote:
> It's also unfortunate that Python doesn't have an approximately-equal
> operator; it'd come in handy for floating-point applications while
> preserving hash. If only there were a ~= or ≈ operator I could
> overload. And ~ is unary, so no joy.

One problem with it is that there's no way to make it universal;
different appiplications have different ideas of close.  Conceivably
it could be usefully defined for a user type though..

Bacause of this problem almost no languages have an almost equal
operator.  I'm curious what languages do, of if there are any with a
trinary operator that also takes a threshold.

Carl Banks



More information about the Python-list mailing list