[Python-Dev] Use more Argument Clinic Annotations?
Larry Hastings
larry at hastings.org
Sun Mar 25 20:23:32 EDT 2018
On 03/25/2018 09:58 AM, Serhiy Storchaka wrote:
> 25.03.18 19:47, Dave Halter пише:
>> Is there a way though in which the __text_signature__ could contain
>> the information `-> str` or do we need to engineer that first?
>
> There is no such way currently.
Are you sure? I'm pretty sure Argument Clinic signatures support
"return converters", which are emitted in the text signature as a return
annotation. See the section "Using a return converter" in
Doc/howto/clinic.rst.
What appears to be lacking is a "return converter" that handles
strings. I don't know how easy or hard it would be to write one--I
haven't thought about Argument Clinic in years. However, the
DecodeFSDefault() returns a string type, with some extra implied
constraints on the value I think. So my guess is, it wouldn't be too
hard to add a simple "str" return converter.
Cheers,
//arry/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20180325/a0198165/attachment.html>
More information about the Python-Dev
mailing list