Skip to content

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

@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

    pFad - Phonifier reborn

    Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

    Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


    Alternative Proxies:

    Alternative Proxy

    pFad Proxy

    pFad v3 Proxy

    pFad v4 Proxy