On Mon, Jun 29, 2020 at 1:53 AM Stephen J. Turnbull <
[email protected]> wrote:
> But if it turns out that somebody *wants* to check "2 is 2.0",
> this .add_unique can serve both purposes.
>
can it though? (or should it?) -- the fact is that it was decided the 2 and
2.0 are equivalent as members of a set (which makes great sense, there are
they SAME number, and the difference is an implementation detail), so the
answer to:
2.0 in {2}
and
2 in {2.0}
is True
I've lost track, but the answer to
a_set.add_unique(2)
should always be the same as
a_set.add_unique(2.0)
for the same set.
-CHB
--
Christopher Barker, PhD
Python Language Consulting
- Teaching
- Scientific Software Development
- Desktop GUI and Web Development
- wxPython, numpy, scipy, Cython
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/archives/list/[email protected]/message/G52XJGXY7HGYGSPNFEOPX53OPL3JYBY3/
Code of Conduct: http://python.org/psf/codeofconduct/