Skip to content

Type annotations using Callable are not supported #1

@sg495

Description

@sg495

Type hints using Callable cause errors, both with explicit argument list and with ellipsis.

Example error output from tensorsat:

ERROR: Parsing param 'order' type annotation 'str | Callable[[frozenset[int]], SupportsRichComparison] | None', <class 'ValueError'>: Found empty type name at start = 15, stop = 31, annotation[start:stop] = '[frozenset[int]]', annotation = 'str | Callable[[frozenset[int]], SupportsRichComparison] | None'
ERROR: Parsing param 'recipe' type annotation 'Callable[[DiagramBuilder], None]', <class 'ValueError'>: Found empty type name at start = 9, stop = 25, annotation[start:stop] = '[DiagramBuilder]', annotation = 'Callable[[DiagramBuilder], None]'
ERROR: Parsing param 'func' type annotation 'Callable[..., El | Point]', <class 'ValueError'>: Ellipsis found in args, but not in last position,  at start = 9, stop = 24, annotation[start:stop] = '..., El | Point', annotation = 'Callable[..., El | Point]'
ERROR: Parsing return type annotation 'Sequence[Port]', <class 'ValueError'>: Ellipsis found in args, but not in last position,  at start = 9, stop = 24, annotation[start:stop] = '..., El | Point', annotation = 'Callable[..., El | Point]'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions