Title: multiprocessing classes SimpleQueue and Queue don't support typing in 3.11.0 · Issue #99509 · python/cpython · GitHub
Open Graph Title: multiprocessing classes SimpleQueue and Queue don't support typing in 3.11.0 · Issue #99509 · python/cpython
X Title: multiprocessing classes SimpleQueue and Queue don't support typing in 3.11.0 · Issue #99509 · python/cpython
Description: Bug report SimpleQueue and Queue classes from multiprocessing module in Python 3.11.0 do not support type [str] annotation. Minimal, reproducible example: from multiprocessing import Queue multiprocessing_queue: Queue[str] = Queue() or f...
Open Graph Description: Bug report SimpleQueue and Queue classes from multiprocessing module in Python 3.11.0 do not support type [str] annotation. Minimal, reproducible example: from multiprocessing import Queue multipro...
X Description: Bug report SimpleQueue and Queue classes from multiprocessing module in Python 3.11.0 do not support type [str] annotation. Minimal, reproducible example: from multiprocessing import Queue multipro...
Opengraph URL: https://github.com/python/cpython/issues/99509
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"multiprocessing classes SimpleQueue and Queue don't support typing in 3.11.0","articleBody":"# Bug report\r\n\r\n`SimpleQueue` and `Queue` classes from `multiprocessing` module in Python 3.11.0 do not support type `[str]` annotation.\r\n\r\nMinimal, reproducible example:\r\n\r\n```python3\r\nfrom multiprocessing import Queue\r\nmultiprocessing_queue: Queue[str] = Queue()\r\n```\r\n\r\nor\r\n\r\n```python3\r\nfrom multiprocessing import SimpleQueue\r\nmultiprocessing_queue: SimpleQueue[str] = SimpleQueue()\r\n```\r\n\r\nResult - error:\r\n\r\n```console\r\n multiprocessing_queue: SimpleQueue[str] = SimpleQueue()\r\n ~~~~~~~~~~~^^^^^\r\nTypeError: 'method' object is not subscriptable\r\n```\r\n\r\nHow it should work:\r\n\r\nIt should work like `Queue` from the `queue` module:\r\n\r\n```python3\r\nfrom queue import Queue\r\nstandard_queue: Queue[str] = Queue()\r\n```\r\n\r\nResult - no error.\r\n\r\nWhy do I need this?\r\n\r\nI want my IDE to know that `queue.get()` returns `str` object.\r\n\r\n# Your environment\r\n\r\nPython 3.11.0 arm64\r\nPython 3.11.0 (main, Nov 4 2022, 17:22:54) [Clang 14.0.0 (clang-1400.0.29.202)] on darwin\r\nMacBook M1 Pro macOS Ventura 13.0.1.\r\n\r\n\u003c!-- gh-linked-prs --\u003e\r\n### Linked PRs\r\n* gh-99511\r\n\u003c!-- /gh-linked-prs --\u003e\r\n","author":{"url":"https://github.com/rafrafek","@type":"Person","name":"rafrafek"},"datePublished":"2022-11-15T13:00:31.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/99509/cpython/issues/99509"}
| 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:9ec8bb87-9308-94af-b12b-486e95633627 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D1CA:17C6E:25CDE96:352CB43:69691B29 |
| html-safe-nonce | aadfeacfeba80988961dfc77c0730d74b14c07fabb9114cf8c5065d664d8c557 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMUNBOjE3QzZFOjI1Q0RFOTY6MzUyQ0I0Mzo2OTY5MUIyOSIsInZpc2l0b3JfaWQiOiIyMzcwMzM1MTkxOTI2OTA1NjQxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 3286d07bff515d894a770eb182330be3e45b3a255eb36e5e3f64093ae8ecc5e9 |
| hovercard-subject-tag | issue:1449745669 |
| 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/99509/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a99bbe15a7904ea2d10c4add4ad0165a154def5df7b6f9b6333759925363054d/python/cpython/issues/99509 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a99bbe15a7904ea2d10c4add4ad0165a154def5df7b6f9b6333759925363054d/python/cpython/issues/99509 |
| og:image:alt | Bug report SimpleQueue and Queue classes from multiprocessing module in Python 3.11.0 do not support type [str] annotation. Minimal, reproducible example: from multiprocessing import Queue multipro... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | rafrafek |
| hostname | github.com |
| expected-hostname | github.com |
| None | 0e60568924309a021b51adabdce15c2a2f285b556f3130d1a2fa2a5bce11c55f |
| 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 | dd206f7ed6207863172be4a783826e86bd2375c3 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width