Sounds like you have Annotated on your mind. :-)

Anyway, at this point it's not clear that annotations will be stringified in 3.10, PEP 563 notwithstanding -- there's a new proposal under discussion, PEP 649.

On Sun, Feb 14, 2021 at 2:22 PM Joseph Perez <joperez@hotmail.fr> wrote:
I completely agree with Paul Bryan as I think PEP 593 `Annotated` should be used for this case.

Concerning `__required_keys__`, the issue about putting information into type annotations is that they need to be evaluated (they will be stringified in 3.10), but their evaluation could fail because of forward reference. That's an issue (using PEP 593 or not).
The `dataclasses` module use regex parsing to solve this issue, but this solution can be debated. I've thought about a solution that slightly overtake the scope of this PEP: typing module could provide an `_eval_annotations` function that would evaluate only the PEP 593 annotations of a type if it's an `Annotated[...]` form (and return `()` otherwise), leaving the annotated type (which could be a forward ref and thus unevaluatable) unevaluated.
This would allow retrieving `Required` information (if it uses PEP 593) without problem at the class definition.

P.S. One could argue that `ClassVar`, another type modifier, is implemented as a raw type, so it would be coherent to proceed the same way for this PEP, but `ClassVar` was introduced before PEP 593, and in my opinion, `ClassVar` should also evolved to be a PEP 593 annotation, as well as `InitVar`. `dataclasses` module could also benefit of `_eval_annotations` (should it be a public function then?) to avoid regex parsing.

--
--Guido van Rossum (python.org/~guido)