-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Delete Python 2 specific AST nodes #13254
Conversation
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.
Looks great
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
1 similar comment
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
# b'x', 'x' -> StrExpr | ||
# u'x' -> UnicodeExpr | ||
# BytesExpr is unused | ||
# How mypy uses StrExpr and BytesExpr: |
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.
We could even remove this whole comment, in Python 3 it's pretty self-explanatory.
@@ -339,15 +338,13 @@ def parse_namedtuple_args( | |||
if call.arg_kinds[:2] != [ARG_POS, ARG_POS]: | |||
self.fail(f'Unexpected arguments to "{type_name}()"', call) | |||
return None | |||
if not isinstance(args[0], (StrExpr, BytesExpr, UnicodeExpr)): | |||
if not isinstance(args[0], (StrExpr, BytesExpr)): |
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.
Interesting that we allow bytes names here, but no need to change that in this PR.
Ref #12237
This includes
UnicodeExpr
,BackquoteExpr
,PrintStmt
, andExecStmt
.