Skip to content

__dunder_blunder___ support #4592

@gitpushdashf

Description

@gitpushdashf

Hi, everyone!

I'm not sure if this rule would cover this or not: https://beta.ruff.rs/docs/rules/dunder-function-name/

I made a dunder blunder today, with an extra _. Despite ruff, pyright, and pytest, nothing caught my error. It was for a def __lt__()-type function.

This seems fairly trivial, at first glance, at least compared to other rules. Those extra underscores can really blend in with eachother.

If the dunder-function-name does cover it, maybe it could be documented? Or maybe two separate rules would be ideal?

Anyway, Ruff is an awesome project. I don't know if there's an existing Python tool that does this check.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ruleImplementing or modifying a lint rule

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions