Files
sphinx/tests/roots/test-ext-autodoc/target/pep604.py
T
Takeshi KOMIYA 7318d1dfd4 autodoc: Support type union operator (PEP-604) (refs: #8775)
Upgrade autodoc to support type union operator introduced in
PEP-604. It's available only with python 3.10+.
2021-01-31 23:38:36 +09:00

17 lines
292 B
Python

from __future__ import annotations
attr: int | str #: docstring
def sum(x: int | str, y: int | str) -> int | str:
"""docstring"""
class Foo:
"""docstring"""
attr: int | str #: docstring
def meth(self, x: int | str, y: int | str) -> int | str:
"""docstring"""