
On Thu, 25 Nov 2021 at 15:16, Stephen J. Turnbull <stephenjturnbull@gmail.com> wrote:
Executive summary:
The typing-suspicious crowd has a valid complaint about PEPs 563 and 649, but it's not that they weren't warned.
Christopher Barker writes:
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")
Not a PEP proponent (or even a typing user), but I thought this had been made clear long ago. My understanding is that optional, incremental type hints are and have always been considered the primary use case for annotations by the BDFL and AFAICT the SC following the BDFL. If compatibility with typing is an issue, then the burden of implementing that is on the other application. Typing *might* do something to help, but it's not obligated to do so.
This was not my understanding of annotations when they were introduced e.g.: https://www.python.org/dev/peps/pep-3107/#use-cases As I remember it, a decision about the purpose of annotations was *explicitly* not made when they were introduced. It was clear that typing was a major potential use and then at some point (around about the introduction of the typing module) there seemed to be a shift in people's understanding of what annotations were for. Eventually that reached the point that people who were particularly interested in typing had no memory of the fact that the purpose of annotations had not really been specified as being about typing in the first place. It looks to me like Chris has identified in PEP 563 what is potentially the earliest reference (in an accepted PEP) to the idea that non-typing uses of annotations are to be discouraged. -- Oscar