Title: Generic ClassVar Type failing · Issue #5144 · python/mypy · GitHub
Open Graph Title: Generic ClassVar Type failing · Issue #5144 · python/mypy
X Title: Generic ClassVar Type failing · Issue #5144 · python/mypy
Description: With mypy 0.600 (and the latest master eb1bb064d707ce05735ff6795df82126e75ea6ea), running mypy on from typing import ClassVar, Type, Generic, TypeVar _T = TypeVar('_T') class Array(Generic[_T]): _length_: ClassVar[int] _type_: ClassVar[T...
Open Graph Description: With mypy 0.600 (and the latest master eb1bb064d707ce05735ff6795df82126e75ea6ea), running mypy on from typing import ClassVar, Type, Generic, TypeVar _T = TypeVar('_T') class Array(Generic[_T]): _l...
X Description: With mypy 0.600 (and the latest master eb1bb064d707ce05735ff6795df82126e75ea6ea), running mypy on from typing import ClassVar, Type, Generic, TypeVar _T = TypeVar('_T') class Array(Generic[...
Opengraph URL: https://github.com/python/mypy/issues/5144
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Generic ClassVar Type failing","articleBody":"With mypy `0.600` (and the latest master `eb1bb064d707ce05735ff6795df82126e75ea6ea`), running mypy on\r\n\r\n```python\r\nfrom typing import ClassVar, Type, Generic, TypeVar\r\n\r\n_T = TypeVar('_T')\r\n\r\nclass Array(Generic[_T]):\r\n _length_: ClassVar[int]\r\n _type_: ClassVar[Type[_T]]\r\n\r\ndef generate() -> Type[Array[float]]:\r\n pass\r\n\r\ngenerate()._type_(3)\r\n```\r\n\r\nfails with\r\n\r\n```python\r\ntest.py:12: error: Too many arguments for \"object\"\r\n```\r\n\r\ninstead of allowing this to construct a `float`.\r\n\r\nThe original use-case here is in the `ctypes` stubs, where mypy fails to derive the type of `(ctypes.c_float * 5)._type_` -- see:\r\n\r\nhttps://github.com/python/typeshed/blob/9ec6d476c44729ea84e9cafde9c5a77610451b0c/stdlib/2and3/ctypes/__init__.pyi#L248-L250","author":{"url":"https://github.com/alanhdu","@type":"Person","name":"alanhdu"},"datePublished":"2018-06-04T20:50:09Z","url":"https://github.com/python/mypy/issues/5144"}
| 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:fea3f9ec-4fe1-a225-e64a-10470fa6677a |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D2EE:278022:DCDB69:120501A:6AFFF992 |
| html-safe-nonce | ae9e8d88301a98879936c0f3eb4fec07fbeac8ea251c2decc8812162ce974123 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMkVFOjI3ODAyMjpEQ0RCNjk6MTIwNTAxQTo2QUZGRjk5MiIsInZpc2l0b3JfaWQiOiIyNzgzODcxOTkwNTg1MzU4NzM4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 45765447cf3dd70938480c50ba61889ab8a7cae5ad6da54a2f7c082437fb6293 |
| hovercard-subject-tag | issue:329211743 |
| 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/5144/issue_layout |
| twitter:image | https://opengraph.githubassets.com/2f0c6e17b5693022c1bf9c1356582954a7b9fdea79af34fb938be1112afcf189/python/mypy/issues/5144 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/2f0c6e17b5693022c1bf9c1356582954a7b9fdea79af34fb938be1112afcf189/python/mypy/issues/5144 |
| og:image:alt | With mypy 0.600 (and the latest master eb1bb064d707ce05735ff6795df82126e75ea6ea), running mypy on from typing import ClassVar, Type, Generic, TypeVar _T = TypeVar('_T') class Array(Generic[_T]): _l... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | alanhdu |
| hostname | github.com |
| expected-hostname | github.com |
| None | 0a0d8686a27478df474dd7415776a7a080cde8838b3cd92ea7601187572e5729 |
| 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 | 16a11879678aaf97e2a42c33ee70830aa084fa37 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width