[Python-Dev] Re: Relaxing the annotation syntax

2021-04-18 Thread Alex Hall
What about creating a new syntax for annotating metadata? For example, `type_hint :: metadata` could be equivalent to `Annotated[type_hint, "metadata"]`, and if we wanted type guards to look like TypeScript they could look like this: ``` def is_str_list(val: List[object]) -> bool :: is

[Python-Dev] Re: In support of PEP 649

2021-04-18 Thread Alex Hall
I'd like to chime in with an example of how PEP 563 breaks code that uses dataclasses. I've written a library instant_api (https://github.com/alexmojaki/instant_api) that is heavily inspired by FastAPI but uses dataclasses for complex types instead of pydantic. The example at the beginning of