Title: Mypy doesn't object to `cached_property` methods that don't exist · Issue #18327 · python/mypy · GitHub
Open Graph Title: Mypy doesn't object to `cached_property` methods that don't exist · Issue #18327 · python/mypy
X Title: Mypy doesn't object to `cached_property` methods that don't exist · Issue #18327 · python/mypy
Description: Bug Report Mypy includes functools.cached_property on it's list of property-list types, but considers it to be too identical to property. It allows the use of cached_property.setter and cached_property.deleter without raising an error, d...
Open Graph Description: Bug Report Mypy includes functools.cached_property on it's list of property-list types, but considers it to be too identical to property. It allows the use of cached_property.setter and cached_prop...
X Description: Bug Report Mypy includes functools.cached_property on it's list of property-list types, but considers it to be too identical to property. It allows the use of cached_property.setter and cached_...
Opengraph URL: https://github.com/python/mypy/issues/18327
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Mypy doesn't object to `cached_property` methods that don't exist","articleBody":"**Bug Report**\n\nMypy includes `functools.cached_property` on it's list of property-list types, but considers it to be *too* identical to property. It allows the use of `cached_property.setter` and `cached_property.deleter` without raising an error, despite the fact that neither of these are methods that exist on `cached_property`.\n\nI discovered this while looking at permutations of property-like behavior for https://github.com/python/typeshed/pull/13276.\n\n~~Actually, I realized just now that it can be anything from any of the property types. See the second playground link.~~ [Edit: this part fixed by #19313]\n\n**To Reproduce**\n\nPlayground link showing : https://mypy-play.net/?mypy=latest&python=3.12&gist=f5336c7a8df8f028a565bab576b74062\n\n~~This one shows that mypy doesn't object to non-existent methods of property used as a decorator:~~\n\n~~https://mypy-play.net/?mypy=latest&python=3.12&gist=d91764177a604ba5640a1fe741718f52~~ [Edit: this part fixed by #19313]\n\n**Expected Behavior**\n\nI expect mypy to generate errors for methods that don't exist in the stubs, even with the special-cased behavior.\n\n**Actual Behavior**\n\nNo errors are generated.\n\n\n","author":{"url":"https://github.com/tungol","@type":"Person","name":"tungol"},"datePublished":"2024-12-22T11:07:39Z","url":"https://github.com/python/mypy/issues/18327"}
| 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:1adcd089-517e-54cf-3e1f-8b18a262b743 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BA14:3AC034:B83EAD:F81C0C:6B004E22 |
| html-safe-nonce | 97961cfdaae975d2ba922c603f98edd284009ce35ff291e67699b4b4f58652f9 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQTE0OjNBQzAzNDpCODNFQUQ6RjgxQzBDOjZCMDA0RTIyIiwidmlzaXRvcl9pZCI6IjcxOTM1OTE4ODM0OTc0OTIwMDIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 9f062fe6ebec991893ccf56983506154b000cb52876e5fe7357053e9a40b29ca |
| hovercard-subject-tag | issue:2754604152 |
| 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/18327/issue_layout |
| twitter:image | https://opengraph.githubassets.com/42c238b462d8f9b0518304de3f7503db2717e37b6311b12f1d35af6cf356ebc5/python/mypy/issues/18327 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/42c238b462d8f9b0518304de3f7503db2717e37b6311b12f1d35af6cf356ebc5/python/mypy/issues/18327 |
| og:image:alt | Bug Report Mypy includes functools.cached_property on it's list of property-list types, but considers it to be too identical to property. It allows the use of cached_property.setter and cached_prop... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | tungol |
| hostname | github.com |
| expected-hostname | github.com |
| None | f9517bf360d46638a1e5e7daee7158842fe5ef43c9000afa0e127564a7c2f39b |
| 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 | b27c5dde30676028abd5c5fc53ce5c9b625f8281 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width