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 <rep...@bugs.python.org>
<http://bugs.python.org/issue20232>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to