Skip to content

Adding docstrings to classes created with make_class #1309

Open
@znichollscr

Description

Hi there, I might have missed something. If I have my apologies.

My question is pretty basic: is there a way to add a docstring to class created with make_class? For example

from attrs import define

@define
class D:
    """
    Docstring
    """

# Prints out the docstring above
print(D.__doc__)

C = make_class("C", ["a", "b"])

# Prints None, which makes it seem like the docstring is unset.
# Is there a way to have the docstring be set when a class is created
# via `make_class`?
print(C.__doc__)

Thanks for any help

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions