Very interesting. Would you be willing to rework your plugin into a PR for mypy, specifically targeted at functions.partial?

On Fri, Apr 17, 2020 at 01:42 Никита Соболев <n.a.sobolev@gmail.com> wrote:
Hello everyone! 

Recently I was curious about whether it is possible to create a fully typed `functools.partial` version. Because currently only return type is taken into account. 

So, I came up with the mypy plugin to type all the callable parameters during the partial application process and the final call. It works pretty well!

Source: https://github.com/dry-python/returns/blob/master/returns/curry.py#L7
Plugin: https://github.com/dry-python/returns/blob/master/returns/contrib/mypy/_curry.py
Tests: https://github.com/dry-python/returns/tree/master/typesafety/test_curry

I thought that mypy team might be interested in porting this (or similar) solution into the core. I would also be happy to receive any feedback on the code itself or the solution in general.

Thanks a lot for building mypy, it is awesome!

Best,
Nikita Sobolev
https://github.com/sobolevn
_______________________________________________
Typing-sig mailing list -- typing-sig@python.org
To unsubscribe send an email to typing-sig-leave@python.org
https://mail.python.org/mailman3/lists/typing-sig.python.org/
--
--Guido (mobile)