KEMBAR78
Delete Python 2 specific AST nodes by ilevkivskyi · Pull Request #13254 · python/mypy · GitHub
Skip to content

Conversation

@ilevkivskyi
Copy link
Member

Ref #12237

This includes UnicodeExpr, BackquoteExpr, PrintStmt, and ExecStmt.

@ilevkivskyi ilevkivskyi requested a review from hauntsaninja July 28, 2022 00:40
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

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.

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