Title: type of class member can be a free type variable · Issue #1903 · python/mypy · GitHub
Open Graph Title: type of class member can be a free type variable · Issue #1903 · python/mypy
X Title: type of class member can be a free type variable · Issue #1903 · python/mypy
Description: This doesn't make sense: from typing import TypeVar T = TypeVar('T') class A: def __init__(self, x: T) -> None: self.x = x a = A(1) reveal_type(a.x) # E: Revealed type is 'T`-1' I guess we need to check that the types of class attributes...
Open Graph Description: This doesn't make sense: from typing import TypeVar T = TypeVar('T') class A: def __init__(self, x: T) -> None: self.x = x a = A(1) reveal_type(a.x) # E: Revealed type is 'T`-1' I guess we need to ...
X Description: This doesn't make sense: from typing import TypeVar T = TypeVar('T') class A: def __init__(self, x: T) -> None: self.x = x a = A(1) reveal_type(a.x) # E: Revealed type is 'T`-1...
Opengraph URL: https://github.com/python/mypy/issues/1903
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"type of class member can be a free type variable","articleBody":"This doesn't make sense:\n\n``` py\nfrom typing import TypeVar\n\nT = TypeVar('T')\n\nclass A:\n def __init__(self, x: T) -> None:\n self.x = x\n\na = A(1)\nreveal_type(a.x) # E: Revealed type is 'T`-1'\n```\n\nI guess we need to check that the types of class attributes don't contain free type variables. (Type variables that are bound by the class declaration, i.e. deriving from `Generic[T]`, are okay of course.)\n","author":{"url":"https://github.com/rwbarton","@type":"Person","name":"rwbarton"},"datePublished":"2016-07-18T22:24:18Z","url":"https://github.com/python/mypy/issues/1903"}
| 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:3500aa73-c7b9-942e-b8d5-d5efb8280dd9 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B0DC:28FEA:208C4E:2D933A:6B005806 |
| html-safe-nonce | 6e0ff2cd756c8f3c335207ee89b29a81ae9c7183675903cfacaadb6a7d115fb4 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMERDOjI4RkVBOjIwOEM0RToyRDkzM0E6NkIwMDU4MDYiLCJ2aXNpdG9yX2lkIjoiMTI4Njc4NTIzMzU4NDM1MzM1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 48e676f76afa367666cf63a4369090c7eccaf73c139b14e2007456125b03dc42 |
| hovercard-subject-tag | issue:166207813 |
| 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/1903/issue_layout |
| twitter:image | https://opengraph.githubassets.com/8b90a27d4d54ba4b4b328d5778eb88c91e1de1e67549c708e5c24d8757ffbca9/python/mypy/issues/1903 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/8b90a27d4d54ba4b4b328d5778eb88c91e1de1e67549c708e5c24d8757ffbca9/python/mypy/issues/1903 |
| og:image:alt | This doesn't make sense: from typing import TypeVar T = TypeVar('T') class A: def __init__(self, x: T) -> None: self.x = x a = A(1) reveal_type(a.x) # E: Revealed type is 'T`-1' I guess we need to ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | rwbarton |
| hostname | github.com |
| expected-hostname | github.com |
| None | 29be975efff6507a5d135de9c7d634cf7ff8f0c55222a64386ab3202209aaf73 |
| 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 | eacd927ba6112e3b01ba99c762bd699a4a4f5df7 |
| ui-target | canary-1 |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width