Skip to content

Documenting TypeAlias #10

Answered by pawamoy
patrick91 asked this question in Q&A
Jun 17, 2024 · 1 comments · 7 replies
Discussion options

You must be logged in to vote

Ah, not really! I only want do document it for the API Docs, I don't need/want it to be available as a doc everywhere it is used. I guess this is were things would get ambiguous

Yes that would make things ambiguous indeed 🤔 Unless you annotate the type itself, but this feels really weird:

Parent: Annotated[TypeAlias, Doc("Some doc here")] = Annotated[T, StrawberryParent()]

There's always the solution to add a docstring below the assignment, no?

Parent = Annotated[T, StrawberryParent()]
"""Some doc here."""

Replies: 1 comment 7 replies

Comment options

You must be logged in to vote
7 replies
@pawamoy
Comment options

@patrick91
Comment options

@patrick91
Comment options

@pawamoy
Comment options

Answer selected by patrick91
@patrick91
Comment options

@pawamoy
Comment options

@patrick91
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants