-
-
Notifications
You must be signed in to change notification settings - Fork 143
Support PEP 484 type hints #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Would you be interested in doing a pull request for that? You would need to
|
@kernc Sorry, I had entirely missed you replied here. Yes, obviously I'm pretty interested in writing the code for this ^.^ |
@nbraud do you plan on submitting a PR with your commit? |
This is not done. Text template doesn't look into config.mako nor does it print types by default. I'll see what I can do about that and about hyperlinking documented types in HTML output. |
Hyperlinked types testable with: pdoc --html -c show_type_annotations=True your_module |
Types are not showing up on my project. Fresh Edit: didn't read the previous comment. Adding |
After some more testing I've seen it works pretty well, nice! I have a couple of suggestions:
|
@DaniGuardiola, care to open a new issue for missing variable/property annotations? |
Expected Behavior
When generating doc for a package that is annotated with PEP 484 type hints, I would expect the type hints to be present in the documentation.
For example, the following definition
results in the type hints being available in the REPL's
help()
:and it should well as be present in the pdoc-generated documents:
Actual Behavior
pdoc
ignores the type-hints:Type hints document the expected types of parameters and return values. As such, they convey a lot of information for the documentation's user, when present.
See PEP 484 for a discussion of type hints.
Steps to Reproduce
Generate documentation for a module that uses type hints
Additional info
The text was updated successfully, but these errors were encountered: