Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support generic types in lens #83

Open
suned opened this issue Jun 15, 2021 · 0 comments
Open

Support generic types in lens #83

suned opened this issue Jun 15, 2021 · 0 comments
Labels
enhancement New feature or request MyPy

Comments

@suned
Copy link
Owner

suned commented Jun 15, 2021

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.

@suned suned added enhancement New feature or request MyPy labels Aug 10, 2021
@suned suned added this to the Release version 1.0.0 milestone May 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request MyPy
Projects
None yet
Development

No branches or pull requests

1 participant