[issue20232] Argument Clinic NULL default falsely implies None acceptability
Larry Hastings
report at bugs.python.org
Wed Jan 15 20:58:37 CET 2014
Larry Hastings added the comment:
One mandate I've given myself for this project:
When a function provides a signature, it must be 100% accurate.
A specific corollary of this:
If you call a function, and for every optional parameter you
explicitly pass it in with its default value from the signature,
the result will be identical with calling the function and not
providing that optional parameter.
So we can't lie here.
You're right that this is a general problem. It's possible for a C function to accept a parameter that is
* positional-or-keyword,
* has a default value, and
* the default value is not publishable as a Python value.
This is impossible in Python. But Clinic only allows you to represent Python-compatible signatures.
In this *specific* case we can dodge the bullet:
/*[clinic input]
SHA1.SHA1
string: object(c_default='NULL') = b''
----------
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue20232>
_______________________________________
More information about the Python-bugs-list
mailing list