Title: For incompatible attribute assignment, show class that defines attribute · Issue #2500 · python/mypy · GitHub
Open Graph Title: For incompatible attribute assignment, show class that defines attribute · Issue #2500 · python/mypy
X Title: For incompatible attribute assignment, show class that defines attribute · Issue #2500 · python/mypy
Description: It would be nice to display the class that defines the attribute when we assign an incompatible value to an attribute: class A: a = 1 class B(A): a = '' # Show that 'a' was defined in 'A' (in addition to the current message) class C(A): ...
Open Graph Description: It would be nice to display the class that defines the attribute when we assign an incompatible value to an attribute: class A: a = 1 class B(A): a = '' # Show that 'a' was defined in 'A' (in addit...
X Description: It would be nice to display the class that defines the attribute when we assign an incompatible value to an attribute: class A: a = 1 class B(A): a = '' # Show that 'a' was defined ...
Opengraph URL: https://github.com/python/mypy/issues/2500
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"For incompatible attribute assignment, show class that defines attribute","articleBody":"It would be nice to display the class that defines the attribute when we assign an incompatible value to an attribute:\r\n\r\n```\r\nclass A:\r\n a = 1\r\n\r\nclass B(A):\r\n a = '' # Show that 'a' was defined in 'A' (in addition to the current message)\r\n\r\nclass C(A): pass\r\n\r\nc = C()\r\nc.a = '' # Again, maybe show that 'a' was defined in 'A'\r\n```\r\n\r\nMaybe also show the file and line on which the attribute was originally defined. However, we probably don't want these verbose messages in the body of a class if the attribute definition is in the same class, as the error is probably clear enough based on immediate context:\r\n\r\n```\r\nclass A:\r\n a = 1\r\n\r\n def f(self) -> None:\r\n self.a = '' # The current message is probably just fine, as the context is clear\r\n```","author":{"url":"https://github.com/JukkaL","@type":"Person","name":"JukkaL"},"datePublished":"2016-11-28T12:09:16Z","url":"https://github.com/python/mypy/issues/2500"}
| 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:480d988f-ef92-fc25-4b79-b455704c678d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A960:3D53C:2D96BB:3F9F8B:6B006B3A |
| html-safe-nonce | 5b8dbdb746938fb90b004f5be51819a6d6fd1c91a13aab300a998883a38d700c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBOTYwOjNENTNDOjJEOTZCQjozRjlGOEI6NkIwMDZCM0EiLCJ2aXNpdG9yX2lkIjoiMjY2NzEyMzQ4MzcxNjExOTM1NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 3e010bb75bca67841a8f6ba94bbe043730e642cdf8cdb9be1958590bc67d85ab |
| hovercard-subject-tag | issue:191990152 |
| 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/2500/issue_layout |
| twitter:image | https://opengraph.githubassets.com/dbfc9f728dd7e3783d89a10ce7eea85122d49e2e6eb563c975a61127761e6f21/python/mypy/issues/2500 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/dbfc9f728dd7e3783d89a10ce7eea85122d49e2e6eb563c975a61127761e6f21/python/mypy/issues/2500 |
| og:image:alt | It would be nice to display the class that defines the attribute when we assign an incompatible value to an attribute: class A: a = 1 class B(A): a = '' # Show that 'a' was defined in 'A' (in addit... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | JukkaL |
| hostname | github.com |
| expected-hostname | github.com |
| None | 6527e91c60c0b29d16606ff32ac5df8ecdc37a2a62205ea057a14d7762c870fa |
| 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 | 46f1cd2ae3cd8ae1a81019b5d619742e76f13bbd |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width