← 返回首页
multiprocessing classes SimpleQueue and Queue don't support typing in 3.11.0 · Issue #99509 · python/cpython · GitHub
Skip to content

Navigation Menu

Toggle navigation
Sign in
Appearance settings
Search or jump to...

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Resetting focus

multiprocessing classes SimpleQueue and Queue don't support typing in 3.11.0 #99509

New issue
New issue

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

from multiprocessing import SimpleQueue multiprocessing_queue: SimpleQueue[str] = SimpleQueue()

Result - error:

multiprocessing_queue: SimpleQueue[str] = SimpleQueue() ~~~~~~~~~~~^^^^^ TypeError: 'method' object is not subscriptable

How it should work:

It should work like Queue from the queue module:

from queue import Queue standard_queue: Queue[str] = Queue()

Result - no error.

Why do I need this?

I want my IDE to know that queue.get() returns str object.

Your environment

Python 3.11.0 arm64
Python 3.11.0 (main, Nov 4 2022, 17:22:54) [Clang 14.0.0 (clang-1400.0.29.202)] on darwin
MacBook M1 Pro macOS Ventura 13.0.1.

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    • Open in GitHub Copilot app

    Footer

    © 2026 GitHub, Inc.