We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Input:
from typing import Union def test1_func(arg: Union[None, str, int]) -> None: return
Resulting documentation: def test1_func(arg: Union[ForwardRef(None), str, int]) ‑> None
def test1_func(arg: Union[ForwardRef(None), str, int]) ‑> None
Expected documentation: def test1_func(arg: Union[None, str, int]) ‑> None
def test1_func(arg: Union[None, str, int]) ‑> None
!pdoc --version pdoc 0.10.0
The text was updated successfully, but these errors were encountered:
Actually, it would be even better (clearer and more concise) if this produced the Python 3.10 syntax:
def test1_func(arg: str | int | None) ‑> None
It seems that pdoc does so some of the time -- maybe only for Optional[simple_type]?
pdoc
Optional[simple_type]
Sorry, something went wrong.
6e8bdfd
Maybe an option to output int | float | None rather than Optional[int | float]? It seems to be the modern trend.
int | float | None
Optional[int | float]
REF: Format Optional as X | None
X | None
115a168
Ref: 6e8bdfd ENH: Improve formatting of Optional, Union and collection.abc types Ref: #395 Thanks @hhoppe
No options—sane defaults. Thanks!
No branches or pull requests
Input:
Resulting documentation:
def test1_func(arg: Union[ForwardRef(None), str, int]) ‑> None
Expected documentation:
def test1_func(arg: Union[None, str, int]) ‑> None
!pdoc --version
pdoc 0.10.0
The text was updated successfully, but these errors were encountered: