Title: MyPy does not consider classes instances of their metaclass · Issue #1267 · python/mypy · GitHub
Open Graph Title: MyPy does not consider classes instances of their metaclass · Issue #1267 · python/mypy
X Title: MyPy does not consider classes instances of their metaclass · Issue #1267 · python/mypy
Description: Playing around with a toy situation as below: class AsdfMeta(type): pass class AsdfConcrete1(object): __metaclass__ = AsdfMeta def accepts_an_asdf_class(klass): # type: (AsdfMeta) -> None pass accepts_an_asdf_class(AsdfConcrete1) accepts...
Open Graph Description: Playing around with a toy situation as below: class AsdfMeta(type): pass class AsdfConcrete1(object): __metaclass__ = AsdfMeta def accepts_an_asdf_class(klass): # type: (AsdfMeta) -> None pass acce...
X Description: Playing around with a toy situation as below: class AsdfMeta(type): pass class AsdfConcrete1(object): __metaclass__ = AsdfMeta def accepts_an_asdf_class(klass): # type: (AsdfMeta) -> None pass a...
Opengraph URL: https://github.com/python/mypy/issues/1267
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"MyPy does not consider classes instances of their metaclass","articleBody":"Playing around with a toy situation as below:\n\n```\nclass AsdfMeta(type): pass\nclass AsdfConcrete1(object):\n __metaclass__ = AsdfMeta\n\ndef accepts_an_asdf_class(klass): # type: (AsdfMeta) -> None\n pass\n\naccepts_an_asdf_class(AsdfConcrete1)\naccepts_an_asdf_class(AsdfConcrete1())\naccepts_an_asdf_class(\"hello, i am a string and not a class with metaclass AsdfMeta\")\n```\n\nI get back \n\n```\n56: error: Argument 1 to \"accepts_an_asdf_class\" has incompatible type \"AsdfConcrete1\"; expected \"AsdfMeta\"\n57: error: Argument 1 to \"accepts_an_asdf_class\" has incompatible type \"AsdfConcrete1\"; expected \"AsdfMeta\"\n58: error: Argument 1 to \"accepts_an_asdf_class\" has incompatible type \"unicode\"; expected \"AsdfMeta\"\n```\n\n(This is super low-priority in my opinion.)\n","author":{"url":"https://github.com/wittekm","@type":"Person","name":"wittekm"},"datePublished":"2016-03-03T00:35:10Z","url":"https://github.com/python/mypy/issues/1267"}
| 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:1745c4b0-593d-36eb-f6bb-3d713e1eecff |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8FEC:2714DE:25878D2:32DCDAB:6B00300F |
| html-safe-nonce | cabf723a75e1fa82c9be92d2169aa1ea175ade313d9adfea7281bf09beb81e86 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RkVDOjI3MTRERToyNTg3OEQyOjMyRENEQUI6NkIwMDMwMEYiLCJ2aXNpdG9yX2lkIjoiNjQ2MDk4ODgxMzg5NTM5MzQzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | c6edd5b20967263c88dc1298843ae773c622546355a9091cb0feb7c87ffa2291 |
| hovercard-subject-tag | issue:138036371 |
| 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/1267/issue_layout |
| twitter:image | https://opengraph.githubassets.com/69f1264ce13c31df3c77bdac604e719f34b6539ba740d907662679b1e8c15191/python/mypy/issues/1267 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/69f1264ce13c31df3c77bdac604e719f34b6539ba740d907662679b1e8c15191/python/mypy/issues/1267 |
| og:image:alt | Playing around with a toy situation as below: class AsdfMeta(type): pass class AsdfConcrete1(object): __metaclass__ = AsdfMeta def accepts_an_asdf_class(klass): # type: (AsdfMeta) -> None pass acce... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | wittekm |
| 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