Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-136616: Improveassert syntax error messages#136653

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
sobolevn wants to merge3 commits intopython:main
base:main
Choose a base branch
Loading
fromsobolevn:issue-136616

Conversation

sobolevn
Copy link
Member

@sobolevnsobolevn commentedJul 14, 2025
edited by bedevere-appbot
Loading

Local testing of positions and code highlight:

Снимок экрана 2025-07-14 в 17 09 57

@sobolevn
Copy link
MemberAuthor

Снимок экрана 2025-07-15 в 11 59 52

Comment on lines 1308 to 1312
| 'assert' expression ',' a=expression '=' b=expression {
RAISE_SYNTAX_ERROR_KNOWN_RANGE(
a, b,
"cannot assign to %s here. Maybe you meant '==' instead of '='?",
_PyPegen_get_expr_name(a)) }
Copy link
Member

Choose a reason for hiding this comment

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

Is the second alternative here needed in reality. If someone's using the second argument here and have a comparison there, maybe they're confused and meant something completely different?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Hm, good question. They might. For example,assert some.method() == other.method(), some == other might be a realiastic case. But, I am open to other opinions :)

@sobolevn
Copy link
MemberAuthor

 trim trailing whitespace.................................................Failed- hook id: trailing-whitespace- exit code: 1- files were modified by this hookFixing Grammar/python.gram

This is a bit annoying. I opened#136680 to fix this.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@pablogsalpablogsalpablogsal left review comments

@lysnikolaoulysnikolaoulysnikolaou left review comments

Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@sobolevn@pablogsal@lysnikolaou

[8]ページ先頭

©2009-2025 Movatter.jp