Title: mypyc crashes with ParamSpec · Issue #15409 · python/mypy · GitHub
Open Graph Title: mypyc crashes with ParamSpec · Issue #15409 · python/mypy
X Title: mypyc crashes with ParamSpec · Issue #15409 · python/mypy
Description: I did my first try with mypyc but it directly crashes when I use ParamSpec To Reproduce from __future__ import annotations from typing import Any, Callable, TypeVar, ParamSpec PARAM = ParamSpec("PARAM") RET = TypeVar("RET") def decorator...
Open Graph Description: I did my first try with mypyc but it directly crashes when I use ParamSpec To Reproduce from __future__ import annotations from typing import Any, Callable, TypeVar, ParamSpec PARAM = ParamSpec("PA...
X Description: I did my first try with mypyc but it directly crashes when I use ParamSpec To Reproduce from __future__ import annotations from typing import Any, Callable, TypeVar, ParamSpec PARAM = ParamSpec(&qu...
Opengraph URL: https://github.com/python/mypy/issues/15409
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"mypyc crashes with ParamSpec","articleBody":"I did my first try with mypyc but it directly crashes when I use ParamSpec\r\n\r\n**To Reproduce**\r\n\r\n```python\r\nfrom __future__ import annotations\r\nfrom typing import Any, Callable, TypeVar, ParamSpec\r\n\r\nPARAM = ParamSpec(\"PARAM\")\r\nRET = TypeVar(\"RET\")\r\n\r\ndef decorator() -> Callable[[Callable[PARAM, RET]], Callable[PARAM, RET]]:\r\n def _wrapper(function: Callable[PARAM, RET]) -> Callable[PARAM, RET]:\r\n def _inner(*args: PARAM.args, **kwargs: PARAM.kwargs) -> Any:\r\n return function(*args, **kwargs)\r\n\r\n return _inner\r\n\r\n return _wrapper\r\n```\r\n\r\n**Expected Behavior**\r\nWorks\r\n\r\n**Actual Behavior**\r\n```\r\nTraceback (most recent call last):\r\n File \"mypyc/irbuild/builder.py\", line 265, in accept\r\n File \"mypy/nodes.py\", line 774, in accept\r\n File \"mypyc/irbuild/visitor.py\", line 179, in visit_func_def\r\n File \"mypyc/irbuild/function.py\", line 98, in transform_func_def\r\n File \"mypyc/irbuild/function.py\", line 275, in gen_func_item\r\n File \"mypyc/irbuild/env_class.py\", line 102, in load_env_registers\r\n File \"mypyc/irbuild/env_class.py\", line 179, in add_args_to_env\r\n File \"mypyc/irbuild/env_class.py\", line 165, in num_bitmap_args\r\n File \"mypyc/irbuild/builder.py\", line 1236, in type_to_rtype\r\n File \"mypyc/irbuild/mapper.py\", line 143, in type_to_rtype\r\nfoo.py:11: AssertionError: unexpected type \u003cclass 'mypy.types.ParamSpecType'>\r\n```\r\n\r\n**Your Environment**\r\n\r\n\u003c!-- Include as many relevant details about the environment you experienced the bug in -->\r\n\r\n- Mypy version used: 1.3.0\r\n- Mypy command-line flags: n/a\r\n- Mypy configuration options from `mypy.ini` (and other config files): n/a\r\n- Python version used: 3.11.0","author":{"url":"https://github.com/kasium","@type":"Person","name":"kasium"},"datePublished":"2023-06-10T14:18:43Z","url":"https://github.com/python/mypy/issues/15409"}
| 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:b579cc30-7768-8378-3e57-02236593788d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B35C:244A6A:10D12F8:1611E58:6B000930 |
| html-safe-nonce | fa23e068735dd6beee78d7fdcbe6f55477ad408282871accda2315b5ac232733 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMzVDOjI0NEE2QToxMEQxMkY4OjE2MTFFNTg6NkIwMDA5MzAiLCJ2aXNpdG9yX2lkIjoiMTU0MTQ1MDA5Nzc0MzYyODU5MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 8e8015a9eacc9c4aa6b4b09b8ccde3dd76f99314806e76b370b7bd463b8a3214 |
| hovercard-subject-tag | issue:1750989265 |
| 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/15409/issue_layout |
| twitter:image | https://opengraph.githubassets.com/277dc09d99645c0719d420c16387e9407972f50d24439b3881fa42252601209e/python/mypy/issues/15409 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/277dc09d99645c0719d420c16387e9407972f50d24439b3881fa42252601209e/python/mypy/issues/15409 |
| og:image:alt | I did my first try with mypyc but it directly crashes when I use ParamSpec To Reproduce from __future__ import annotations from typing import Any, Callable, TypeVar, ParamSpec PARAM = ParamSpec("PA... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | kasium |
| 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