[Python-Dev] Use more Argument Clinic Annotations?

Jelle Zijlstra jelle.zijlstra at gmail.com
Sun Mar 25 17:58:44 EDT 2018


2018-03-25 5:36 GMT-07:00 Dave Halter <davidhalter88 at gmail.com>:

> Hi Python Devs
>
> I recently started testing Jedi with Python 3.7. Some tests broke. I
> realized that one of the things that changed in 3.7 was the use of
> argument clinic in methods like str.replace.
>
> The issue is that the text signature doesn't contain a return annotation.
>
> >>> str.replace.__text_signature__
> '($self, old, new, count=-1, /)
>
>
> In Python < 3.7 there was a `S.replace(old, new[, count]) -> str` at
> the top of the __doc__. T
>
> If the __text_signature__ was `'($self, old, new, count=-1, /) -> str`
> a lot of tools would be able to have the information again.
>
> Is this intentional or was this just forgotten? I'd like to note that
> this information is insanely helpful (at least for Jedi) to pick up
> type information. I really hope this information can make it back into
> 3.7, since it was there in earlier versions.
>
> If you lack don't have time I might have some. Just give me some
> instructions.
>
> Perhaps you should use https://github.com/python/typeshed/ to get type
information?


> ~ Dave
>
>
> PS: Don't get me wrong, I love argument clinic/inspect.signature and
> am generally in favor of using it everywhere. It helps tools like
> jedi, pycharm and others get accurate information about a builtin
> function.
> _______________________________________________
> Python-Dev mailing list
> Python-Dev at python.org
> https://mail.python.org/mailman/listinfo/python-dev
> Unsubscribe: https://mail.python.org/mailman/options/python-dev/
> jelle.zijlstra%40gmail.com
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20180325/93195deb/attachment.html>


More information about the Python-Dev mailing list