Title: pickling fails for typing.Tuple[()] · Issue #94245 · python/cpython · GitHub
Open Graph Title: pickling fails for typing.Tuple[()] · Issue #94245 · python/cpython
X Title: pickling fails for typing.Tuple[()] · Issue #94245 · python/cpython
Description: Bug report A clear and concise description of what the bug is. Include a minimal, reproducible example (https://stackoverflow.com/help/minimal-reproducible-example), if possible. import pickle from typing import Tuple j = Tuple[()] seria...
Open Graph Description: Bug report A clear and concise description of what the bug is. Include a minimal, reproducible example (https://stackoverflow.com/help/minimal-reproducible-example), if possible. import pickle from...
X Description: Bug report A clear and concise description of what the bug is. Include a minimal, reproducible example (https://stackoverflow.com/help/minimal-reproducible-example), if possible. import pickle from...
Opengraph URL: https://github.com/python/cpython/issues/94245
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"pickling fails for typing.Tuple[()]","articleBody":"\u003c!--\r\n If you're new to Python and you're not sure whether what you're experiencing is a bug, the CPython issue tracker is not\r\n the right place to seek help. Consider the following options instead:\r\n\r\n - reading the Python tutorial: https://docs.python.org/3/tutorial/\r\n - posting in the \"Users\" category on discuss.python.org: https://discuss.python.org/c/users/7\r\n - emailing the Python-list mailing list: https://mail.python.org/mailman/listinfo/python-list\r\n - searching our issue tracker (https://github.com/python/cpython/issues) to see if\r\n your problem has already been reported\r\n--\u003e\r\n\r\n**Bug report**\r\n\r\nA clear and concise description of what the bug is.\r\nInclude a minimal, reproducible example (https://stackoverflow.com/help/minimal-reproducible-example), if possible.\r\n\r\n```\r\nimport pickle\r\nfrom typing import Tuple\r\n\r\nj = Tuple[()]\r\nserialized = pickle.dumps(j)\r\nloaded = pickle.loads(serialized)\r\n```\r\n\r\nError message:\r\n\r\n```\r\nTraceback (most recent call last):\r\n File \"/Users/ryanthompson/PycharmProjects/learningProjects/dill_regression/regression_test.py\", line 6, in \u003cmodule\u003e\r\n loaded = dill.loads(serialized)\r\n File \"/Users/ryanthompson/.pyenv/versions/3.8.11/lib/python3.8/site-packages/dill/_dill.py\", line 387, in loads\r\n return load(file, ignore, **kwds)\r\n File \"/Users/ryanthompson/.pyenv/versions/3.8.11/lib/python3.8/site-packages/dill/_dill.py\", line 373, in load\r\n return Unpickler(file, ignore=ignore, **kwds).load()\r\n File \"/Users/ryanthompson/.pyenv/versions/3.8.11/lib/python3.8/site-packages/dill/_dill.py\", line 646, in load\r\n obj = StockUnpickler.load(self)\r\n File \"/Users/ryanthompson/.pyenv/versions/3.8.11/lib/python3.8/typing.py\", line 804, in __getitem__\r\n return self.__getitem_inner__(params)\r\n File \"/Users/ryanthompson/.pyenv/versions/3.8.11/lib/python3.8/typing.py\", line 261, in inner\r\n return func(*args, **kwds)\r\n File \"/Users/ryanthompson/.pyenv/versions/3.8.11/lib/python3.8/typing.py\", line 830, in __getitem_inner__\r\n params = tuple(_type_check(p, msg) for p in params)\r\n File \"/Users/ryanthompson/.pyenv/versions/3.8.11/lib/python3.8/typing.py\", line 830, in \u003cgenexpr\u003e\r\n params = tuple(_type_check(p, msg) for p in params)\r\n File \"/Users/ryanthompson/.pyenv/versions/3.8.11/lib/python3.8/typing.py\", line 149, in _type_check\r\n raise TypeError(f\"{msg} Got {arg!r:.100}.\")\r\nTypeError: Tuple[t0, t1, ...]: each t must be a type. Got ().\r\n\r\n\r\n```\r\n\r\n**Your environment**\r\npython 3.8\r\n\u003c!-- Include as many relevant details as possible about the environment you experienced the bug in --\u003e\r\n\r\n- CPython versions tested on:\r\n3.6 \u0026 3.8\r\n- Operating system and architecture:\r\nMac OS\r\n\r\n\u003c!--\r\nYou can freely edit this text. Remove any lines you believe are unnecessary.\r\n--\u003e\r\n","author":{"url":"https://github.com/ryanthompson591","@type":"Person","name":"ryanthompson591"},"datePublished":"2022-06-24T20:37:33.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/94245/cpython/issues/94245"}
| 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:75aa3791-3e09-3fb1-477a-a181240650a6 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B82E:27157C:236FB4:2FA33E:69696775 |
| html-safe-nonce | 438ddb972c8fe6add96375c1753ba45a666cb12620cd0e845f30df9bb54ca83f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCODJFOjI3MTU3QzoyMzZGQjQ6MkZBMzNFOjY5Njk2Nzc1IiwidmlzaXRvcl9pZCI6Ijc0NTIwMjI1OTU0MDY4ODI2NzciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 635ac1a0c99e395c3ec11d0f4bf9aaae77d2d0fdbf88001eef2d9364d50515f8 |
| hovercard-subject-tag | issue:1284169009 |
| 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/cpython/94245/issue_layout |
| twitter:image | https://opengraph.githubassets.com/206142f886460ce5f14ccade9fd22d87558fd9f665739c5779cfe0d7203e1aa4/python/cpython/issues/94245 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/206142f886460ce5f14ccade9fd22d87558fd9f665739c5779cfe0d7203e1aa4/python/cpython/issues/94245 |
| og:image:alt | Bug report A clear and concise description of what the bug is. Include a minimal, reproducible example (https://stackoverflow.com/help/minimal-reproducible-example), if possible. import pickle from... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ryanthompson591 |
| hostname | github.com |
| expected-hostname | github.com |
| None | c6f193beb8ff08443adc07685d75302ab8aaf0a135f6e251c3ff3112c8deb881 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| 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 | ec4d88fbe7ed62446d90b0a6d8e6db4248a8f8b8 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width