
On Sun, 21 Nov 2021 at 07:50, Christopher Barker <pythonchb@gmail.com> wrote:
TL;DR:
Annotations can be, and are, used for other things than "typing". I just noticed that PEP 563 apparently deprecated those other uses (well, sort of: "uses for annotations incompatible with the aforementioned PEPs should be considered deprecated"), but if the SC is reconsidering PEP 563, then it would be nice to be clear about whether non-typing uses of annotations are indeed deprecated. If not, then the challenge is to come up with a way forward that not only supports both static and dynamic typing, but also other potentially arbitrary use cases.
I agree with the points made in this post. It's becoming harder and harder for people not particularly interested in static typing to simply ignore it, and any use of annotations to affect runtime behaviour is in a weird grey area. And as a library author, I'm now finding that I'm getting requests to add typing to my code "for my users" (i.e., using types is no longer just a choice I make for my project, it's an API design issue). So I too would appreciate clarity on where annotations, and more generally typing, stand as Python language features¹. Paul ¹ In particular, typing features seem to change so rapidly that supporting a wide range of Python versions is a real pain (in practical terms - not getting syntax errors is straightforward, but writing type annotations that work well across versions very definitely isn't, at least for someone who doesn't really care about static typing).