René's URL Explorer Experiment


Title: Crash when using ParamSpec · Issue #17825 · python/mypy · GitHub

Open Graph Title: Crash when using ParamSpec · Issue #17825 · python/mypy

X Title: Crash when using ParamSpec · Issue #17825 · python/mypy

Description: Crash Report I'm developing an cache decorator that uses ParamSpec to be as generic as possible. There's a slight bug in my code (I used Sequence where I should have used Paramspec.args), but I feel that shouldn't have led to a crash. Th...

Open Graph Description: Crash Report I'm developing an cache decorator that uses ParamSpec to be as generic as possible. There's a slight bug in my code (I used Sequence where I should have used Paramspec.args), but I fee...

X Description: Crash Report I'm developing an cache decorator that uses ParamSpec to be as generic as possible. There's a slight bug in my code (I used Sequence where I should have used Paramspec.args), b...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Crash when using ParamSpec","articleBody":"**Crash Report**\r\n\r\nI'm developing an cache decorator that uses ParamSpec to be as generic as possible.\r\nThere's a slight bug in my code (I used `Sequence` where I should have used `Paramspec.args`), but I feel that shouldn't have led to a crash. There might actually be legitimate usecases for the incorrect code I wrote.\r\n\r\n**Traceback**\r\n\r\n```\r\nmypy_bug_test.py:22: error: INTERNAL ERROR -- Please try using mypy master on GitHub:\r\nhttps://mypy.readthedocs.io/en/stable/common_issues.html#using-a-development-mypy-build\r\nPlease report a bug at https://github.com/python/mypy/issues\r\nversion: 1.11.2\r\nTraceback (most recent call last):\r\n  File \"mypy/checkexpr.py\", line 5822, in accept\r\n  File \"mypy/checkexpr.py\", line 480, in visit_call_expr\r\n  File \"mypy/checkexpr.py\", line 614, in visit_call_expr_inner\r\n  File \"mypy/checkexpr.py\", line 1467, in check_call_expr_with_callee_type\r\n  File \"mypy/checkexpr.py\", line 1597, in check_call\r\n  File \"mypy/checkexpr.py\", line 1561, in check_call\r\n  File \"mypy/checkexpr.py\", line 1746, in check_callable_call\r\n  File \"mypy/checkexpr.py\", line 2062, in infer_function_type_arguments\r\n  File \"mypy/checkexpr.py\", line 2268, in get_arg_infer_passes\r\n  File \"mypy/subtypes.py\", line 1248, in find_member\r\n  File \"mypy/subtypes.py\", line 1383, in find_node_type\r\n  File \"mypy/expandtype.py\", line 114, in expand_type_by_instance\r\n  File \"mypy/expandtype.py\", line 69, in expand_type\r\n  File \"mypy/types.py\", line 2004, in accept\r\n  File \"mypy/expandtype.py\", line 408, in visit_callable_type\r\n  File \"mypy/expandtype.py\", line 500, in expand_types\r\n  File \"mypy/types.py\", line 769, in accept\r\n  File \"mypy/expandtype.py\", line 264, in visit_param_spec\r\nAssertionError: \r\nmypy_bug_test.py:22: : note: use --pdb to drop into pdb\r\n```\r\n\r\n**To Reproduce**\r\n\r\nThis is how far I've managed to whitle my testcase down:\r\n\r\n```python\r\nfrom collections.abc import Callable, Sequence\r\nimport functools\r\nfrom typing import Generic, ParamSpec, TypeVar\r\n\r\nP = ParamSpec(\"P\")\r\nR = TypeVar(\"R\")\r\n\r\nclass DecoratorImplementation(Generic[P, R]):\r\n    def __init__(self,\r\n        fn: Callable[P, Sequence[R]], param):\r\n        self.fn = fn\r\n        self.param = param\r\n\r\n    def __call__(self,  *args: Sequence, **kwargs: P.kwargs):\r\n        def wrapper(*args, **kwargs):\r\n            return self.fn(*args, **kwargs)\r\n        return wrapper\r\n\r\ndef decorator(func, param):\r\n\r\n    def decorator_inner(fn):\r\n        return functools.wraps(fn)(DecoratorImplementation(fn, param))\r\n\r\n    return decorator_inner\r\n```\r\n\r\n**Your Environment**\r\n\r\nOperating system: Debian Bookworm, python 3.11, virtualenv\r\n\r\nmypy versions tested: \r\n* **mypy 1.11.2 (compiled: yes)** (affected) :red_circle: \r\n* **mypy 1.10.0 (compiled: yes)** (affected) :red_circle: \r\n* **mypy 1.9.0 (compiled: yest)** (NOT affected) :green_circle: \r\n\r\npyproject.toml:\r\n```toml\r\n[tool.mypy]\r\npython_version = \"3.11\"\r\nignore_missing_imports = true\r\nshow_error_codes = true\r\ncheck_untyped_defs = true\r\nexclude = \"tests/.*\\\\.py\"\r\n\r\n[[tool.mypy.overrides]]\r\nmodule = \"internal.config_py.*\"\r\n# lots of dict-heavy code which isn't typed at all.\r\nignore_errors = true\r\n```","author":{"url":"https://github.com/kvdveer","@type":"Person","name":"kvdveer"},"datePublished":"2024-09-25T10:13:42Z","url":"https://github.com/python/mypy/issues/17825"}

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:edce6033-8692-596c-acb5-018f6e790b40
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id9D96:3AAC7B:E503A0:12B0D6C:6AFFFB9A
html-safe-nonce64da9ee30a1e961b70fe133b8ccae0dcc9648a1a8201cb93c0a06136626197d5
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RDk2OjNBQUM3QjpFNTAzQTA6MTJCMEQ2Qzo2QUZGRkI5QSIsInZpc2l0b3JfaWQiOiI5ODMxMjk3MTQzMTcwNTQ5OCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac38a8bc26881057a2097f047f5024b7a8b1ee563ad143349e8769595886e326a6
hovercard-subject-tagissue:2547566306
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/17825/issue_layout
twitter:imagehttps://opengraph.githubassets.com/7c36e75efd85480753e19ef11f10e4e8a1504c67e3bde0bacf735a2ac9b78892/python/mypy/issues/17825
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/7c36e75efd85480753e19ef11f10e4e8a1504c67e3bde0bacf735a2ac9b78892/python/mypy/issues/17825
og:image:altCrash Report I'm developing an cache decorator that uses ParamSpec to be as generic as possible. There's a slight bug in my code (I used Sequence where I should have used Paramspec.args), but I fee...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamekvdveer
hostnamegithub.com
expected-hostnamegithub.com
None0a0d8686a27478df474dd7415776a7a080cde8838b3cd92ea7601187572e5729
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
release16a11879678aaf97e2a42c33ee70830aa084fa37
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/python/mypy/issues/17825#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fmypy%2Fissues%2F17825
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%2F17825
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/17825
Reloadhttps://github.com/python/mypy/issues/17825
Reloadhttps://github.com/python/mypy/issues/17825
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/17825
New issuehttps://github.com/login?return_to=https://github.com/python/mypy/issues/17825
Crash when using ParamSpechttps://github.com/python/mypy/issues/17825#top
crashhttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22crash%22
topic-paramspecPEP 612, ParamSpec, Concatenatehttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22topic-paramspec%22
https://github.com/kvdveer
kvdveerhttps://github.com/kvdveer
on Sep 25, 2024https://github.com/python/mypy/issues/17825#issue-2547566306
kvdveerhttps://github.com/kvdveer
crashhttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22crash%22
on Sep 25, 2024https://github.com/python/mypy/issues/17825#event-14396539933
https://github.com/brianschubert
brianschuberthttps://github.com/brianschubert
on Sep 25, 2024https://github.com/python/mypy/issues/17825#issuecomment-2374044352
a00fcbahttps://github.com/python/mypy/commit/a00fcba1e77ac944276b8c4ad0a31b7b05ded59f
#16942https://github.com/python/mypy/pull/16942
https://github.com/JelleZijlstra
JelleZijlstrahttps://github.com/JelleZijlstra
on Sep 25, 2024https://github.com/python/mypy/issues/17825#issuecomment-2374151748
https://github.com/brianschubert
brianschuberthttps://github.com/brianschubert
on Sep 25, 2024https://github.com/python/mypy/issues/17825#issuecomment-2374282692
07d8878https://github.com/python/mypy/commit/07d88787774fabbd3108d18621b30df9b42e7c83
#11847https://github.com/python/mypy/pull/11847
44993e6https://github.com/python/mypy/commit/44993e6a18f852a9296786267ecf26ea730b4f31
#12548https://github.com/python/mypy/pull/12548
14418bchttps://github.com/python/mypy/commit/14418bc3d2c38b9ea776da6029e9d9dc6650b7ea
#15837https://github.com/python/mypy/pull/15837
ilevkivskyihttps://github.com/ilevkivskyi
topic-paramspecPEP 612, ParamSpec, Concatenatehttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22topic-paramspec%22
on Oct 3, 2024https://github.com/python/mypy/issues/17825#event-14501453246
https://github.com/sterliakov
sterliakovhttps://github.com/sterliakov
on Jan 12, 2025https://github.com/python/mypy/issues/17825#issuecomment-2585862171
#18278https://github.com/python/mypy/pull/18278
https://github.com/hauntsaninja
hauntsaninjahttps://github.com/hauntsaninja
on Jan 13, 2025https://github.com/python/mypy/issues/17825#issuecomment-2586254568
hauntsaninjahttps://github.com/hauntsaninja
completedhttps://github.com/python/mypy/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Jan 13, 2025https://github.com/python/mypy/issues/17825#event-15899070336
Sign up for freehttps://github.com/signup?return_to=https://github.com/python/mypy/issues/17825
Sign in to commenthttps://github.com/login?return_to=https://github.com/python/mypy/issues/17825
crashhttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22crash%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.