➜

This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

作者 larry
收信人 larry, rhettinger, serhiy.storchaka, vstinner, yselivanov
日期 2019-03-15.18:52:19
SpamBayes Score -1.0
Marked as misclassified 是
Message-id <1552675939.93.0.454101439298.issue29299@roundup.psfhosted.org>
In-reply-to
内容
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.
历史
日期 用户 动作 参数
2019-03-15 18:52:19larry修改recipients: + larry, rhettinger, vstinner, serhiy.storchaka, yselivanov
2019-03-15 18:52:19larry修改messageid: <1552675939.93.0.454101439298.issue29299@roundup.psfhosted.org>
2019-03-15 18:52:19larry链接issue29299 messages
2019-03-15 18:52:19larry创建