[PYTHON] I read PEP 613 (Explicit Type Aliases)

I've been following python / peps recently to follow PEP updates, but GvR is [PEP 613 (Explicit Type Aliases)](https: / /www.python.org/dev/peps/pep-0613/) said something like putting it in 3.10 (instead of 3.9) so I read it a bit.

I think it’s too late to add to 3.9, but it can be added to typing_extensions, and of course 3.10 is open (the master branch is now 3.10). https://github.com/python/peps/issues/1412#issuecomment-633641359

Overview

approach

Example

In the explicit grammar, it is treated as follows.

#Just a global variable
x = 1
x: int = 1

#Just a global variable
x = int
x: Type[int] = int

#Type alias
x: TypeAlias = int
x: TypeAlias = “MyClass”

Impressions

Recommended Posts

I read PEP 613 (Explicit Type Aliases)
I read PEP 585 (Type Hinting Generics In Standard Collections)
I read PEP 612 (Parameter Specification Variables)
I read PEP 604 (Complementary syntax for Union []).
I read PEP-362 (Function Signature Object) Memo
I read PEP 618 (Add Optional Length-Checking To zip)
I read PEP 584 (Add Union Operators To dict)
I read PEP 614 (Relaxing Grammar Restrictions On Decorators)
I read PEP-593 (Flexible function and variable annotations)
I read PEP-544 (Protocols: Structural subtyping (static duck typing)).
[Translation] PEP 0484 --Type Hints
I read Strang's linear algebra
I read the SHAP paper
I read PEP 560 (Core support for typing module and generic types)