Title: Stubtest whines about Concatenate given as Callable argument · Issue #12825 · python/mypy · GitHub
Open Graph Title: Stubtest whines about Concatenate given as Callable argument · Issue #12825 · python/mypy
X Title: Stubtest whines about Concatenate given as Callable argument · Issue #12825 · python/mypy
Description: With the concatenate example from the typing doc, which works with mypy 0.950, if I split it to a file and a stub, stubtest starts to compain about Concatenate being used as a Callable argument: totest.py: from threading import Lock # Us...
Open Graph Description: With the concatenate example from the typing doc, which works with mypy 0.950, if I split it to a file and a stub, stubtest starts to compain about Concatenate being used as a Callable argument: to...
X Description: With the concatenate example from the typing doc, which works with mypy 0.950, if I split it to a file and a stub, stubtest starts to compain about Concatenate being used as a Callable argument: to...
Opengraph URL: https://github.com/python/mypy/issues/12825
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Stubtest whines about Concatenate given as Callable argument","articleBody":"With the concatenate example from the [typing doc](https://docs.python.org/3/library/typing.html#typing.Concatenate), which works with mypy 0.950, if I split it to a file and a stub, stubtest starts to compain about Concatenate being used as a Callable argument:\r\n\r\n`totest.py`:\r\n```python\r\nfrom threading import Lock\r\n\r\n# Use this lock to ensure that only one thread is executing a function\r\n# at any time.\r\nmy_lock = Lock()\r\n\r\ndef with_lock(f):\r\n '''A decorator which provides a lock.'''\r\n def inner(*args, **kwargs):\r\n # Provide the lock as the first argument.\r\n return f(my_lock, *args, **kwargs)\r\n return inner\r\n\r\n@with_lock\r\ndef sum_threadsafe(lock, numbers):\r\n '''Add a list of numbers together in a thread-safe manner.'''\r\n with lock:\r\n return sum(numbers)\r\n\r\n# We don't need to pass in the lock ourselves thanks to the decorator.\r\nsum_threadsafe([1.1, 2.2, 3.3])\r\n```\r\n\r\n`totest.pyi`:\r\n```python\r\nfrom threading import Lock\r\nfrom typing import Concatenate, ParamSpec, TypeVar, Callable\r\n\r\nP = ParamSpec('P')\r\nR = TypeVar('R')\r\n\r\n\r\ndef with_lock(f: Callable[Concatenate[Lock, P], R]) -> Callable[P, R]: ...\r\n```\r\n\r\nstubtest run:\r\n\r\n```bash\r\n$ stubtest totest\r\nerror: not checking stubs due to mypy build errors:\r\ntotest.pyi:8: error: The first argument to Callable must be a list of types or \"...\"\r\n```\r\n","author":{"url":"https://github.com/JulienPalard","@type":"Person","name":"JulienPalard"},"datePublished":"2022-05-20T09:10:17Z","url":"https://github.com/python/mypy/issues/12825"}
| 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:81d69736-adec-bb35-df6e-66e2ec689a3f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B258:30CC09:24ECBA4:31F8A82:6B002CD3 |
| html-safe-nonce | b690eafb5a788fc474f0a63cfefd9db9bbaad46ded68d5916a7409c3b931a69b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMjU4OjMwQ0MwOToyNEVDQkE0OjMxRjhBODI6NkIwMDJDRDMiLCJ2aXNpdG9yX2lkIjoiMzk4ODY0OTMwMjUzMTUxNzY1MSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | e375b938b022096edbc54c37a2d10f864ee0489b984fc2455bfbb3f05c5884b8 |
| hovercard-subject-tag | issue:1242856927 |
| 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/12825/issue_layout |
| twitter:image | https://opengraph.githubassets.com/90014880bd5444cc7de70f96dd50cd93900402fefd0987fcf4a25affd566cc98/python/mypy/issues/12825 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/90014880bd5444cc7de70f96dd50cd93900402fefd0987fcf4a25affd566cc98/python/mypy/issues/12825 |
| og:image:alt | With the concatenate example from the typing doc, which works with mypy 0.950, if I split it to a file and a stub, stubtest starts to compain about Concatenate being used as a Callable argument: to... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | JulienPalard |
| 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