Skip to content

Commit f17f52c

Browse files
committed
Fix doc strings
1 parent a18e485 commit f17f52c

File tree

3 files changed

+9
-12
lines changed

3 files changed

+9
-12
lines changed

koans/py/103-easy-mixed-values.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Annotate mixed type-values. There are two-ways to annotate this
22
nos: list[int] = [1, 2.0, 3.5]
33

4-
# Annotate the lis of int to list of better types
4+
# Annotate the list of int to list of better types
55
squares: list[int] = [no * no for no in nos]

koans/py/111-medium-callable-annotate.py

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,12 @@
1+
"""
2+
Koan to learn annotating the callables or functions.
3+
"""
14
import operator
2-
from collections.abc import Callable, Iterable
3-
from typing import TypedDict
4-
5-
6-
class UserData(TypedDict):
7-
user_id: int
8-
is_active: bool
9-
105

116
# Annotate the function arguments
127
# Documentation: https://docs.python.org/3/library/typing.html?highlight=typing#callable
138
# Documentation: https://docs.python.org/3/library/typing.html?highlight=typing#typing.Iterable
14-
def user_sort(
15-
data: Iterable[UserData], func: Callable[[UserData], int]
16-
) -> Iterable[UserData]:
9+
def user_sort(data, func):
1710
return sorted(data, key=func)
1811

1912

koans/py/112-medium-type-as-example.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
"""
2+
Koan to learn type of class when passed as an argument.
3+
"""
4+
15
import json
26
from typing import Any, Type, Union
37

0 commit comments

Comments
 (0)