Previously, the steering council put out a call for someone to please step forward and help us gather information around type annotations, how they are declared, and to help us understand the problem space. Unfortunately no one came forward, and so we are now putting out a more concrete request of the general typing community to help us make a decision around PEP 484, PEP 563, and PEP 649.
Specificially, what we would like a list of cases where declaring type annotations do not work under (at least) one of the three (proposed) ways of declaring annotations:
- Executed at runtime (PEP 484)
- Strings, ala
from __future__ import annotations
(PEP 563) - Deferred evaluation (PEP 649)
For each edge case, we would like a small code sample and which of the three approaches it doesn’t work for. As an example, the following does not work for PEP 484 due to the lack of support for forward references:
class BinaryTree:
value: Any | None
lhs: BinaryTree | None
rhs: BinaryTree | None
At the end of this, what we would like is to have a list of edge cases that fail for (at least) one of the approaches so we can understand the compromises we would be asking of the community if we were to accept any of them as the default/only solution to declaring type annotations. Once we have such a list we believe we can continue on with our discussions on the topic (although this by no means is meant to suggest it will directly lead to a decision about these PEPs).