primes: set[int] = set()
candidate: int = randint(4, domain)
It's just so ugly and redundant.My feeling is that redundant stuff like type hints make programmers create more bugs because they don't see the forest for the trees anymore.
As if you wrapped the driver of a car in so many seat belts that they cannot see the road anymore.