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

Wrapped KindN instances like in List[KindN[...]] do not translate to the correct type #631

Closed
sobolevn opened this issue Sep 25, 2020 · 5 comments · Fixed by #688
Closed
Labels
bug Something isn't working hacktoberfest Hacktoberfest event help wanted Extra attention is needed
Milestone

Comments

@sobolevn
Copy link
Member

We need python/mypy#9001 to be released in mypy to write our custom translator of types.
Because otherwise, we won't be able to support List[KindN[...]] or Maybe[KindN[...]] or any other wrapped KindN instances.

I won't say that it is a blocker. But a major bug for us right now.

@sobolevn sobolevn added the bug Something isn't working label Sep 25, 2020
@sobolevn
Copy link
Member Author

Related #391

@sobolevn
Copy link
Member Author

It would be awesome to know mypy release cycle.

@sobolevn
Copy link
Member Author

It is now released in 0.790

@sobolevn
Copy link
Member Author

So, the plan is:

  1. @kinded and Kinded can be now applied to any callable
  2. That has KindN at least somewhere in the return type
  3. If not, we can raise an error from the plugin
  4. We need to change our transformation function to use TypeTranslator
  5. That will change KindN[_Instance, _First, _Second, _Third] into _Instance[ _First, _Second, _Third] and keep the other structure!

So,

  • List[KindN[_Instance, _First, _Second, _Third]] will be List[_Instance[ _First, _Second, _Third]]
  • Tuple[KindN[_Instance, _First, _Second, _Third], KindN[_Instance, _First, _Second, _Third]] will be Tuple[_Instance[ _First, _Second, _Third], _Instance[ _First, _Second, _Third]]
  • Callable[[], List[KindN[_Instance, _First, _Second, _Third]]] will be Callable[[], List[_Instance[ _First, _Second, _Third]]]
  • etc

@sobolevn sobolevn added hacktoberfest Hacktoberfest event help wanted Extra attention is needed labels Oct 14, 2020
@sobolevn
Copy link
Member Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working hacktoberfest Hacktoberfest event help wanted Extra attention is needed
Development

Successfully merging a pull request may close this issue.

1 participant