-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
technical-presentation/src/presentations/part-1/includes/intro.md
Lines 73 to 85 in 2347ae8
| @dataclass | |
| class Apple: | |
| name: str | |
| def grow() -> List[Apple]: | |
| apples = [Apple("a"), | |
| Apple("b")] | |
| for b in apples: | |
| print(f"Apple: {b.name}") | |
I personally like this example very much, after 1 year of rust I would write my python code in this way. But for a python programmer or from other OOP, I believe they will be struggle about this. I believe 9 of 10 python programmer will come up with a Tree class and inherit it to get a AppleTree and make grow a method of Tree. Life sucks..
You may have good idea how to present it, looking forward to hear it!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels