Skip to content

Custom dunder variables and RUF067 #22822

@ntBre

Description

@ntBre

Could you please collaborate on how RUF067 should work with packages such as https://github.com/Erotemic/mkinit, which use dunder variables (e.g., __submodules__, __protected__) to customize the tool's behavior?

A. Is this the official Python convention to strictly forbid all non‑official dunder variables? Is there a strict list of "official" variables?

B. Should Ruff allow all custom dunder variables?

C. Or should Ruff let its users extend an allowlist of variables manually?

Originally posted by @simon-liebehenschel in #22143 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    previewRelated to preview mode featuresruleImplementing 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