You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
defidentity[T](x: T) ->T:
returnx
type Point=tuple[float, float]
type MappingOrSequence[T] =Mapping[int, T] |Sequence[T]
classContainer[T](Sequence[T]): ...
Python Documentation or reference to CPython source code
Activity
zanieb commentedon Jul 10, 2023
I'll be working on this for use in Ruff — I expect my changes will land in a pull request here.
Add parsing of type alias statements i.e. the `type` keyword (#97)
Add parsing of type alias statements i.e. the `type` keyword (RustPyt…
Add parsing of type alias statements i.e. the `type` keyword (RustPyt…