Skip to content

Support for typing and dataclass fields #115

@waszil

Description

@waszil

Hi, great package!

I have one problem: automodapi seems to ignore dataclass fields if they are initialized with the field method or annotated with a typing type:

from dataclasses import dataclass
from typing import Optional, List

@dataclass
class MyClass:
    """description"""
    #: this is ok
    ok: int = 0
    #: this does not get generated
    notok: Optional[int] = None
    #: this does not get generated either
    foo: List[int] = field(default_factory=list)

Is there a solution for this?
Thanks!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions