mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Add a new extension `sphinx.ext.autodoc.preserve_defaults`. It preserves the default argument values of function signatures in source code and keep them not evaluated for readability. This is an experimental extension and it will be integrated into autodoc core in Sphinx-4.0.
20 lines
407 B
Python
20 lines
407 B
Python
from datetime import datetime
|
|
from typing import Any
|
|
|
|
CONSTANT = 'foo'
|
|
SENTINEL = object()
|
|
|
|
|
|
def foo(name: str = CONSTANT,
|
|
sentinal: Any = SENTINEL,
|
|
now: datetime = datetime.now()) -> None:
|
|
"""docstring"""
|
|
|
|
|
|
class Class:
|
|
"""docstring"""
|
|
|
|
def meth(self, name: str = CONSTANT, sentinal: Any = SENTINEL,
|
|
now: datetime = datetime.now()) -> None:
|
|
"""docstring"""
|