Skip to content

Type hint on ListMixin.list is too strict #2062

Description

@vectro

The type hint on ListMixin.list says that it returns a Union[base.RESTObjectList, List[base.RestObject]] but this is too strict; each concrete subclass of ListMixin will actually return a Sequence[self._obj_cls].

I'm somewhat new to Python type hints but could this be solved by introducing a type variable and connecting it to both _obj_cls and list()?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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