Stubs generator #17

Merged
HEL merged 9 commits from feat/stubs-gen into main 2026-06-20 15:44:35 +00:00
Owner

This PR implements a simple stubs generator and a dedicate stubs command
The goal is to generate useful, importable Python stubs from a Midas definition file, helping other type checkers use custom types
For now, type definitions are implemented using classes. This forces named subtyping, where a type can only be a subtype of another type if the relation is somehow explicit through the type hierarchy.
Functions do use Protocols, which support structural subtyping.

Another mechanism that could be used are TypeAliases, provided by the typing module

This PR implements a simple stubs generator and a dedicate `stubs` command The goal is to generate useful, importable Python stubs from a Midas definition file, helping other type checkers use custom types For now, type definitions are implemented using classes. This forces named subtyping, where a type can only be a subtype of another type if the relation is somehow explicit through the type hierarchy. Functions do use `Protocol`s, which support structural subtyping. Another mechanism that could be used are `TypeAlias`es, provided by the `typing` module
HEL self-assigned this 2026-06-20 15:42:12 +00:00
HEL added 8 commits 2026-06-20 15:42:12 +00:00
HEL added 1 commit 2026-06-20 15:44:27 +00:00
HEL merged commit cccf2f8f9f into main 2026-06-20 15:44:35 +00:00
HEL deleted branch feat/stubs-gen 2026-06-20 15:44:35 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: HEL/midas#17