Title: Builtins are incorrectly hinted as unhashable · Issue #10424 · python/typeshed · GitHub
Open Graph Title: Builtins are incorrectly hinted as unhashable · Issue #10424 · python/typeshed
X Title: Builtins are incorrectly hinted as unhashable · Issue #10424 · python/typeshed
Description: I believe this was partially introduced by #8465. I ran into this issue while looking into microsoft/pyright#5446. According to the python docs, a type that redefines __eq__ but not __hash__ is unhashable. In the current typeshed hints, ...
Open Graph Description: I believe this was partially introduced by #8465. I ran into this issue while looking into microsoft/pyright#5446. According to the python docs, a type that redefines __eq__ but not __hash__ is unh...
X Description: I believe this was partially introduced by #8465. I ran into this issue while looking into microsoft/pyright#5446. According to the python docs, a type that redefines __eq__ but not __hash__ is unh...
Opengraph URL: https://github.com/python/typeshed/issues/10424
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Builtins are incorrectly hinted as unhashable","articleBody":"I believe this was partially introduced by #8465. I ran into this issue while looking into https://github.com/microsoft/pyright/issues/5446.\r\n\r\nAccording to [the python docs](https://docs.python.org/3/reference/datamodel.html#object.__hash__:~:text=A%20class%20that%20overrides%20__eq__()%20and%20does%20not%20define%20__hash__()%20will%20have%20its%20__hash__()%20implicitly%20set%20to%20None), a type that redefines `__eq__` but not `__hash__` is unhashable.\r\n\r\nIn the current typeshed hints, many types explicitly define `__eq__` ([int for example](https://github.com/python/typeshed/blob/main/stdlib/builtins.pyi#L310)) but do not define hash. A type checker could incorrectly assume that the type is unhashable because of this.","author":{"url":"https://github.com/TheTripleV","@type":"Person","name":"TheTripleV"},"datePublished":"2023-07-09T07:07:33Z","url":"https://github.com/python/typeshed/issues/10424"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:ce10f712-a994-4313-5ccd-1d9266443f5d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | ED32:30E5B0:2D12BBF:3B5E31E:6B001A95 |
| html-safe-nonce | ab6ff7240260133982ab7d85a468b02af837ba12f8e8f1f1faccb30fa0f16803 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFRDMyOjMwRTVCMDoyRDEyQkJGOjNCNUUzMUU6NkIwMDFBOTUiLCJ2aXNpdG9yX2lkIjoiNjQyMjE5MDIzNjQ0MDIwNTk3MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 09d328fe5d4e047cd8192626dc97d71c0a3c5eee4f526beb42121021537e742e |
| hovercard-subject-tag | issue:1795272882 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/typeshed/10424/issue_layout |
| twitter:image | https://opengraph.githubassets.com/75aed12e711a8ab221a2bb7f1f400e0cef098ffc9961294dcd88741accdd836d/python/typeshed/issues/10424 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/75aed12e711a8ab221a2bb7f1f400e0cef098ffc9961294dcd88741accdd836d/python/typeshed/issues/10424 |
| og:image:alt | I believe this was partially introduced by #8465. I ran into this issue while looking into microsoft/pyright#5446. According to the python docs, a type that redefines __eq__ but not __hash__ is unh... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | TheTripleV |
| hostname | github.com |
| expected-hostname | github.com |
| None | a2dd2291b1b13cc9c06f27ec92fa3dbaf34116fc24c9347b8539db61884c59f4 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/typeshed git https://github.com/python/typeshed.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 31696383 |
| octolytics-dimension-repository_nwo | python/typeshed |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 31696383 |
| octolytics-dimension-repository_network_root_nwo | python/typeshed |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 70121d4e855ee0bb7b75cf15d061d91f8863c0f8 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width