Skip to content

Commit

Permalink
Avoid use of implicit optional in decorator factory docs (#14156)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomschr authored Nov 21, 2022
1 parent f8d71f1 commit c660354
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/source/generics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,7 @@ achieved by combining with :py:func:`@overload <typing.overload>`:

.. code-block:: python
from typing import Any, Callable, TypeVar, overload
from typing import Any, Callable, Optional, TypeVar, overload
F = TypeVar('F', bound=Callable[..., Any])
Expand All @@ -736,7 +736,7 @@ achieved by combining with :py:func:`@overload <typing.overload>`:
def atomic(*, savepoint: bool = True) -> Callable[[F], F]: ...
# Implementation
def atomic(__func: Callable[..., Any] = None, *, savepoint: bool = True):
def atomic(__func: Optional[Callable[..., Any]] = None, *, savepoint: bool = True):
def decorator(func: Callable[..., Any]):
... # Code goes here
if __func is not None:
Expand Down

0 comments on commit c660354

Please sign in to comment.