Stubs generator #17
Reference in New Issue
Block a user
Delete Branch "feat/stubs-gen"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This PR implements a simple stubs generator and a dedicate
stubscommandThe 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 thetypingmodule