Title: "class property" should be Generic[T] · Issue #4731 · python/typeshed · GitHub
Open Graph Title: "class property" should be Generic[T] · Issue #4731 · python/typeshed
X Title: "class property" should be Generic[T] · Issue #4731 · python/typeshed
Description: Currently property.__get__ returns Any, which loose information: typeshed/stdlib/3/builtins.pyi Line 877 in c58a93b class property(object): This would be more correct for property.__get__ to be generic and return T. Similar to cached_pro...
Open Graph Description: Currently property.__get__ returns Any, which loose information: typeshed/stdlib/3/builtins.pyi Line 877 in c58a93b class property(object): This would be more correct for property.__get__ to be gen...
X Description: Currently property.__get__ returns Any, which loose information: typeshed/stdlib/3/builtins.pyi Line 877 in c58a93b class property(object): This would be more correct for property.__get__ to be gen...
Opengraph URL: https://github.com/python/typeshed/issues/4731
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"\"class property\" should be Generic[T]","articleBody":"Currently `property.__get__` returns `Any`, which loose information:\r\n\r\nhttps://github.com/python/typeshed/blob/c58a93b928b07a5123fa8ceebe6087fa262fe238/stdlib/3/builtins.pyi#L877\r\n\r\nThis would be more correct for `property.__get__` to be generic and return `T`. Similar to cached_property:\r\n\r\nhttps://github.com/python/typeshed/blob/1dd1b701c97e4bff9b8e05fb58ce8d3dd27aa213/stdlib/3/functools.pyi#L113\r\n\r\n```py\r\nclass A:\r\n\r\n @cached_property\r\n def f(self) -> int: # f is `cached_property[int]`, f.__get__() -> int\r\n ...\r\n\r\n @property\r\n def g(self) -> int: # f is `property[Any]`, g.__get__() -> Any\r\n ...\r\n```\r\n","author":{"url":"https://github.com/Conchylicultor","@type":"Person","name":"Conchylicultor"},"datePublished":"2020-10-30T09:30:39Z","url":"https://github.com/python/typeshed/issues/4731"}
| 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:af3750db-e0cd-03b5-ab4c-8ff263d5d29f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | EC76:2DB972:2FAC076:3F2CC68:6B002BF2 |
| html-safe-nonce | 0ed917d656aabee5f274f24ede9141f3b29a8b5672a61ab530be63a83a9a784c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQzc2OjJEQjk3MjoyRkFDMDc2OjNGMkNDNjg6NkIwMDJCRjIiLCJ2aXNpdG9yX2lkIjoiNTQ2MTQ3ODAwMTYxNzE1MzAxMSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 514b3d76a362753cb8b2f5376831feb2794b0646a23be8de0a5ac46d08dbb3f6 |
| hovercard-subject-tag | issue:733021774 |
| 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/4731/issue_layout |
| twitter:image | https://opengraph.githubassets.com/c6d0339d22eefb2b092c1274158e7fa7772f23238037c070cb02d4ddc5199fff/python/typeshed/issues/4731 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c6d0339d22eefb2b092c1274158e7fa7772f23238037c070cb02d4ddc5199fff/python/typeshed/issues/4731 |
| og:image:alt | Currently property.__get__ returns Any, which loose information: typeshed/stdlib/3/builtins.pyi Line 877 in c58a93b class property(object): This would be more correct for property.__get__ to be gen... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Conchylicultor |
| hostname | github.com |
| expected-hostname | github.com |
| None | 7d0829bbde9e48b2486cb5dd6d147896eb01d32134627091f818958a935ef3f0 |
| 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 | f3f3a43ca095cdea3abbb394112e971f9fdb94fa |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width