-
-
Notifications
You must be signed in to change notification settings - Fork 143
Fix mypy compatibility for curry.partial #2094
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
base: master
Are you sure you want to change the base?
Conversation
| lambda index: checker.accept(exprs[index]), | ||
| ) | ||
|
|
||
| arg_context = checker.argument_infer_context() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, how does this change fix the mypy compat? What even is the problem that we are fixing here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based off of this commit python/mypy@0291ec9,
the infer_constraints_for_callable function was modified to require an additional arg_names parameter. This change, combined with how mypy processes function calls internally, caused the direct use of checker.argument_infer_context() as a parameter to fail
When the context is saved to a local variable first, mypy correctly recognizes it during parameter binding.
a06a7e9 to
efa6e4e
Compare
efa6e4e to
4a40f83
Compare
|
@sobolevn , ready for your review whenever you have time. Thanks so much for the work you do 😃 |
|
Any word on this? |
- Introduced a new test suite for the `partial` function in `typesafety/test_curry/test_partial/test_partial.py` to ensure its correct behavior with various argument types and signatures. - Updated `mypy.ini` to specify Python version and include the necessary plugins for type checking. - Fixed compatibility issues with `curry.partial` and mypy 1.6.1+. - Added a new entry in `CHANGELOG.md` for unreleased bugfixes.
4a40f83 to
311c13a
Compare
d77aacc to
6dbd2d7
Compare
|
Pushed changes so it can be easily merged. @sobolevn can you please review? |
curry.partialcompatibility with mypy 1.6.1+.inference.pyto use a local variable for argument inference context.partialfunctionality intest_partial.py.I have made things!
Checklist
CHANGELOG.mdRelated issues
curry.partial#1711🙏 Please, if you or your company finds
dry-pythonvaluable, help us sustain the project by sponsoring it transparently on https://github.com/sponsors/dry-python. As a thank you, your profile/company logo will be added to our main README which receives hundreds of unique visitors per day.