Title: functools.partial support · Issue #1484 · python/mypy · GitHub
Open Graph Title: functools.partial support · Issue #1484 · python/mypy
X Title: functools.partial support · Issue #1484 · python/mypy
Description: I haven't been able to find another issue for this, weird that this hasn't been reported already. from typing import * from functools import partial def inc(a:int) -> int: return a+1 def foo(f: Callable[[], int]) -> int: return f() foo(p...
Open Graph Description: I haven't been able to find another issue for this, weird that this hasn't been reported already. from typing import * from functools import partial def inc(a:int) -> int: return a+1 def foo(f: Cal...
X Description: I haven't been able to find another issue for this, weird that this hasn't been reported already. from typing import * from functools import partial def inc(a:int) -> int: return a+1 def...
Opengraph URL: https://github.com/python/mypy/issues/1484
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"functools.partial support","articleBody":"I haven't been able to find another issue for this, weird that this hasn't been reported already.\n\n```\nfrom typing import *\nfrom functools import partial\n\ndef inc(a:int) -> int:\n return a+1\n\ndef foo(f: Callable[[], int]) -> int:\n return f()\n\nfoo(partial(inc, 1))\n```\n\nThis will fail with \n\n```\nerror: Argument 1 to \"foo\" has incompatible type partial[int]; expected Callable[[], int]\n```\n\na similar code by using a dyadic `add` instead of `inc` will yield:\n\n```\nerror: Argument 1 to \"foo\" has incompatible type partial[int]; expected Callable[[int], int]\n```\n\n(so, partial apparently doesn't currently retain any type information on the non-applied inputs... I guess this'll make the fix non trivial)\n","author":{"url":"https://github.com/berdario","@type":"Person","name":"berdario"},"datePublished":"2016-05-05T14:13:48Z","url":"https://github.com/python/mypy/issues/1484"}
| 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:bbb0f013-d4a4-8b30-ce89-3c5f3aabac51 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | ED1E:381DB6:1482950:1ADC54D:6B000C74 |
| html-safe-nonce | da1a8830d6fede1006b9c6754f0bbbf295df554b25c81daeca4735c5f6b3a8d0 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFRDFFOjM4MURCNjoxNDgyOTUwOjFBREM1NEQ6NkIwMDBDNzQiLCJ2aXNpdG9yX2lkIjoiNzg5OTc4MTI1MTA5ODIxNzU4OCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 1fb69a2cc980031be78be34adffebf59706a9d118365c607b922374784137c32 |
| hovercard-subject-tag | issue:153240888 |
| 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/1484/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a7464dc9ba617a356749ec5edd19903f6a01b37a6843dc4a267b8957d833d3aa/python/mypy/issues/1484 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a7464dc9ba617a356749ec5edd19903f6a01b37a6843dc4a267b8957d833d3aa/python/mypy/issues/1484 |
| og:image:alt | I haven't been able to find another issue for this, weird that this hasn't been reported already. from typing import * from functools import partial def inc(a:int) -> int: return a+1 def foo(f: Cal... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | berdario |
| 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