-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Add basic support for PEP 695 #5842
Conversation
self.unparse_expr(name, precedence::MAX); | ||
for type_param in type_params { | ||
self.unparse_type_param(type_param); | ||
self.p(", ") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to get a little more sophisticated in handling trailing comma, I presume.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check out the self.p_delim(&mut first, ", ");
line in the Stmt::With
case.
bound.as_ref().map_or(false, |value| any_over_expr(value, func)) | ||
} | ||
TypeParam::TypeVarTuple(ast::TypeParamTypeVarTuple { .. }) => { | ||
false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should any_over_expr
visit names?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should visit all expressions, so needs to recurse on anything that might contain an expression.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The names can't contain expressions, they're just containers for a string. It seems like a pain if you were trying to visit parameter names here but I guess we can tackle that with another helper (or as it comes up).
PR Check ResultsBenchmarkLinux
Windows
|
Superseded by #5459 |
Part of #5062
Summary
Adds basic boilerplate support for PEP 695 without the expectation that we will actually do anything with the contents of such expressions.
Bumps our RustPython/Parser fork to get support for PEP 695 as tracked by RustPython/Parser#82
Test Plan