Title: "object" not callable (another thorny `partial` issue) · Issue #2779 · python/mypy · GitHub
Open Graph Title: "object" not callable (another thorny `partial` issue) · Issue #2779 · python/mypy
X Title: "object" not callable (another thorny `partial` issue) · Issue #2779 · python/mypy
Description: I suspect that this will be closed in favor of #1484, but it seemed that creating a separate issue would be more convenient for tidiness. I have some code which is yielding a mypy error: error: "object" not callable The code looks simila...
Open Graph Description: I suspect that this will be closed in favor of #1484, but it seemed that creating a separate issue would be more convenient for tidiness. I have some code which is yielding a mypy error: error: "ob...
X Description: I suspect that this will be closed in favor of #1484, but it seemed that creating a separate issue would be more convenient for tidiness. I have some code which is yielding a mypy error: error: &qu...
Opengraph URL: https://github.com/python/mypy/issues/2779
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"\"object\" not callable (another thorny `partial` issue)","articleBody":"I suspect that this will be closed in favor of #1484, but it seemed that creating a separate issue would be more convenient for tidiness.\r\n\r\nI have some code which is yielding a mypy error:\r\n\r\n```\r\nerror: \"object\" not callable\r\n```\r\n\r\nThe code looks similar to this (with the line of the error denoted by `\u003c---`):\r\n\r\n```python\r\nfrom functools import partial\r\nfrom another_module import another_mutator\r\n\r\nTAnyDict = Dict[str, Any]\r\n\r\ndef mutator1(bar: TAnyDict, baz: TAnyDict) -> TAnyDict:\r\n # ...\r\n return bar\r\n\r\ndef mutator2(bar: TAnyDict, baz: TAnyDict) -> TAnyDict:\r\n # ...\r\n return bar\r\n\r\n# ... etc, more mutator functions\r\n\r\nsome_local_var = 'foo'\r\nsome_functions = [ # type: List[Callable[[TAnyDict, TAnyDict], TAnyDict]] \r\n mutator1,\r\n mutator2,\r\n partial(another_mutator, some_local_var),\r\n mutator3,\r\n mutator4\r\n]\r\n\r\nfor d in some_other_dicts:\r\n res = {}\r\n for func in some_functions:\r\n res = func(res, some_dict) # \u003c--- this is the line that causes the error\r\n do_something_with(res)\r\n```\r\n\r\nIt was only after fully writing out an Issue for this that I realized that the core issue was related to lack of `partial` support, rather than an issue with my `Callable` declaration, or a different bug in `mypy`.\r\n\r\nObviously this will become a moot point when `partial` is properly supported, but in the meantime, I would have expected the `mypy` error to occur on the `partial(...)` line within the list, rather than within the `for` loop.","author":{"url":"https://github.com/rknLA","@type":"Person","name":"rknLA"},"datePublished":"2017-01-31T10:13:45Z","url":"https://github.com/python/mypy/issues/2779"}
| 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:efbc42d2-b02b-2c4e-f1e7-29511b47da78 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B0E0:16605A:12B5868:18910CF:6B00061C |
| html-safe-nonce | 2b2acba4ce3725b13cf27937904f07043a455908d9222596eb9a81b9558f1583 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMEUwOjE2NjA1QToxMkI1ODY4OjE4OTEwQ0Y6NkIwMDA2MUMiLCJ2aXNpdG9yX2lkIjoiMzI1MzM4NDQxNTA4NjExODQyOCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 8ac6f9f7b6119d8c4264eb2c572b643a176a80996f26fd122284f898781a331b |
| hovercard-subject-tag | issue:204252451 |
| 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/2779/issue_layout |
| twitter:image | https://opengraph.githubassets.com/7ea27a10745ca01ec370cea28433d9cb59fed1cb2e8d01437f31f4088fb49f76/python/mypy/issues/2779 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/7ea27a10745ca01ec370cea28433d9cb59fed1cb2e8d01437f31f4088fb49f76/python/mypy/issues/2779 |
| og:image:alt | I suspect that this will be closed in favor of #1484, but it seemed that creating a separate issue would be more convenient for tidiness. I have some code which is yielding a mypy error: error: "ob... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | rknLA |
| hostname | github.com |
| expected-hostname | github.com |
| None | 0a0d8686a27478df474dd7415776a7a080cde8838b3cd92ea7601187572e5729 |
| 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 | 16a11879678aaf97e2a42c33ee70830aa084fa37 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width