Skip to content

Conversation

@drculhane
Copy link
Contributor

@drculhane drculhane commented Dec 23, 2025

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.

Copy link
Contributor

@jaketrookman jaketrookman left a comment

Choose a reason for hiding this comment

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

Looks good

Copy link
Contributor

@ajpotts ajpotts left a comment

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
21 checks passed
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