This PR implements cast-assertion generation. For the moment, only the base type is checked.
It also adds RawStmt and RawExpr to store raw Python ast nodes that are not supported by the checker.
This PR also adds a preamble with some of the builtin Python functions
Finally, it adds a tester for the generator.
Here is a non-exhaustive list of things that still need to be implemented:
Stub generation: generate Python stubs or dummy classes for other type checkers
Constraints: when constraint types are implemented, generate assertions for the constraints
Generic unification: try and resolve generic type parameters given some values or parameters (e.g. to allow calling a bare generic function)
Implicit casts: allow some implicit casts / widening, especially for literal assignments (e.g. time: Second = 1.23)
Unsafe casts: add an unsafe alternative to cast which doesn't produce any runtime assertion, for example to avoid costly operations
This PR implements cast-assertion generation. For the moment, only the base type is checked.
It also adds `RawStmt` and `RawExpr` to store raw Python ast nodes that are not supported by the checker.
This PR also adds a preamble with some of the builtin Python functions
Finally, it adds a tester for the generator.
Here is a non-exhaustive list of things that still need to be implemented:
- Stub generation: generate Python stubs or dummy classes for other type checkers
- Constraints: when constraint types are implemented, generate assertions for the constraints
- Generic unification: try and resolve generic type parameters given some values or parameters (e.g. to allow calling a bare generic function)
- Implicit casts: allow some implicit casts / widening, especially for literal assignments (e.g. `time: Second = 1.23`)
- Unsafe casts: add an unsafe alternative to `cast` which doesn't produce any runtime assertion, for example to avoid costly operations
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 cast-assertion generation. For the moment, only the base type is checked.
It also adds
RawStmtandRawExprto store raw Python ast nodes that are not supported by the checker.This PR also adds a preamble with some of the builtin Python functions
Finally, it adds a tester for the generator.
Here is a non-exhaustive list of things that still need to be implemented:
time: Second = 1.23)castwhich doesn't produce any runtime assertion, for example to avoid costly operations1aff8e574dto2a8b7d559c