Skip to content

Revert "Remove un-needed __hash__ methods from stdlib (#8465)" #10426

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

Merged
merged 1 commit into from
Jul 9, 2023

Conversation

AlexWaygood
Copy link
Member

@AlexWaygood AlexWaygood commented Jul 9, 2023

Reverts #8465
Fixes #10424
Closes #10425

#8465 caused regressions: see #10424 and python/mypy#13800. Since it didn't fix any known problems (just some stylistic nits that we had), let's just revert the PR.

@github-actions
Copy link
Contributor

github-actions bot commented Jul 9, 2023

Diff from mypy_primer, showing the effect of this PR on open source code:

prefect (https://github.com/PrefectHQ/prefect)
- src/prefect/utilities/templating.py:132: error: Incompatible types in assignment (expression has type "str", variable has type "dict[Any, Any]")  [assignment]
- src/prefect/utilities/templating.py:134: error: Incompatible types in assignment (expression has type "str", variable has type "dict[Any, Any]")  [assignment]
- src/prefect/utilities/templating.py:282: error: Incompatible types in assignment (expression has type "str", variable has type "dict[Any, Any]")  [assignment]
- src/prefect/utilities/templating.py:284: error: Incompatible types in assignment (expression has type "str", variable has type "dict[Any, Any]")  [assignment]

@JelleZijlstra
Copy link
Member

Seems like the mypy-primer hit is an example of python/mypy#13800. I wonder if it's because there's some change in whether mypy thinks a subclass of str and dict can exist.

@JelleZijlstra JelleZijlstra merged commit 81b8211 into python:main Jul 9, 2023
@AlexWaygood AlexWaygood deleted the add-back-hash-methods branch July 9, 2023 15:44
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.

Builtins are incorrectly hinted as unhashable
2 participants