Skip to content

Type hint incorrectly suggests Dict is accepted as data parameter #26

@ferchaugupta

Description

@ferchaugupta

The markdown_table.init() method has a misleading type hint for the data parameter:

data: Union[List[Dict], Dict]

However, the validation logic immediately rejects any Dict input:

if not isinstance(data, list) or not all(isinstance(elem, dict) for elem in data):
    raise ValueError("data is not of type list or elements are not of type dict")

The type hint should accurately reflect that only List[Dict] is accepted.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions