Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should TrueTie([1, 0]) == TrueTie([1, 0])? #18

Open
endolith opened this issue Aug 8, 2022 · 3 comments
Open

Should TrueTie([1, 0]) == TrueTie([1, 0])? #18

endolith opened this issue Aug 8, 2022 · 3 comments

Comments

@endolith
Copy link
Contributor

endolith commented Aug 8, 2022

Currently this is False.

Probably should be True and probably TrueTie should be a subclass of set, similar to my comment on #17 (comment)?

So that TrueTie([1, 0]) == TrueTie((0, 1)) == TrueTie({1, 0, 1}) is also True.

TrueTie([1, 0]) == TrueTie([1, 0])
Out[53]: False

set([0, 1]) == set((1, 0)) == set({1, 0, 1})
Out[54]: True
@endolith
Copy link
Contributor Author

endolith commented Aug 8, 2022

Also would be good if TrueTie had a __repr__ that showed the tied winners? Instead of <STAR.TrueTie at 0x188dc2885c8>. If TrueTie({0, 1}) had a __repr__ of TrueTie({0, 1}), it would fit the convention of "If at all possible, this should look like a valid Python expression that could be used to recreate an object with the same value"

@mikefranze
Copy link
Contributor

Quick fix would be TrueTie([1,0]).tied ==TrueTie([1,0]).tied, but wouldn't work if elements are out of order. I'll think on the set vs list issue.

@mikefranze
Copy link
Contributor

Tried changing to set in #17, seems to work well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants