[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: <[Python-Dev] Use more Argument Clinic Annotations?

	
  • Next message (by thread): [Python-Dev] Use more Argument Clinic Annotations?
  • Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

  • More information about the Python-Dev mailing list

    Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

    Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant