Skip to content

Closes 5172 -- adds overloads to hash in numeric.py - #5217

Merged
ajpotts merged 1 commit into
Bears-R-Us:mainfrom
drculhane:Closes-5172
Dec 23, 2025
Merged

ajpotts merged 1 commit into
Bears-R-Us:mainfrom
drculhane:Closes-5172

Conversation

@drculhane

@drculhane drculhane commented Dec 23, 2025 •

Copy link
Copy Markdown
Contributor

Closes #5172.

This adds overloads to the hash function in numeric.py, implements typechecking in hash, removes the type: ignore comment, and removes the comment describing that the function was not being typechecked.

It does not add overloads to the hash functions in categorical, segarray or strings, because all of those are of the form def hash (self).

IMHO, the overloads are a bit wordy, but this is what mypy requires. I did consult chatGPT, which did not recommend breaking out the elements of the Union, since that aspect doesn't affect the output type. Only the value of full does.

@jaketrookman jaketrookman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@ajpotts ajpotts left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@ajpotts
ajpotts added this pull request to the merge queue Dec 23, 2025
Merged via the queue into Bears-R-Us:main with commit dcdbd12 Dec 23, 2025
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

Successfully merging this pull request may close these issues.

overloads to hash function

3 participants