[issue38333] add type signatures to library function docs

Vedran Čačić report at bugs.python.org
Wed Oct 2 23:02:46 EDT 2019


Vedran Čačić <vedgar at gmail.com> added the comment:

In that case, I'm pretty sure you'd never be able to document almost _any_ function signature. Python is simply not a statically typed language, and we love it because of that.

Ok, go to the list of builtins, and start alphabetically. First is abs. What type does it take, and what type does it return? Again, I'd be completely ok with saying it takes an int, a float, or a complex, and returns either an int or a float. The same as the words in the docs already say. But according to Guido, that's "unacceptable", since abs can also take (and return) a datetime.timedelta, for example.

I am very afraid that if we start doing this, we will lose _many_ useful features that make Python the language it is. It's really not worth it.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue38333>
_______________________________________


More information about the Python-bugs-list mailing list