I'm still catching up, but here's one thing that caught my eye.
On Sun, Nov 15, 2020 at 2:04 PM Sebastian Kreft email@example.com wrote:
One point that hasn't been raised is what happens in multithreaded code, as nothing would guarantee that the guard is still met.
Another point not mentioned is whether typeguards will work for async functions.
I think there's nothing for the PEP to say here. In general the inferences of type checkers don't take threading/async into account: it's the same with e.g. isinstance(). The reason is that statically proving anything about threading is much, much harder than the typical "proofs" involved in type checks. Code as simple as ``` if self.x is not None: self.x += 1 ``` could not be proven type-safe in the presence of threads. Same with async functions: `await` can let *arbitrary* other code run.