Skip to content

Use roles :data: and :const: for module-level variables and constants #106892

@serhiy-storchaka

Description

@serhiy-storchaka

Role :data: is purposed for marking a module-level variable. [1] But role :attr: is often used instead in cases like sys.modules. While technically any module-level variable is accessible as an attribute, I think that it would be better to use more special role :data:.

[1] https://www.sphinx-doc.org/en/master/usage/restructuredtext/domains.html#role-py-data

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.11only security fixes3.12only security fixes3.13bugs and security fixesdocsDocumentation in the Doc dirtype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions