Skip to content

spawn: don't force param cmd to be mutable#390

Open
Avasam wants to merge 1 commit into
pypa:mainfrom
Avasam:def-spawn-better-types
Open

spawn: don't force param cmd to be mutable#390
Avasam wants to merge 1 commit into
pypa:mainfrom
Avasam:def-spawn-better-types

Conversation

@Avasam

@Avasam Avasam commented Dec 20, 2025

Copy link
Copy Markdown
Contributor

This has 2 advantages:

  • cmd doesn't have to be mutable. So tuples are usable
  • It actually improves the generic type because MutableSequence is invariant. which can cause issues with union types since you need to match the exact full union type (some checkers do allow partial union match for inline/literal sequences)

I also improved the possible param types by using an overload on search_path (since search_path allows bytes | str | PathLike[str], but not PathLike[bytes])

Open question: Since verbose isn't used in spawn, maybe it's better to not even expose it as a possible kwargs in Compiler classes ? (no runtime change, just hiding it from the type annotation in wrapper methods)

@Avasam

Avasam commented Dec 20, 2025

Copy link
Copy Markdown
Contributor Author

Comment thread distutils/compilers/C/base.py
@Avasam Avasam force-pushed the def-spawn-better-types branch 2 times, most recently from ed891f5 to fe21a7f Compare July 4, 2026 19:08
@Avasam Avasam force-pushed the def-spawn-better-types branch 2 times, most recently from bfda993 to 3a7376a Compare July 7, 2026 21:55
@Avasam Avasam force-pushed the def-spawn-better-types branch from 3a7376a to 14121d7 Compare July 7, 2026 21:59
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.

1 participant