All the discussion following Steven's hypothetical .EQ. operator (yes, not
a possible spelling) just seems to drive home to me that what everyone
wants is simply a function.

Many different notions of "equivalence for a particular purpose" have been
mentioned.  We're not going to get a dozen different equality operators
(even Lisp or Javascript don't go that far).  But function names are
plentiful.  So just write your own:

has_same_elements(a, b)
case_insensitive_eq(a, b)
same_json_representation(a, b)
allclose(a, b)  # A version of this is in NumPy
recursively_equivalent(a, b)
nan_ignoring_equality(a, b)

And whatever others you like.  All of these seem straightforwardly relevant
to their particular use case (as do many others not listed).  But none of
them have a special enough status to co-opt the '==' operator or deserve
their own special operator.

-- 
The dead increasingly dominate and strangle both the living and the
not-yet born.  Vampiric capital and undead corporate persons abuse
the lives and control the thoughts of homo faber. Ideas, once born,
become abortifacients against new conceptions.
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/FIRBDVEQ4N6NVNQNJJ2L63AHQJPWIRV4/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to