Seeing as how Python 3.12 is now in beta, I feel like RustPython should also work on being able to parse the new syntax introduced in PEP 695, which makes it much easier to type-hint generic functions and types in the language. I ran into this while trying to start writing a custom type checker, and wanted to use rustpython_ast to parse Python 3.12 code that uses this new syntax. Some examples include:
def identity[T](x: T) -> T:
return x
type Point = tuple[float, float]
type MappingOrSequence[T] = Mapping[int, T] | Sequence[T]
class Container[T](Sequence[T]): ...
Python Documentation or reference to CPython source code
Feature
Seeing as how Python 3.12 is now in beta, I feel like RustPython should also work on being able to parse the new syntax introduced in PEP 695, which makes it much easier to type-hint generic functions and types in the language. I ran into this while trying to start writing a custom type checker, and wanted to use
rustpython_ast
to parse Python 3.12 code that uses this new syntax. Some examples include:Python Documentation or reference to CPython source code
type
statement