Title: Crash on diverging recursive generic protocols · Issue #17326 · python/mypy · GitHub
Open Graph Title: Crash on diverging recursive generic protocols · Issue #17326 · python/mypy
X Title: Crash on diverging recursive generic protocols · Issue #17326 · python/mypy
Description: EDIT: Although the original repro is not causing a crash anymore, the underlying issue is still there, see #17326 (comment) Crash Report Not sure how to title this, the following example produces a segfault, I simplified it from more com...
Open Graph Description: EDIT: Although the original repro is not causing a crash anymore, the underlying issue is still there, see #17326 (comment) Crash Report Not sure how to title this, the following example produces a...
X Description: EDIT: Although the original repro is not causing a crash anymore, the underlying issue is still there, see #17326 (comment) Crash Report Not sure how to title this, the following example produces a...
Opengraph URL: https://github.com/python/mypy/issues/17326
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Crash on diverging recursive generic protocols","articleBody":"_EDIT_: Although the original repro is not causing a crash anymore, the underlying issue is still there, see https://github.com/python/mypy/issues/17326#issuecomment-2151135134\n\n**Crash Report**\n\nNot sure how to title this, the following example produces a segfault, I simplified it from more complicated code. It seems to be multicausal, removing the `Literal` makes it disappear, so does removing the `__or__` operator on `Transform`.\n\n**To Reproduce**\n\nhttps://mypy-play.net/?mypy=latest&python=3.12&gist=2409c60fc1d5734569f6ab55344a85f0\n\n```python\nfrom typing import Any, Literal, Protocol, TypeVar, overload\n\nX = TypeVar(\"X\")\nY = TypeVar(\"Y\")\nZ = TypeVar(\"Z\")\nX2 = TypeVar(\"X2\")\nY2 = TypeVar(\"Y2\")\n\n\nclass Transform(Protocol[X, Y]):\n def __or__(\n self, other: \"Transform[X2, Y2]\", /\n ) -> \"Transform[tuple[X, X2], tuple[Y, Y2]]\": ...\n\n\n@overload # 1 arg\ndef chain_encoders(\n e: Transform[X, Y], /, *, simplify: Literal[True] = ...\n) -> Transform[X, Y]: ...\n@overload # ≥2 args\ndef chain_encoders(\n *es: *tuple[Transform[Any, Y], *tuple[Transform, ...], Transform[X, Any]],\n simplify: Literal[True] = ...,\n) -> Transform[X, Y]: ...\ndef chain_encoders(*encoders: Transform, simplify: bool = True) -> Transform:\n r\"\"\"Chain encoders.\"\"\"\n```\n","author":{"url":"https://github.com/randolf-scholz","@type":"Person","name":"randolf-scholz"},"datePublished":"2024-06-04T12:11:01Z","url":"https://github.com/python/mypy/issues/17326"}
| 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:1eb50361-c26d-db74-38bd-c2744aff1b15 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A4B6:1A3D7F:2E93475:3D76B36:6B001DE0 |
| html-safe-nonce | 1bcea2b955ecc615ebe0e45e5bf2b56b7b0e2856b82e185e6c68db6e45c12ea8 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNEI2OjFBM0Q3RjoyRTkzNDc1OjNENzZCMzY6NkIwMDFERTAiLCJ2aXNpdG9yX2lkIjoiNjQxMzU0MTA5MTQyOTA2NDE2MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 6203825e2e5aa3070bc08bc8e7b26bfc0f30d0e967f0ee45fffb77eeeaa5434c |
| hovercard-subject-tag | issue:2333370133 |
| 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/17326/issue_layout |
| twitter:image | https://opengraph.githubassets.com/4a6d08054c8e303504ee050ebbb4cf8875e8446041fb0465fe09c9be02a1352b/python/mypy/issues/17326 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/4a6d08054c8e303504ee050ebbb4cf8875e8446041fb0465fe09c9be02a1352b/python/mypy/issues/17326 |
| og:image:alt | EDIT: Although the original repro is not causing a crash anymore, the underlying issue is still there, see #17326 (comment) Crash Report Not sure how to title this, the following example produces a... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | randolf-scholz |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4eb4cba0d69f045374ac15de9666d22b0961e1d555cc3824f36b7734c00c78e0 |
| 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 | 44c658b24abf00491fb7ae5f56d42c9f38cbeab2 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width