That's now valid syntax in Python 3.13
(reddit.com)
There are a few changes that didn't get much attention in the last releases, and one of them is that comprehensions and lambdas can now be used in annotations (the place where you put type hints).
There are a few changes that didn't get much attention in the last releases, and one of them is that comprehensions and lambdas can now be used in annotations (the place where you put type hints).