Skip to content

Fix executor initializer attribute return types - #16805

Open
ibrahimmaq14 wants to merge 1 commit into
python:mainfrom
ibrahimmaq14:fix/11400-executor-initializer
Open

ibrahimmaq14 wants to merge 1 commit into
python:mainfrom
ibrahimmaq14:fix/11400-executor-initializer

Conversation

@ibrahimmaq14

Copy link
Copy Markdown

Fixes #11400.

Change the stored _initializer attributes from Callable[..., None] | None to Callable[..., object] | None to match the constructor annotations, accepting value-returning callbacks while retaining checks for non-callables and mismatched constructor initargs.

CPython stores the callable unchanged and ignores its result (process executor, thread executor through 3.13); the thread attribute was removed in 3.14, so its regression cases are version-gated.

Verified locally:

  • python tests/runtests.py stdlib/concurrent: all checks passed, including pre-commit, structure, mypy, pyright, ty, pyrefly, stubtest, and regression suites.
  • Full stdlib mypy regression suite and focused mypy/pyright cases: Python targets 3.10–3.15.
  • Concurrent stubs: mypy targets 3.10–3.15; pyright, ty, and pyrefly targets 3.10 and 3.14.
  • Runtime smoke tests on CPython 3.11.9 and 3.14.7; stubtest on 3.11.9 (899 modules) and 3.14.7 (the two changed modules).

Agent used: OpenAI Codex.

Copilot AI balanced review requested due to automatic review settings November 14, 2026 21:57

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@github-actions

Copy link
Copy Markdown
Contributor

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

This branch has not been deployed

No deployments
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.

ProcessPoolExecutor initializer 3.11 overloads return object?

2 participants