Skip to content

[multiprocessing] DefaultContext.get_start_method can return None - #16799

Merged
srittau merged 1 commit into
python:mainfrom
vmphase:fix/multiprocessing-get-start-method-none
Nov 14, 2026
Merged

srittau merged 1 commit into
python:mainfrom
vmphase:fix/multiprocessing-get-start-method-none

Conversation

@vmphase

@vmphase vmphase commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

multiprocessing.get_start_method(allow_none=True) returns None when no start method has been set (docs, source). Hence, code that handles this documented case gets flagged by type checkers:

warning: Condition will always evaluate to False since the types "str" and "None" have no overlap (reportUnnecessaryComparison)

@github-actions

Copy link
Copy Markdown
Contributor

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

Comment thread stdlib/multiprocessing/context.pyi Resolved
@srittau
srittau merged commit 5aafe0b into python:main Nov 14, 2026
88 checks passed
@vmphase
vmphase deleted the fix/multiprocessing-get-start-method-none branch November 14, 2026 13:00
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