-
Notifications
You must be signed in to change notification settings - Fork 0
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
functools.partial is not usable #2
Conversation
The position could be fixed by comparing comparing
The keyword-only argument issue makes a fix improbable. |
The first bullet point is actually a lie: >>> from functools import partial
>>> from inspect import signature
>>> def func(a, b):
... pass
>>> for k,v in signature(partial(func, 1)).parameters.items():
... print('%s: %s=%s' % (v.kind, v.name, v.default) )
POSITIONAL_OR_KEYWORD: b=<class 'inspect._empty'> |
Just noticed: This should make it possibe to create keyword only versions on python3. |
I think, a valid solution is to make all |
Note, not merging this yet, since |
functools.partial is not usable
In most cases, the signature of a
functools.partial
can not be used byASTorator
: arguments with default values arepresent in the signature - even if they were bound as positional arguments (which cannot be reinserted at call time)Example: