Title: Add support for classmethod property from python3.9 · Issue #11619 · python/mypy · GitHub
Open Graph Title: Add support for classmethod property from python3.9 · Issue #11619 · python/mypy
X Title: Add support for classmethod property from python3.9 · Issue #11619 · python/mypy
Description: class Foo: @classmethod @property def bar(cls) -> str: return cls.__name__ def foo_bar(msg: str) -> None: print(msg) foo_bar(Foo.bar) mypy --python-version 3.9 test.py test.py:11: error: Argument 1 to "foo_bar" has incompatible type "Cal...
Open Graph Description: class Foo: @classmethod @property def bar(cls) -> str: return cls.__name__ def foo_bar(msg: str) -> None: print(msg) foo_bar(Foo.bar) mypy --python-version 3.9 test.py test.py:11: error: Argument 1...
X Description: class Foo: @classmethod @property def bar(cls) -> str: return cls.__name__ def foo_bar(msg: str) -> None: print(msg) foo_bar(Foo.bar) mypy --python-version 3.9 test.py test.py:11: error: Argu...
Opengraph URL: https://github.com/python/mypy/issues/11619
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Add support for classmethod property from python3.9","articleBody":"```python\r\nclass Foo:\r\n @classmethod\r\n @property\r\n def bar(cls) -> str:\r\n return cls.__name__ \r\n\r\n\r\ndef foo_bar(msg: str) -> None:\r\n print(msg)\r\n\r\nfoo_bar(Foo.bar)\r\n```\r\n\r\n> mypy --python-version 3.9 test.py\r\ntest.py:11: error: Argument 1 to \"foo_bar\" has incompatible type \"Callable[[], str]\"; expected \"str\"\r\nFound 1 error in 1 file (checked 1 source file)\r\n\r\nAs stated in https://docs.python.org/3.9/library/functions.html#classmethod this new classmethod property is completely valid so mypy shouldn't report an error.\r\n","author":{"url":"https://github.com/YaN-3k","@type":"Person","name":"YaN-3k"},"datePublished":"2021-11-25T20:58:50Z","url":"https://github.com/python/mypy/issues/11619"}
| 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:b871ad68-a534-1bd7-c801-f0f1e2b12e05 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A08A:21E5F:462137:5E5B1E:6B002D70 |
| html-safe-nonce | cc68a711eb672af0e70ea01191283b4af47bfeeda19f889ac88cc1c65f8519c7 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMDhBOjIxRTVGOjQ2MjEzNzo1RTVCMUU6NkIwMDJENzAiLCJ2aXNpdG9yX2lkIjoiMzk3OTM2NDk0OTAzNzE2NTkzNyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 5a94037e92e1715e17d4d492ea0109aa99cf85d106c57a051c4c68ebcba9d6ff |
| hovercard-subject-tag | issue:1063916123 |
| 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/11619/issue_layout |
| twitter:image | https://opengraph.githubassets.com/7f9e580583894f9328856fdc27e8d1ad00d889ea3cac62d6a6efe9bbcdf82b79/python/mypy/issues/11619 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/7f9e580583894f9328856fdc27e8d1ad00d889ea3cac62d6a6efe9bbcdf82b79/python/mypy/issues/11619 |
| og:image:alt | class Foo: @classmethod @property def bar(cls) -> str: return cls.__name__ def foo_bar(msg: str) -> None: print(msg) foo_bar(Foo.bar) mypy --python-version 3.9 test.py test.py:11: error: Argument 1... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | YaN-3k |
| hostname | github.com |
| expected-hostname | github.com |
| None | 7d0829bbde9e48b2486cb5dd6d147896eb01d32134627091f818958a935ef3f0 |
| 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 | f3f3a43ca095cdea3abbb394112e971f9fdb94fa |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width