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

python>=3.8 func_inspect: allow POSITIONAL_ONLY parameters #1313

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ptrba
Copy link

@ptrba ptrba commented Aug 17, 2022

This PR enables correct caching for functions with positional-only arguments. This breaks compatibility with python3.7. As soon as python3.7 support is replaced by python>=3.8, this can be merged.

Positional only parameters (added in python3.8) are not hashed. This is due to filter_args which handles POSITIONAL_OR_KEYWORD parameters but ignores POSITIONAL_ONLY parameters. Since hashing uses a name-value tuple list, it is possible to treat POSITIONAL_ONLY equivalently to POSITIONAL_OR_KEYWORD parameters.

@codecov
Copy link

codecov bot commented Aug 17, 2022

Codecov Report

Merging #1313 (ae0b915) into master (1fdf308) will decrease coverage by 0.63%.
The diff coverage is 66.66%.

@@            Coverage Diff             @@
##           master    #1313      +/-   ##
==========================================
- Coverage   93.90%   93.27%   -0.64%     
==========================================
  Files          50       50              
  Lines        7270     7272       +2     
==========================================
- Hits         6827     6783      -44     
- Misses        443      489      +46     
Impacted Files Coverage Δ
joblib/test/test_func_inspect.py 90.00% <50.00%> (-0.63%) ⬇️
joblib/func_inspect.py 92.34% <100.00%> (ø)
joblib/test/common.py 67.24% <0.00%> (-10.35%) ⬇️
joblib/pool.py 85.36% <0.00%> (-3.26%) ⬇️
joblib/hashing.py 88.59% <0.00%> (-2.64%) ⬇️
joblib/numpy_pickle_utils.py 91.01% <0.00%> (-2.25%) ⬇️
joblib/backports.py 67.67% <0.00%> (-2.03%) ⬇️
joblib/numpy_pickle.py 97.43% <0.00%> (-1.71%) ⬇️
joblib/parallel.py 94.96% <0.00%> (-1.60%) ⬇️
joblib/logger.py 85.52% <0.00%> (-1.32%) ⬇️
... and 5 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant