Skip to content

Commit 3126219

Browse files
committed
Add alternative solution in advanced-forward challenge
"from __future__ import annotations"
1 parent 6f4a7ea commit 3126219

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

challenges/advanced-forward/solution.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,19 @@ def copy(self) -> "MyClass":
88
return copied_object
99

1010

11+
# Alternative soltion:
12+
#
13+
# from __future__ import annotations
14+
# class MyClass:
15+
# def __init__(self, x: int) -> None:
16+
# self.x = x
17+
#
18+
# # TODO: Fix the type hints of `copy` to make it type check
19+
# def copy(self) -> MyClass:
20+
# copied_object = MyClass(x=self.x)
21+
# return copied_object
22+
23+
1124
## End of your code ##
1225

1326
from typing import assert_type

0 commit comments

Comments
 (0)