Skip to content

An option to hide attribute initial values #292

Closed

Description

@Maboroshy

I'm writing a library that has limited API exposed to a user. Some of the exposed class attributes may be initially set up by functions that are not part of the exposed API or the values can be changed later during init process. Putting such initial values to documentation is useless and even confusing for a user.

I’d like to have an option to disable rendering of attributes initial values. It would be useful if the option could disable rendering class variables values and attribute values set in __init__ separately.

I've considered using google format docstrings that render to a table/list attribute representation without values but the docstrings are not merged for inherited classes which is crucial for my project.

Activity

  1. added
    feature
    on Sep 12, 2023
  2. pawamoy commented on Sep 13, 2023

    @pawamoy
    Member

    In the meantime, here's a workaround that seems to work with mypy too:

    class A:
        def __init__(self):
            self.a = 0
            
            self.a: int
            """Hello"""
  3. Maboroshy commented on Sep 13, 2023

    @Maboroshy
    Author

    Thanks for a tip! I can live with that while waiting the option implementation.

  4. added
    fund
    insiders
    on Oct 22, 2024
  5. removed
    fund
    on Mar 2, 2025
  6. self-assigned this
    on Jul 9, 2025
  7. removed
    insiders
    on Jul 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

feature

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions