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
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
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