Larry Hastings <la...@hastings.org> added the comment:

Argument Clinic can currently only generate signatures for functions whose 
signatures can be represented in Python.  This is because the signatures are 
parsed by the inspect module, which in turn uses the ast module to generate a 
parse tree; it then examines the parse tree and uses that to generate the 
Signature object.

(By the time you see a signature of a function using inspect, the signature has 
actually made a round-trip through the ast module, been turned into a Signature 
object, then str() has been run on it to re-generate the text representation 
from scratch.  The fact that it's usually identical to the original text 
signature buried in the function's docstring is a happy accident.)

Changing Argument Clinic to generate signatures with square brackets in them to 
signify optional parameters is insufficient.  You'd also have to upgrade 
inspect to support this new syntax--otherwise there'd be no point.  And *that* 
would be a lot of code.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue29299>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to