Skip to content

Commit c660354

Browse files
authored
Avoid use of implicit optional in decorator factory docs (#14156)
1 parent f8d71f1 commit c660354

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/source/generics.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -724,7 +724,7 @@ achieved by combining with :py:func:`@overload <typing.overload>`:
724724

725725
.. code-block:: python
726726
727-
from typing import Any, Callable, TypeVar, overload
727+
from typing import Any, Callable, Optional, TypeVar, overload
728728
729729
F = TypeVar('F', bound=Callable[..., Any])
730730
@@ -736,7 +736,7 @@ achieved by combining with :py:func:`@overload <typing.overload>`:
736736
def atomic(*, savepoint: bool = True) -> Callable[[F], F]: ...
737737
738738
# Implementation
739-
def atomic(__func: Callable[..., Any] = None, *, savepoint: bool = True):
739+
def atomic(__func: Optional[Callable[..., Any]] = None, *, savepoint: bool = True):
740740
def decorator(func: Callable[..., Any]):
741741
... # Code goes here
742742
if __func is not None:

0 commit comments

Comments
 (0)