Skip to content

Add autodata option to remove value but display type info #8209

@marlonjames

Description

@marlonjames

Is your feature request related to a problem? Please describe.
The cocotb project is using the autodata directive to document a global module variable, whose default value is None (and assigned in an initialization function). We would prefer to remove the = None from the documentation but retain the type information that comes from a type hint comment in the source code.
Using the :annotation: option with a blank string removes the None value but also removes the type information.

Describe the solution you'd like
Have an option for removing the value but keeping the type information. Something like the :novalue: option that was renamed to the current :annotation:.

Describe alternatives you've considered
Using the :annotation: option can replicate the type information manually: :annotation: : TypeHint but this is a manual process and dual maintenance when the information is in the source file.

Additional context
PR where this was discussed: cocotb/cocotb#2069

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions