Title: REGR: mypyc 0.971 seems to not handle keyword-only arguments when unpickling (and shallow copying) · Issue #13227 · python/mypy · GitHub
Open Graph Title: REGR: mypyc 0.971 seems to not handle keyword-only arguments when unpickling (and shallow copying) · Issue #13227 · python/mypy
X Title: REGR: mypyc 0.971 seems to not handle keyword-only arguments when unpickling (and shallow copying) · Issue #13227 · python/mypy
Description: Bug Report The following worked with 0.961: object's whose __init__ has a keyword-only argument can no longer be unpickled. To Reproduce test.py from typing import Any class Test: def __init__(self, *, x: Any) -> None: ... save_load.py i...
Open Graph Description: Bug Report The following worked with 0.961: object's whose __init__ has a keyword-only argument can no longer be unpickled. To Reproduce test.py from typing import Any class Test: def __init__(self...
X Description: Bug Report The following worked with 0.961: object's whose __init__ has a keyword-only argument can no longer be unpickled. To Reproduce test.py from typing import Any class Test: def __init__(...
Opengraph URL: https://github.com/python/mypy/issues/13227
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"REGR: mypyc 0.971 seems to not handle keyword-only arguments when unpickling (and shallow copying)","articleBody":"**Bug Report**\r\n\r\nThe following worked with 0.961: object's whose `__init__` has a keyword-only argument can no longer be unpickled.\r\n\r\n**To Reproduce**\r\n\r\ntest.py\r\n```py\r\nfrom typing import Any\r\n\r\nclass Test:\r\n def __init__(self, *, x: Any) -> None:\r\n ...\r\n```\r\nsave_load.py\r\n```py\r\nimport pickle\r\nfrom test import Test\r\n\r\ntest = Test(x=1)\r\n\r\nwith open(\"test.pickle\", mode=\"w+b\") as file:\r\n pickle.dump(test, file)\r\nwith open(\"test.pickle\", mode=\"r+b\") as file:\r\n pickle.load(file)\r\n```\r\n\r\n```sh\r\n$ mypyc test.py\r\n$ python save_load.py \r\nTraceback (most recent call last):\r\n File \"save_load.py\", line 9, in \u003cmodule>\r\n pickle.load(file)\r\nTypeError: __init__() missing required keyword-only argument 'x'\r\n```\r\n\r\n**Expected Behavior**\r\nNo `TypeError`\r\n\r\n**Actual Behavior**\r\n`TypeError`\r\n\r\n**Your Environment**\r\n\r\n\r\n- Mypy version used: 0.971\r\n- Python version used: 3.10.4\r\n- Operating system and version: Fedora Silverblue","author":{"url":"https://github.com/twoertwein","@type":"Person","name":"twoertwein"},"datePublished":"2022-07-23T12:46:18Z","url":"https://github.com/python/mypy/issues/13227"}
| 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:7fa23dfc-d68d-e636-da2c-04f0e02d347b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E82C:1CF166:22F6DA6:2F90733:6B002CCC |
| html-safe-nonce | 817f793f50060d0eacd8bcd7ead1d668abbc2539d107a28391e5c888a9809391 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFODJDOjFDRjE2NjoyMkY2REE2OjJGOTA3MzM6NkIwMDJDQ0MiLCJ2aXNpdG9yX2lkIjoiMzgyNDM2MDEzNzY3MDI3NDI1MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 7bf543bc4fe63e7db46a1983de21b347a03d102a31d836998726c07365216ebc |
| hovercard-subject-tag | issue:1315650984 |
| 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/13227/issue_layout |
| twitter:image | https://opengraph.githubassets.com/395eef7c21b522300f5878ac459a240ee07eec18560005bc1ae876c6121c2398/python/mypy/issues/13227 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/395eef7c21b522300f5878ac459a240ee07eec18560005bc1ae876c6121c2398/python/mypy/issues/13227 |
| og:image:alt | Bug Report The following worked with 0.961: object's whose __init__ has a keyword-only argument can no longer be unpickled. To Reproduce test.py from typing import Any class Test: def __init__(self... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | twoertwein |
| 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