Skip to content

Conversation

@Avasam
Copy link
Contributor

@Avasam Avasam commented Dec 20, 2025

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 force-pushed the def-spawn-better-types branch from 1e73a19 to 22f61d9 Compare December 20, 2025 06:19
@Avasam
Copy link
Contributor Author

Avasam commented Dec 20, 2025

# function) -- authors of new compiler interface classes are
# responsible for updating 'compiler_class'!
compiler_type: ClassVar[str] = None # type: ignore[assignment]
compiler_type: ClassVar[str] = None
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will be added back in #368 , but tests currently fails with this due to unused type-ignore

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