Skip to content

Parse type parameters in function definitions #96

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 14, 2023

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