Author serhiy.storchaka
Recipients serhiy.storchaka
Date 2018-07-26.13:04:16
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1532610257.0.0.56676864532.issue34235@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2018-07-26 13:04:17serhiy.storchakasetrecipients: + serhiy.storchaka
2018-07-26 13:04:17serhiy.storchakasetmessageid: <1532610257.0.0.56676864532.issue34235@psf.upfronthosting.co.za>
2018-07-26 13:04:16serhiy.storchakalinkissue34235 messages
2018-07-26 13:04:16serhiy.storchakacreate