Skip to content

Conversation

@zanieb
Copy link
Contributor

@zanieb zanieb commented Jul 12, 2023

Extends #95
Part of #82

Adds parsing of generic type variable definitions for functions.

Supports all type variable definitions e.g.

# TypeVar
def foo[T]():
   pass

# TypeVar with bound
def foo[T: str]():
   pass

# TypeVarTuple
def foo[*Ts]():
   pass

# ParamSpec
def foo[**P]():
   pass

See #95 for more details.

@zanieb zanieb marked this pull request as ready for review July 14, 2023 15:18
@MichaReiser MichaReiser requested a review from youknowone July 14, 2023 16:44
Copy link
Member

@youknowone youknowone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! Thanks a lot for contributing to the new grammar support!

@youknowone youknowone merged commit 6980037 into RustPython:main Jul 14, 2023
zanieb added a commit to astral-sh/RustPython-Parser that referenced this pull request Jul 17, 2023
* Parse type parameters in function definitions
* Add test for combined items
zanieb added a commit to astral-sh/RustPython-Parser that referenced this pull request Jul 17, 2023
* Parse type parameters in function definitions
* Add test for combined items
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants