Title: Function argument rejected as a base class · Issue #5865 · python/mypy · GitHub
Open Graph Title: Function argument rejected as a base class · Issue #5865 · python/mypy
X Title: Function argument rejected as a base class · Issue #5865 · python/mypy
Description: Class D in the example below is rejected, even though class E, which looks very similar, is accepted: from typing import Any a: Any class C(a): pass # Ok def f(b: Any) -> None: class D(b): pass # Errors: Invalid type "b"; Invalid base cl...
Open Graph Description: Class D in the example below is rejected, even though class E, which looks very similar, is accepted: from typing import Any a: Any class C(a): pass # Ok def f(b: Any) -> None: class D(b): pass # E...
X Description: Class D in the example below is rejected, even though class E, which looks very similar, is accepted: from typing import Any a: Any class C(a): pass # Ok def f(b: Any) -> None: class D(b): pass ...
Opengraph URL: https://github.com/python/mypy/issues/5865
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Function argument rejected as a base class","articleBody":"Class `D` in the example below is rejected, even though class `E`, which looks very similar, is accepted:\r\n\r\n```py\r\nfrom typing import Any\r\n\r\na: Any\r\nclass C(a): pass # Ok\r\n\r\ndef f(b: Any) -> None:\r\n class D(b): pass # Errors: Invalid type \"b\"; Invalid base class\r\n\r\ndef g(c: Any) -> None:\r\n d: Any = c\r\n class E(d): pass # Ok\r\n```\r\n\r\nThe above example shouldn't generate errors.\r\n\r\n(Originally reported by @germaniumhq in https://github.com/python/mypy/issues/2477#issuecomment-435295235.)","author":{"url":"https://github.com/JukkaL","@type":"Person","name":"JukkaL"},"datePublished":"2018-11-02T10:31:32Z","url":"https://github.com/python/mypy/issues/5865"}
| 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:f56af977-3f5a-0cc6-213b-a8d4f81330d2 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9E28:07D0:22AD33:2C7DA4:6AFFC2C7 |
| html-safe-nonce | 8a26a162ce397f67a865e22f1ad8b320d7fd31e5e498c76460b91a8cc3f11fc9 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RTI4OjA3RDA6MjJBRDMzOjJDN0RBNDo2QUZGQzJDNyIsInZpc2l0b3JfaWQiOiI1MzcxMDIxNjczOTIxMjMzNjA3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 99ed67ebeac5e273ba7c31740c185b778b7a393a7c7b5ce675db51469ddb26b8 |
| hovercard-subject-tag | issue:376754444 |
| 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/5865/issue_layout |
| twitter:image | https://opengraph.githubassets.com/5ed42ec93650f2621a43fb8e44a9699ca73b927d08269d5ee52f0589be727bf0/python/mypy/issues/5865 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/5ed42ec93650f2621a43fb8e44a9699ca73b927d08269d5ee52f0589be727bf0/python/mypy/issues/5865 |
| og:image:alt | Class D in the example below is rejected, even though class E, which looks very similar, is accepted: from typing import Any a: Any class C(a): pass # Ok def f(b: Any) -> None: class D(b): pass # E... |
| 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 | 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