Skip to content

multiprocessing.Queue missing __setstate__ but contains __getstate__ #14606

@huntfx

Description

@huntfx

I noticed this when trying to subclass a queue, it fails on super().__setstate__(...).
Mypy seems happy with __getstate__, but not __setstate__, even though both exist.

Image

https://mypy-play.net/?mypy=latest&python=3.12&gist=125d98f01321257f2e55a7b41536f8b0

import multiprocessing.queues
multiprocessing.queues.Queue.__getstate__
multiprocessing.queues.Queue.__setstate__

# error: "type[Queue[Any]]" has no attribute "__setstate__"  [attr-defined]

Metadata

Metadata

Assignees

No one assigned

    Labels

    stubs: incompleteAnnotations or sub-modules missing from an existing package or module

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions