Skip to content
This repository has been archived by the owner on May 31, 2020. It is now read-only.

Duplicated values of equivalent but different data types in set #859

Open
BPYap opened this issue Jun 30, 2018 · 1 comment
Open

Duplicated values of equivalent but different data types in set #859

BPYap opened this issue Jun 30, 2018 · 1 comment

Comments

@BPYap
Copy link
Contributor

BPYap commented Jun 30, 2018

Consider the following code:

x = {1, 1.0, True}
for i in x:
    print(i)

Running it in Python 3.6 interpreter produces the following output:

1

Meanwhile running it in voc produces the following output:

1.0
1
True

According to this stack overflow topic, the value 1, 1.0 and True are equal when compared so Python will only keep 1 value in set.

BPYap added a commit to BPYap/voc that referenced this issue Jun 30, 2018
@BPYap BPYap changed the title Duplicated values of same hash value but different data types in set Duplicated values of equivalent but different data types in set Jun 30, 2018
freakboy3742 added a commit that referenced this issue Jul 6, 2018
@BPYap
Copy link
Contributor Author

BPYap commented Jul 13, 2018

Fixed. Closing it now 😄

Edit: Oops, looks like I closed the wrong issue, reopening again.

@BPYap BPYap closed this as completed Jul 13, 2018
@BPYap BPYap reopened this Jul 14, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant