Title: `type[object]` is not considered `Hashable`, when it is. And inconsistent inference of `type`s · Issue #11469 · python/mypy · GitHub
Open Graph Title: `type[object]` is not considered `Hashable`, when it is. And inconsistent inference of `type`s · Issue #11469 · python/mypy
X Title: `type[object]` is not considered `Hashable`, when it is. And inconsistent inference of `type`s · Issue #11469 · python/mypy
Description: from typing import Hashable o1: type[object] = object o2: type[int] = int t1: type[type] = type o3 = object reveal_type(o1) # note: Revealed type is "Type[builtins.object]" reveal_type(o2) # note: Revealed type is "Type[builtins.int]" re...
Open Graph Description: from typing import Hashable o1: type[object] = object o2: type[int] = int t1: type[type] = type o3 = object reveal_type(o1) # note: Revealed type is "Type[builtins.object]" reveal_type(o2) # note: ...
X Description: from typing import Hashable o1: type[object] = object o2: type[int] = int t1: type[type] = type o3 = object reveal_type(o1) # note: Revealed type is "Type[builtins.object]" reveal_type(o2...
Opengraph URL: https://github.com/python/mypy/issues/11469
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`type[object]` is not considered `Hashable`, when it is. And inconsistent inference of `type`s","articleBody":"```py\r\nfrom typing import Hashable\r\n\r\no1: type[object] = object\r\no2: type[int] = int\r\nt1: type[type] = type\r\no3 = object\r\nreveal_type(o1) # note: Revealed type is \"Type[builtins.object]\"\r\nreveal_type(o2) # note: Revealed type is \"Type[builtins.int]\"\r\nreveal_type(t1) # note: Revealed type is \"Type[builtins.type]\"\r\nreveal_type(o3) # Revealed type is \"def () -> builtins.object\"\r\nh1: Hashable = o1 # error: Incompatible types in assignment (expression has type \"Type[object]\", variable has type \"Hashable\")\r\nh2: Hashable = o2 # error: Incompatible types in assignment (expression has type \"Type[int]\", variable has type \"Hashable\")\r\nh3: Hashable = t1 # no errror\r\nh4: Hashable = o3 # no errror\r\n```\r\n\r\nWhy come `reveal_type(object)` is `def () -> object` not `type[object]`??","author":{"url":"https://github.com/KotlinIsland","@type":"Person","name":"KotlinIsland"},"datePublished":"2021-11-05T03:58:58Z","url":"https://github.com/python/mypy/issues/11469"}
| 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:a439bfae-b4fb-3d08-1268-770bffd05eb0 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 90A0:D064:20BE23A:2C66853:6B001CF8 |
| html-safe-nonce | 478c073819f9aafbee59e8baf3a63f2228271ff8b86fb409a4abd3ac291794da |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MEEwOkQwNjQ6MjBCRTIzQToyQzY2ODUzOjZCMDAxQ0Y4IiwidmlzaXRvcl9pZCI6IjE0ODQ3NTk0MzcxMjkyOTMwNDgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 091dc4acfad127deb256bb7ec17693a347cecccb0f58fb13ec1a9fc42e9a0a29 |
| hovercard-subject-tag | issue:1045431051 |
| 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/mypy/11469/issue_layout |
| twitter:image | https://opengraph.githubassets.com/1e1a7c612d30a531649566ce6d8be6af8af661753b612209367a04aa5dd0cb8d/python/mypy/issues/11469 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/1e1a7c612d30a531649566ce6d8be6af8af661753b612209367a04aa5dd0cb8d/python/mypy/issues/11469 |
| og:image:alt | from typing import Hashable o1: type[object] = object o2: type[int] = int t1: type[type] = type o3 = object reveal_type(o1) # note: Revealed type is "Type[builtins.object]" reveal_type(o2) # note: ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | KotlinIsland |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4eb4cba0d69f045374ac15de9666d22b0961e1d555cc3824f36b7734c00c78e0 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/mypy git https://github.com/python/mypy.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 7053637 |
| octolytics-dimension-repository_nwo | python/mypy |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 7053637 |
| octolytics-dimension-repository_network_root_nwo | python/mypy |
| 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 | 44c658b24abf00491fb7ae5f56d42c9f38cbeab2 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width