Title: untyped defs on derived classes · Issue #3903 · python/mypy · GitHub
Open Graph Title: untyped defs on derived classes · Issue #3903 · python/mypy
X Title: untyped defs on derived classes · Issue #3903 · python/mypy
Description: Currently all arguments and return values on untyped defs are set to Any. It would be nice, if arguments and return values on derived classes would take the type annotations from the parent class. For example: class A: def foo(self, a: s...
Open Graph Description: Currently all arguments and return values on untyped defs are set to Any. It would be nice, if arguments and return values on derived classes would take the type annotations from the parent class. ...
X Description: Currently all arguments and return values on untyped defs are set to Any. It would be nice, if arguments and return values on derived classes would take the type annotations from the parent class. ...
Opengraph URL: https://github.com/python/mypy/issues/3903
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"untyped defs on derived classes","articleBody":"Currently all arguments and return values on untyped defs are set to ```Any```.\r\n\r\nIt would be nice, if arguments and return values on derived classes would take the type annotations from the parent class. For example:\r\n\r\n```\r\nclass A:\r\n def foo(self, a: str) -> None: pass\r\n\r\n\r\nclass B(A):\r\n def foo(self, a):\r\n reveal_type(a)\r\n```\r\nIn this example the revealed type is ```Any``` but I would expect it to be ```str```.\r\n\r\nOf cause, if the entire project has type annotations, than this would not be an issue, but when you add type annotations on a big project and start with the base classes, it would be nice, if you could benefit from that.","author":{"url":"https://github.com/ostcar","@type":"Person","name":"ostcar"},"datePublished":"2017-08-31T18:51:04Z","url":"https://github.com/python/mypy/issues/3903"}
| 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:b99f5713-c1a5-7dc6-bea6-c4f756d1b96a |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9FC8:1C3DC0:520F2D:6E0A7E:6B00301F |
| html-safe-nonce | e2d30120dda535d658c26a1f40dda34072db23f4190778dff37475878826d188 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RkM4OjFDM0RDMDo1MjBGMkQ6NkUwQTdFOjZCMDAzMDFGIiwidmlzaXRvcl9pZCI6IjYxMTIyOTkwMDAxODQ5NzUzOTEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | f19321a8871b6c9b7675825dd3d919b093e837ade20d4f3263374de61b4f831a |
| hovercard-subject-tag | issue:254433060 |
| 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/3903/issue_layout |
| twitter:image | https://opengraph.githubassets.com/06758c9adceea633a41050f64ae231109cd56478bf85731f983a6f931bd67b27/python/mypy/issues/3903 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/06758c9adceea633a41050f64ae231109cd56478bf85731f983a6f931bd67b27/python/mypy/issues/3903 |
| og:image:alt | Currently all arguments and return values on untyped defs are set to Any. It would be nice, if arguments and return values on derived classes would take the type annotations from the parent class. ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ostcar |
| 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