Skip to content

assert does not have = -> == suggestion #136616

Open
@sobolevn

Description

@sobolevn

Feature or enhancement

Currently when user makes an error with mixing up == and = there's a special error for that:

>>> 1 = 2
  File "<python-input-1>", line 1
    1 = 2
    ^
SyntaxError: cannot assign to literal here. Maybe you meant '==' instead of '='?

But, not when using assert, where we do lots of == operations naturally:

>>> assert 1 = 2
  File "<python-input-0>", line 1
    assert 1 = 2
             ^
SyntaxError: invalid syntax

I will send a PR with the improvement.

Linked PRs

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions