Skip to content

Commit 3e237d3

Browse files
Update lambda.rst: typos
1 parent f808b7a commit 3e237d3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

docs/guides/lambda.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ you might as well just define a normal function. Let's call that our first worka
3535
The second workaround is equivalent: assigning the lambda to a variable, and annotating
3636
the type of that variable with a Callable.
3737

38-
``f: Callable[[object], object] lambda x: x``
38+
``f: Callable[[object], object] = lambda x: x``
3939

4040
Type comments on function definitions do not actually work on lambda, nor do
41-
normal type comments help (although you can use a type commment on an assignment
41+
normal type comments help (although you can use a type comment on an assignment
4242
to a variable with a lambda, of course; however this will have to be the Callable
4343
syntax and not the function-arrow special one).
4444

@@ -48,8 +48,8 @@ type errors resulting from lambda expressions being deduced as ``Any``.
4848

4949
In conclusion:
5050

51-
1. There is no way to explicitly annotation lambda arguments or return values in the
52-
lmabdas themselves.
51+
1. There is no way to explicitly annotate lambda arguments or return values in the
52+
lambdas themselves.
5353

5454
2. However, static typing rules still apply to lambdas, including type deduction.
5555

0 commit comments

Comments
 (0)