typeshed icon indicating copy to clipboard operation
typeshed copied to clipboard

Make multiprocessing pipes generic

Open Avasam opened this issue 2 years ago • 10 comments

A while ago I was toying with the idea of using multiprocessing for a long-running task, and got annoyed that I could not specify a type for my interfacing pipes. So I hashed up a quick generic multiprocessing stub for my need.

I didn't end up going that route, but since I already did some typing work, figure I'd publish it rather than throw it away. Idk if the TypeVar variance is correct, please advise.

Avasam avatar Dec 10 '23 08:12 Avasam

Diff from mypy_primer, showing the effect of this PR on open source code:

sphinx (https://github.com/sphinx-doc/sphinx)
+ sphinx/util/parallel.py: note: In member "add_task" of class "ParallelTasks":
+ sphinx/util/parallel.py:92:24: error: Need type annotation for "precv"  [var-annotated]
+ sphinx/util/parallel.py:92:24: error: Need type annotation for "psend"  [var-annotated]

github-actions[bot] avatar Dec 10 '23 08:12 github-actions[bot]

Diff from mypy_primer, showing the effect of this PR on open source code:

sphinx (https://github.com/sphinx-doc/sphinx)
+ sphinx/util/parallel.py: note: In member "add_task" of class "ParallelTasks":
+ sphinx/util/parallel.py:92:24: error: Need type annotation for "precv"  [var-annotated]
+ sphinx/util/parallel.py:92:24: error: Need type annotation for "psend"  [var-annotated]

github-actions[bot] avatar Dec 10 '23 08:12 github-actions[bot]

Diff from mypy_primer, showing the effect of this PR on open source code:

sphinx (https://github.com/sphinx-doc/sphinx)
+ sphinx/util/parallel.py: note: In member "add_task" of class "ParallelTasks":
+ sphinx/util/parallel.py:92:24: error: Need type annotation for "precv"  [var-annotated]
+ sphinx/util/parallel.py:92:24: error: Need type annotation for "psend"  [var-annotated]

github-actions[bot] avatar Dec 10 '23 08:12 github-actions[bot]

Diff from mypy_primer, showing the effect of this PR on open source code:

sphinx (https://github.com/sphinx-doc/sphinx)
+ sphinx/util/parallel.py: note: In member "add_task" of class "ParallelTasks":
+ sphinx/util/parallel.py:92:24: error: Need type annotation for "precv"  [var-annotated]
+ sphinx/util/parallel.py:92:24: error: Need type annotation for "psend"  [var-annotated]

github-actions[bot] avatar Dec 17 '23 18:12 github-actions[bot]

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

github-actions[bot] avatar Dec 23 '23 00:12 github-actions[bot]

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

github-actions[bot] avatar Dec 23 '23 01:12 github-actions[bot]

Marking as deferred until https://github.com/python/typeshed/issues/11422

Avasam avatar Mar 07 '24 18:03 Avasam

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

github-actions[bot] avatar Mar 11 '24 17:03 github-actions[bot]

TypeVar defaults are now available in typeshed.

srittau avatar Mar 20 '24 03:03 srittau

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

github-actions[bot] avatar Mar 30 '24 18:03 github-actions[bot]