-
Notifications
You must be signed in to change notification settings - Fork 25
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
KeyBuilder: change int to direct str representation #261
base: main
Are you sure you want to change the base?
Conversation
assert keyb(1) == keyb("1") | ||
assert keyb(1.0) != keyb("1.0") # '1.0' uses hex representation | ||
assert keyb(1+1j) == keyb("(1+1j)") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if this is an issue. If it is, we could change the KeyBuilder to (int, str(key))
.
@@ -432,9 +432,13 @@ def test_scalar_hashing() -> None: | |||
assert keyb(np.int32(1)) == keyb(np.int32(1)) | |||
assert keyb(np.int32(2)) != keyb(np.int32(1)) | |||
assert keyb(np.int64(1)) == keyb(np.int64(1)) | |||
assert keyb(1) == keyb(np.int64(1)) | |||
assert keyb(1) != keyb(np.int64(1)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait, I thought the goal was to keep them the same?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From your answer to my question in #260, my interpretation was that they don't need to be the same. Changing the code like in this PR perhaps also addresses #262.
9f739d0
to
2a19397
Compare
2a19397
to
7546ab8
Compare
Followup of #260.