A recent anegdote with regards to typing in Python.<p>Let's say you have this code:<p>class Creature:<p><pre><code> def __init__(self, name: str, hp: int, attack: int):
...
def attack(self, other: Creature):
...
</code></pre>
Guess what? Since Creature is not yet defined, your very smart type-checker can't see the "other" parameter. Happened to me in VS Code.<p>That is the problem with features bolted on to a language where they perhaps don't belong. Now, I know that typing helps when you have simple, functional code. So, this code will work:<p>from dataclasses import dataclass<p>@dataclass<p>class Creature:<p><pre><code> name: str
hp: int
attack: int
</code></pre>
def combat_between(attacker: Creature, defender: Creature):
...<p>I was really surprised with this. We need better review in regards to adding additional features that may be broken on certain setups.