Title: Overloading function issues (incompatible with supertype). · Issue #3750 · python/mypy · GitHub
Open Graph Title: Overloading function issues (incompatible with supertype). · Issue #3750 · python/mypy
X Title: Overloading function issues (incompatible with supertype). · Issue #3750 · python/mypy
Description: mypy 0.530-dev-417e925b16bcd63ba594f5a85c54b2407bd8831d KeyTy = TypeVar("KeyTy") ValTy = TypeVar("ValTy") TempTy = TypeVar("TempTy") class CIDict(Dict[KeyTy, ValTy]): @overload def pop(self, key: KeyTy) -> ValTy: pass @overload def pop(s...
Open Graph Description: mypy 0.530-dev-417e925b16bcd63ba594f5a85c54b2407bd8831d KeyTy = TypeVar("KeyTy") ValTy = TypeVar("ValTy") TempTy = TypeVar("TempTy") class CIDict(Dict[KeyTy, ValTy]): @overload def pop(self, key: K...
X Description: mypy 0.530-dev-417e925b16bcd63ba594f5a85c54b2407bd8831d KeyTy = TypeVar("KeyTy") ValTy = TypeVar("ValTy") TempTy = TypeVar("TempTy") class CIDict(Dict[KeyTy, ValTy]): ...
Opengraph URL: https://github.com/python/mypy/issues/3750
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Overloading function issues (incompatible with supertype).","articleBody":" mypy 0.530-dev-417e925b16bcd63ba594f5a85c54b2407bd8831d\r\n\r\n```python\r\nKeyTy = TypeVar(\"KeyTy\")\r\nValTy = TypeVar(\"ValTy\")\r\nTempTy = TypeVar(\"TempTy\")\r\n\r\nclass CIDict(Dict[KeyTy, ValTy]):\r\n @overload\r\n def pop(self, key: KeyTy) -> ValTy:\r\n pass\r\n\r\n @overload\r\n def pop(self, key: KeyTy, default: Union[ValTy, TempTy]) \\\r\n -> Union[ValTy, TempTy]:\r\n pass\r\n\r\n def pop(self, key: KeyTy, default: Optional[Union[ValTy, TempTy]] = None) \\\r\n -> Union[ValTy, TempTy]:\r\n pass\r\n```\r\n\r\nRunning mypy with:\r\n\r\n mypy test.py --strict-optional --ignore-missing-imports --disallow-untyped-calls --python-version 3.6\r\n\r\nIssues:\r\n\r\n```\r\nCIDict.py:31: error: Signature of \"pop\" incompatible with supertype \"MutableMapping\"\r\nCIDict.py:40: error: Overloaded function implementation does not accept all possible arguments of signature 2\r\n```\r\n\r\nLine number differ because the code above is only a snippet.\r\n\r\nWhat am I missing here?\r\n\r\n","author":{"url":"https://github.com/cynecx","@type":"Person","name":"cynecx"},"datePublished":"2017-07-20T19:41:50Z","url":"https://github.com/python/mypy/issues/3750"}
| 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:143581d9-b8c0-c2ec-c8ac-71d945555557 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8B66:3430F7:A7FAF4:E13183:6B004729 |
| html-safe-nonce | 697970f85534a6a1cf7a1d2c38e9aa8af229bb149b21829121027a7ec51b8517 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QjY2OjM0MzBGNzpBN0ZBRjQ6RTEzMTgzOjZCMDA0NzI5IiwidmlzaXRvcl9pZCI6IjM0NzE4ODMyMTQwNDg0NzkwMTciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 5636a4bd019d55b517af9fb3e5b836a2bad84ac0224dcd6d3aa29d3d5197f796 |
| hovercard-subject-tag | issue:244475184 |
| 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/3750/issue_layout |
| twitter:image | https://opengraph.githubassets.com/7cc7a78cf10cb4f584ee47d8eb7e3bd73a67fc3f1e8349d6a7dca44877c76f12/python/mypy/issues/3750 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/7cc7a78cf10cb4f584ee47d8eb7e3bd73a67fc3f1e8349d6a7dca44877c76f12/python/mypy/issues/3750 |
| og:image:alt | mypy 0.530-dev-417e925b16bcd63ba594f5a85c54b2407bd8831d KeyTy = TypeVar("KeyTy") ValTy = TypeVar("ValTy") TempTy = TypeVar("TempTy") class CIDict(Dict[KeyTy, ValTy]): @overload def pop(self, key: K... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | cynecx |
| 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