Skip to content
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

Merged
merged 2 commits into from
Jul 28, 2022
Merged

Conversation

ilevkivskyi
Copy link
Member

Ref #12237

This includes UnicodeExpr, BackquoteExpr, PrintStmt, and ExecStmt.

Copy link
Collaborator

@hauntsaninja hauntsaninja left a comment

Choose a reason for hiding this comment

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

Looks great

mypy/nodes.py Outdated Show resolved Hide resolved
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
@github-actions

This comment has been minimized.

1 similar comment
@github-actions
Copy link
Contributor

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:
Copy link
Member

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)):
Copy link
Member

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.

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