-
-
Notifications
You must be signed in to change notification settings - Fork 32.7k
Description
Documentation
The Python documentation currently provides function and method signatures for end users to view, such as:
https://docs.python.org/3/library/os.html#os.fsencode
I would like to request the option to display type hints in the documentation to facilitate architecture planning for experienced developers, teaching beginners about how they should expect to interact with a piece of code, or just assist discoverability of the hard work the typeshed team has put into typing Python.
As Python is typing-optional, I would suggest retaining the current documentation as a default, and providing a selector for typed / vs. non-typed (default) versions of the documentation as occurs in documentation for some frontend languages such as TypeScript vs. Javascript.
An example proposal would be to have it be site-wide or function-specific, similar to what Material-UI does with their example code:
In this image, below the Combo Box
component, on the left hand side is a button to select either TS for typescript or JS for javascript code, which renders the example code with the specific details included.
Metadata
Metadata
Assignees
Labels
Projects
Status