On Mon, Jun 29, 2020 at 1:53 AM Stephen J. Turnbull <turnbull.stephen.fw@u.tsukuba.ac.jp> 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