Skip to content

Conversation

@AdrianAcala
Copy link

@AdrianAcala AdrianAcala commented Apr 2, 2025

  • Added a bugfix entry in CHANGELOG for curry.partial compatibility with mypy 1.6.1+.
  • Modified inference.py to use a local variable for argument inference context.
  • Added mypy configuration file and a test for partial functionality in test_partial.py.

I have made things!

Checklist

  • I have double checked that there are no unrelated changes in this pull request (old patches, accidental config files, etc)
  • I have created at least one test case for the changes I have made
  • I have updated the documentation for the changes I have made (since this is just fixing dependency issues, I didn't think a documentation update was necessary)
  • I have added my changes to the CHANGELOG.md

Related issues

🙏 Please, if you or your company finds dry-python valuable, 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.

lambda index: checker.accept(exprs[index]),
)

arg_context = checker.argument_infer_context()
Copy link
Member

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?

Copy link
Author

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.

@AdrianAcala AdrianAcala marked this pull request as draft April 3, 2025 07:17
@AdrianAcala AdrianAcala force-pushed the 1711-fix-mypy-1-6-1 branch 2 times, most recently from a06a7e9 to efa6e4e Compare April 3, 2025 15:09
@AdrianAcala AdrianAcala force-pushed the 1711-fix-mypy-1-6-1 branch from efa6e4e to 4a40f83 Compare April 19, 2025 06:10
@AdrianAcala AdrianAcala marked this pull request as ready for review April 19, 2025 06:11
@AdrianAcala
Copy link
Author

@sobolevn , ready for your review whenever you have time. Thanks so much for the work you do 😃

@syigzaw
Copy link

syigzaw commented Jan 8, 2026

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.
@AdrianAcala AdrianAcala changed the title Update CHANGELOG and fix mypy compatibility for curry.partial Fix mypy compatibility for curry.partial Jan 8, 2026
@AdrianAcala
Copy link
Author

Pushed changes so it can be easily merged. @sobolevn can you please review?

@AdrianAcala AdrianAcala force-pushed the 1711-fix-mypy-1-6-1 branch 2 times, most recently from 82edc0a to bf9eca9 Compare January 9, 2026 16:24
@codecov
Copy link

codecov bot commented Jan 15, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (82ef3ef) to head (94ce486).
⚠️ Report is 451 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##            master     #2094    +/-   ##
==========================================
  Coverage   100.00%   100.00%            
==========================================
  Files           80        81     +1     
  Lines         2485      2593   +108     
  Branches       437        46   -391     
==========================================
+ Hits          2485      2593   +108     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Mypy 1.6.1 fails with returns 0.21.0 on use of curry.partial

3 participants