Skip to content

Commit

Permalink
docs: Add example with a simple return value
Browse files Browse the repository at this point in the history
  • Loading branch information
pawamoy committed Feb 7, 2024
1 parent 3aa11a2 commit edef990
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docs/examples/simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ def other_parameters(
"""Showing off other parameters."""


# Documenting returned values, replacing Returns sections:
def return_value() -> Annotated[int, Doc("Returned integer.")]:
"""Showing off return values."""
return 0


# Documenting yielded and received values, replacing Yields and Receives sections:
def generator() -> Generator[
Annotated[int, Doc("Yielded integers.")],
Expand Down

0 comments on commit edef990

Please sign in to comment.