diff options
Diffstat (limited to 'tests/roots/test-ext-autodoc/target/preserve_defaults.py')
-rw-r--r-- | tests/roots/test-ext-autodoc/target/preserve_defaults.py | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/roots/test-ext-autodoc/target/preserve_defaults.py b/tests/roots/test-ext-autodoc/target/preserve_defaults.py new file mode 100644 index 0000000..0cc3b4e --- /dev/null +++ b/tests/roots/test-ext-autodoc/target/preserve_defaults.py @@ -0,0 +1,30 @@ +from datetime import datetime +from typing import Any + +CONSTANT = 'foo' +SENTINEL = object() + + +def foo(name: str = CONSTANT, + sentinel: Any = SENTINEL, + now: datetime = datetime.now(), + color: int = 0xFFFFFF, + *, + kwarg1, + kwarg2 = 0xFFFFFF) -> None: + """docstring""" + + +class Class: + """docstring""" + + def meth(self, name: str = CONSTANT, sentinel: Any = SENTINEL, + now: datetime = datetime.now(), color: int = 0xFFFFFF, + *, kwarg1, kwarg2 = 0xFFFFFF) -> None: + """docstring""" + + @classmethod + def clsmeth(cls, name: str = CONSTANT, sentinel: Any = SENTINEL, + now: datetime = datetime.now(), color: int = 0xFFFFFF, + *, kwarg1, kwarg2 = 0xFFFFFF) -> None: + """docstring""" |