Title: abstract dataclass inheritance gives `Only concrete class can be given where "Type[Abstract]" is expected` · Issue #5374 · python/mypy · GitHub
Open Graph Title: abstract dataclass inheritance gives `Only concrete class can be given where "Type[Abstract]" is expected` · Issue #5374 · python/mypy
X Title: abstract dataclass inheritance gives `Only concrete class can be given where "Type[Abstract]" is expected` · Issue #5374 · python/mypy
Description: mypy 0.620, --strict. Sample code: import abc from dataclasses import dataclass @dataclass # error: Only concrete class can be given where "Type[Abstract]" is expected class Abstract(metaclass=abc.ABCMeta): a: str @abc.abstractmethod def...
Open Graph Description: mypy 0.620, --strict. Sample code: import abc from dataclasses import dataclass @dataclass # error: Only concrete class can be given where "Type[Abstract]" is expected class Abstract(metaclass=abc....
X Description: mypy 0.620, --strict. Sample code: import abc from dataclasses import dataclass @dataclass # error: Only concrete class can be given where "Type[Abstract]" is expected class Abstract(meta...
Opengraph URL: https://github.com/python/mypy/issues/5374
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"abstract dataclass inheritance gives `Only concrete class can be given where \"Type[Abstract]\" is expected`","articleBody":"mypy 0.620, `--strict`.\r\n\r\nSample code:\r\n\r\n```python3\r\nimport abc\r\nfrom dataclasses import dataclass\r\n\r\n\r\n@dataclass # error: Only concrete class can be given where \"Type[Abstract]\" is expected\r\nclass Abstract(metaclass=abc.ABCMeta):\r\n a: str\r\n\r\n @abc.abstractmethod\r\n def c(self) -> None:\r\n pass\r\n\r\n\r\n@dataclass\r\nclass Concrete(Abstract):\r\n b: str\r\n\r\n def c(self) -> None:\r\n pass\r\n\r\n\r\ninstance = Concrete(a='hello', b='world')\r\n```\r\n\r\nNote that this error *only* occurs if at least one abstract method is defined on the abstract class. Removing the abstract method `c` (or making it non-abstract) makes the error go away.","author":{"url":"https://github.com/ojii","@type":"Person","name":"ojii"},"datePublished":"2018-07-19T04:01:01Z","url":"https://github.com/python/mypy/issues/5374"}
| 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:a8f5f867-1d1c-d7a8-cfab-58dd2a5e8ac5 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 935C:1F3799:1B91943:23735B1:6AFFC30C |
| html-safe-nonce | 8788ef6c9bc8363e27d316ee80781f85ae9b18a9ae3d4de04231beda4dbb8e88 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MzVDOjFGMzc5OToxQjkxOTQzOjIzNzM1QjE6NkFGRkMzMEMiLCJ2aXNpdG9yX2lkIjoiNzI3NjI4MjI3MDM3MjA1Mzc3MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 44222c1f038d19cd439acaf18046b43b9632c5322c8e3d08da94c282fc087339 |
| hovercard-subject-tag | issue:342571030 |
| 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/5374/issue_layout |
| twitter:image | https://opengraph.githubassets.com/7befb779e572ea61bfbf8d064ae28267ee1ae14c13407b916491a3a2d0d39647/python/mypy/issues/5374 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/7befb779e572ea61bfbf8d064ae28267ee1ae14c13407b916491a3a2d0d39647/python/mypy/issues/5374 |
| og:image:alt | mypy 0.620, --strict. Sample code: import abc from dataclasses import dataclass @dataclass # error: Only concrete class can be given where "Type[Abstract]" is expected class Abstract(metaclass=abc.... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ojii |
| hostname | github.com |
| expected-hostname | github.com |
| None | 1e805b832df235bb21305db712c3b6432920019dfc12cb25b9cb8d3b0c9403cf |
| 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 | 8fa4a54e6871c7908eda1c246ad5972982c0b59d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width