-
-
Notifications
You must be signed in to change notification settings - Fork 110
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
RequiresContext container implementation #226
Conversation
LGTM |
All looks good! |
TODO for later:
|
I would also love to experiment with |
Didn't work. Python type system does not allow this. |
Maybe you need smth like this? def curry(aFunction):
See here: https://bitbucket.org/jason_delaat/pymonad/src/master/pymonad/Reader.py |
@pvldruzhinin sorry, I didn't get your advice. How should this help me with type inference of python objects and callables? |
Yeah, I have no full understanding of the problem. Just tried to find difference between our code and PyMonad implementation. |
Because they are untyped. Let me show where the problem is. Current implementation: class RequiresContext(
BaseContainer,
Generic[_EnvType, _ReturnType],
):
def __init__(
self, inner_value: Callable[[_EnvType], _ReturnType],
) -> None: ... With this annotation When we change the constructor method type to And this is not what we want. |
Ah, i see, thanks for the explanation 👌 |
I would be thrilled to get your feedback, guys!
P.S. For some reason I cannot request a review from @pvldruzhinin and @theLastOfCats, but I do request it!
Closes #225
Closes #216
Closes #230
Closes #231