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

NotImplementedError: Predefining a positional-only argument using keyword is not supported #107

Open
smarie opened this issue Jul 4, 2024 · 0 comments

Comments

@smarie
Copy link
Owner

smarie commented Jul 4, 2024

It seems that since python 3.12.4 (or .1, or .2, or .3 but it was not the case in 3.12.0),

def f(a, b, c, /, *, d, **e):
    return a + b + c + d + sum(e)

# it is possible to keyword-partialize a positional-only argument...
fp_ref = functools.partial(f, b=0)

# but 'signature' does not support it !
if sys.version_info < (3, 12, 4):
    signature(fp_ref)   # <--   raises(ValueError) !!!!
else:
    # Now it works !
    assert str(signature(fp_ref)) == "(a, c, /, *, d, **e)"

# On our end, we used to not support it because signature was not supporting it
makefun.partial(f, b=0)  # Raises `NotImplementedError`

Details: raises NotImplementedError: Predefining a positional-only argument using keyword is not supported as in python 3.8.8, 'signature()' does not support such functions and raises a ValueError

We should probably implement it now

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

No branches or pull requests

1 participant