Skip to content

Commit

Permalink
Qdd alternative solution in advanced-forward challenge
Browse files Browse the repository at this point in the history
"from __future__ import annotations"
  • Loading branch information
LoicRiegel authored Oct 27, 2024
1 parent 6f4a7ea commit 8deef2d
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions challenges/advanced-forward/solution.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,19 @@ def copy(self) -> "MyClass":
return copied_object


# Alternative soltion:
#
# from __future__ import annotations
# class MyClass:
# def __init__(self, x: int) -> None:
# self.x = x
#
# # TODO: Fix the type hints of `copy` to make it type check
# def copy(self) -> MyClass:
# copied_object = MyClass(x=self.x)
# return copied_object


## End of your code ##

from typing import assert_type
Expand Down

0 comments on commit 8deef2d

Please sign in to comment.