Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve multiprocessing stubs #8202

Merged
merged 8 commits into from
Jul 1, 2022

Conversation

AlexWaygood
Copy link
Member

@AlexWaygood AlexWaygood commented Jun 28, 2022

  • Use bound methods in multiprocessing/__init__.pyi instead of duplicating the signatures from multiprocessing.context.pyi. Improve the signatures in multiprocessing.context.pyi where the ones in multiprocessing.__init__.pyi are more precise. This matches the runtime.
  • Use re-exports instead of assignments for several functions in multiprocessing/dummy/__init__.pyi. This reduces ambiguity in the stub (they're not type aliases), and matches the runtime.
  • Use an assignment for multiprocessing.dummy.current_process, instead of duplicating the signature from threading.pyi. Again, this matches the runtime.
  • Callable[<parameters>, Any] -> Callable[<parameters>, object] for several callbacks where the returned value is ignored.

Relevant to PyCQA/flake8-pyi#237.

@github-actions

This comment has been minimized.

1 similar comment
@github-actions

This comment has been minimized.

@AlexWaygood AlexWaygood marked this pull request as draft June 28, 2022 13:20
@AlexWaygood AlexWaygood marked this pull request as ready for review June 28, 2022 13:29
@github-actions

This comment has been minimized.

stdlib/multiprocessing/context.pyi Outdated Show resolved Hide resolved
stdlib/multiprocessing/context.pyi Outdated Show resolved Hide resolved
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

1 similar comment
@github-actions
Copy link
Contributor

github-actions bot commented Jul 1, 2022

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

@AlexWaygood AlexWaygood requested a review from hauntsaninja July 1, 2022 13:07
@hauntsaninja hauntsaninja merged commit a2e8346 into python:master Jul 1, 2022
@AlexWaygood AlexWaygood deleted the multiprocessing-callbacks branch July 1, 2022 18:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants