Message322419
In Python the function can have 4 kinds of parameters:
def f(a, b=1, *, c, d=2):
1. a is a required positional-or-keyword parameter.
2. b is an optional positional-or-keyword parameter.
3. c is a required keyword-only parameter.
4. d is an optional keyword-only parameter.
But PyArg_ParseTupleAndKeywords() supports only 3 of them. Keyword-only parameters can only be optional.
PyArg_ParseTupleAndKeywords(args, kwds, "O|O$O", kwlist, &a, &b, &d)
This makes impossible using PyArg_ParseTupleAndKeywords() for haslib.scrypt(). Currently it parses all keyword-only arguments as optional, and checks that they are specified specially, but this does not allow to use the full power of the PyArg_Parse* API. |
|
Date |
User |
Action |
Args |
2018-07-26 13:04:17 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka |
2018-07-26 13:04:17 | serhiy.storchaka | set | messageid: <1532610257.0.0.56676864532.issue34235@psf.upfronthosting.co.za> |
2018-07-26 13:04:16 | serhiy.storchaka | link | issue34235 messages |
2018-07-26 13:04:16 | serhiy.storchaka | create | |
|