Skip to content

Support generic types in lens #83

@suned

Description

@suned

The lens mypy plugin hook currently doesn't work with generic types, eg in:

from typing import List

[0] | lens(List)[0] << 1  #  error: Unsupported operand types for << ("Lens[List[_T], _T]" and "int")

One possible solution approach might be to add the type variable definitions and types of the generic type to the signature of __call__, __ror__, and __lshift__ of the Lens instance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions