Skip to content

Commit 3811d8c

Browse files
authored
Docs: fix TypeError in code example (#1413)
Fix TypeError of 'class MyProto(Protocol)' TypeError: Too few arguments for typing.Mapping; actual 1, expected 2
1 parent e38affe commit 3811d8c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/source/best_practices.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ Maybe::
8686

8787
class MyProto(Protocol):
8888
def foo(self) -> list[int]: ...
89-
def bar(self) -> Mapping[str]: ...
89+
def bar(self) -> Mapping[str, str]: ...
9090

9191
Avoid union return types, since they require ``isinstance()`` checks.
9292
Use ``Any`` or ``X | Any`` if necessary.

0 commit comments

Comments
 (0)