René's URL Explorer Experiment


Title: mypy 1.7.0, ParamSpec: `Cannot infer type argument 1 of "function_name"` when using keyword arguments. · Issue #16485 · python/mypy · GitHub

Open Graph Title: mypy 1.7.0, ParamSpec: `Cannot infer type argument 1 of "function_name"` when using keyword arguments. · Issue #16485 · python/mypy

X Title: mypy 1.7.0, ParamSpec: `Cannot infer type argument 1 of "function_name"` when using keyword arguments. · Issue #16485 · python/mypy

Description: Bug Report The issues with ParamSpec inference for pytypest first appeared in mypy 1.6.0, see #16301. In 1.7.0, it was fixed for some cases but not all. This specific issue happens when a function accepts multiple classes using ParamSpec...

Open Graph Description: Bug Report The issues with ParamSpec inference for pytypest first appeared in mypy 1.6.0, see #16301. In 1.7.0, it was fixed for some cases but not all. This specific issue happens when a function ...

X Description: Bug Report The issues with ParamSpec inference for pytypest first appeared in mypy 1.6.0, see #16301. In 1.7.0, it was fixed for some cases but not all. This specific issue happens when a function ...

Opengraph URL: https://github.com/python/mypy/issues/16485

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"mypy 1.7.0, ParamSpec: `Cannot infer type argument 1 of \"function_name\"` when using keyword arguments.","articleBody":"**Bug Report**\r\n\r\nThe issues with ParamSpec inference for [pytypest](https://github.com/orsinium-labs/pytypest) first appeared in mypy 1.6.0, see #16301. In 1.7.0, it was fixed for some cases but not all.\r\n\r\nThis specific issue happens when a function accepts multiple classes using ParamSpec and some of them pass an argument as keyword one and some pass the same argument as a positional one.\r\n\r\n**To Reproduce**\r\n\r\n```python\r\nfrom typing import Callable, Generic\r\nfrom typing_extensions import ParamSpec\r\n\r\nP = ParamSpec('P')\r\n\r\nclass Case(Generic[P]):\r\n    def __init__(self, *args: P.args, **kwargs: P.kwargs) -> None:\r\n        pass\r\n\r\ndef _test(a: int, b: int = 0) -> None:\r\n    assert a\r\n\r\ndef parametrize(\r\n    func: Callable[P, None],\r\n    *cases: Case[P],\r\n    **named_cases: Case[P],\r\n) -> Callable[[], None]:\r\n    raise NotImplementedError\r\n\r\n# this one works:\r\nparametrize(_test, Case(1, 2), Case(3, 4))\r\n\r\n# this one also works:\r\nparametrize(_test, Case(1, b=2), Case(3, b=4))\r\n\r\n# and this is also fine:\r\nparametrize(_test, Case(1, 2), Case(3))\r\n\r\n# but this one fails inference:\r\nparametrize(_test, Case(1, 2), Case(3, b=4))\r\n```\r\n\r\n**Expected Behavior**\r\n\r\nIt shouldn't matter how an argument is passed into ParamSpec. If it can be passed into the target function described by the ParamSpec, it should pass type checking.\r\n\r\n**Actual Behavior**\r\n\r\nFor the last line of the code:\r\n\r\n```\r\nCannot infer type argument 1 of \"parametrize\"  [misc]\r\n```\r\n\r\nThe same happens if instead of `*cases: Case[P]` the function accepts `case1: Case[P], case2: Case[P]`.\r\n\r\n**Your Environment**\r\n\r\n- Mypy version used: 1.7.0\r\n- Mypy command-line flags: none\r\n- Mypy configuration options from `mypy.ini` (and other config files): none\r\n- Python version used: 3.10\r\n","author":{"url":"https://github.com/orsinium","@type":"Person","name":"orsinium"},"datePublished":"2023-11-14T07:37:01Z","url":"https://github.com/python/mypy/issues/16485"}

react-profiling0
react-import-mapreact,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-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:92adec92-10a4-daaa-12e8-ca85b1dccc31
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idA9A8:2148FB:11317A1:1714506:6AFFC7D2
html-safe-nonce0f08fba868d55e58f694ae1d29ab4e918a09ba9bae9b8d36e07a574c7b4c5ef1
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBOUE4OjIxNDhGQjoxMTMxN0ExOjE3MTQ1MDY6NkFGRkM3RDIiLCJ2aXNpdG9yX2lkIjoiNTU5NzI1MTUzNDI3NTQ2MzEyMiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacc2c85e12c9ce5c3d2b1aa5e673a1722573c0788052b2a592c378e9719f1f6de1
hovercard-subject-tagissue:1992157551
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/mypy/16485/issue_layout
twitter:imagehttps://opengraph.githubassets.com/60ce09439995658f2fbadebf8c23016101ea7ff41af77b6ff0bdd715833de7c3/python/mypy/issues/16485
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/60ce09439995658f2fbadebf8c23016101ea7ff41af77b6ff0bdd715833de7c3/python/mypy/issues/16485
og:image:altBug Report The issues with ParamSpec inference for pytypest first appeared in mypy 1.6.0, see #16301. In 1.7.0, it was fixed for some cases but not all. This specific issue happens when a function ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameorsinium
hostnamegithub.com
expected-hostnamegithub.com
None1e805b832df235bb21305db712c3b6432920019dfc12cb25b9cb8d3b0c9403cf
turbo-cache-controlno-preview
go-importgithub.com/python/mypy git https://github.com/python/mypy.git
octolytics-dimension-user_id1525981
octolytics-dimension-user_loginpython
octolytics-dimension-repository_id7053637
octolytics-dimension-repository_nwopython/mypy
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id7053637
octolytics-dimension-repository_network_root_nwopython/mypy
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release8fa4a54e6871c7908eda1c246ad5972982c0b59d
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/python/mypy/issues/16485#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fmypy%2Fissues%2F16485
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fmypy%2Fissues%2F16485
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=python%2Fmypy
Reloadhttps://github.com/python/mypy/issues/16485
Reloadhttps://github.com/python/mypy/issues/16485
Reloadhttps://github.com/python/mypy/issues/16485
pythonhttps://github.com/python
mypyhttps://github.com/python/mypy
Codehttps://github.com/python/mypy
Issues2.7k (2.7k)https://github.com/python/mypy/issues
Pull requests547 (547)https://github.com/python/mypy/pulls
Actionshttps://github.com/python/mypy/actions
Projectshttps://github.com/python/mypy/projects
Wikihttps://github.com/python/mypy/wiki
Security and qualityhttps://github.com/python/mypy/security
Insightshttps://github.com/python/mypy/insights
https://github.com/python/mypy
New issuehttps://github.com/login?return_to=https://github.com/python/mypy/issues/16485
New issuehttps://github.com/login?return_to=https://github.com/python/mypy/issues/16485
#16502https://github.com/python/mypy/pull/16502
mypy 1.7.0, ParamSpec: Cannot infer type argument 1 of "function_name" when using keyword arguments.https://github.com/python/mypy/issues/16485#top
#16502https://github.com/python/mypy/pull/16502
bugmypy got something wronghttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22bug%22
topic-paramspecPEP 612, ParamSpec, Concatenatehttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22topic-paramspec%22
https://github.com/orsinium
orsiniumhttps://github.com/orsinium
on Nov 14, 2023https://github.com/python/mypy/issues/16485#issue-1992157551
pytypesthttps://github.com/orsinium-labs/pytypest
#16301https://github.com/python/mypy/issues/16301
orsiniumhttps://github.com/orsinium
bugmypy got something wronghttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22bug%22
on Nov 14, 2023https://github.com/python/mypy/issues/16485#event-10950729077
orsiniumhttps://github.com/orsinium
on Nov 14, 2023https://github.com/python/mypy/issues/16485#event-10950741915
AlexWaygoodhttps://github.com/AlexWaygood
topic-paramspecPEP 612, ParamSpec, Concatenatehttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22topic-paramspec%22
on Nov 14, 2023https://github.com/python/mypy/issues/16485#event-10950744471
JukkaLhttps://github.com/JukkaL
completedhttps://github.com/python/mypy/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#16502https://github.com/python/mypy/pull/16502
on Nov 22, 2023https://github.com/python/mypy/issues/16485#event-11035060457
JukkaLhttps://github.com/JukkaL
on Nov 22, 2023https://github.com/python/mypy/issues/16485#event-11035061277
Make imprecise constraints handling more robust (#16502)https://github.com/python/mypy/commit/3e6b5528e662d0accb6def21d6963361fe894301
#16502https://github.com/python/mypy/pull/16502
3e6b552https://github.com/python/mypy/commit/3e6b5528e662d0accb6def21d6963361fe894301
https://github.com/93578237
93578237https://github.com/93578237
on Nov 24, 2023https://github.com/python/mypy/issues/16485#issuecomment-1825705044
@ilevkivskyihttps://github.com/ilevkivskyi
@orsiniumhttps://github.com/orsinium
https://github.com/orsinium
orsiniumhttps://github.com/orsinium
on Nov 25, 2023https://github.com/python/mypy/issues/16485#issuecomment-1826236290
@ilevkivskyihttps://github.com/ilevkivskyi
https://private-user-images.githubusercontent.com/9638362/285570679-2e7ef1a2-c9c4-4013-8217-b8cdca801484.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3OTUxNDgwMzEsIm5iZiI6MTc5NTE0NzczMSwicGF0aCI6Ii85NjM4MzYyLzI4NTU3MDY3OS0yZTdlZjFhMi1jOWM0LTQwMTMtODIxNy1iOGNkY2E4MDE0ODQucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI2MTEyMCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNjExMjBUMDQwODUxWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9N2VlYzBlYWM3MTgwMGI5ZjNkMmNlZGQ3ZGMxYzI1N2YzMTQ4MWZmYWZlYjQ4ZjJlMTkwN2M3ODY0OTc1ZTVmNCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmcmVzcG9uc2UtY29udGVudC10eXBlPWltYWdlJTJGcG5nIn0.iITF6aWh1tkfdkffeBtdGRyBp4xfRDVAwUnGPw88MBA
https://github.com/93578237
93578237https://github.com/93578237
on Nov 27, 2023https://github.com/python/mypy/issues/16485#issuecomment-1828524031
@orsiniumhttps://github.com/orsinium
https://github.com/ilevkivskyi
ilevkivskyihttps://github.com/ilevkivskyi
on Nov 27, 2023https://github.com/python/mypy/issues/16485#issuecomment-1828582431
https://github.com/93578237
93578237https://github.com/93578237
on Nov 27, 2023https://github.com/python/mypy/issues/16485#issuecomment-1828603664
https://github.com/AlexWaygood
AlexWaygoodhttps://github.com/AlexWaygood
on Nov 27, 2023https://github.com/python/mypy/issues/16485#issuecomment-1828616588
@q0whttps://github.com/q0w
@orsiniumhttps://github.com/orsinium
3e6b552https://github.com/python/mypy/commit/3e6b5528e662d0accb6def21d6963361fe894301
https://github.com/93578237
93578237https://github.com/93578237
on Nov 27, 2023https://github.com/python/mypy/issues/16485#issuecomment-1828619539
Sign up for freehttps://github.com/signup?return_to=https://github.com/python/mypy/issues/16485
Sign in to commenthttps://github.com/login?return_to=https://github.com/python/mypy/issues/16485
bugmypy got something wronghttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22bug%22
topic-paramspecPEP 612, ParamSpec, Concatenatehttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22topic-paramspec%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.