I read PEP-593 (Flexible function and variable annotations)

I decided to read PEP-593 (Flexible function and variable annotations) in the flow of a discussion, so make a note of my understanding. Leave it in.

Overview

approach

Example

Numerical (fictitious) annotations in the range 3-10 that are considered characters by ctype.

Annotated[int, ValueRange(3, 10), ctype("char")]

Impressions

def hello(name: Annotated[str, Description("name")],
          message: Annotated[str, Description("Message format")],
          language: Annotated[str, Description("language")] = "ja"
          ) -> Annotated[None, Description("None")]:
    ...

Recommended Posts

I read PEP-593 (Flexible function and variable annotations)
I read PEP-362 (Function Signature Object) Memo
I read PEP 613 (Explicit Type Aliases)
I read PEP 612 (Parameter Specification Variables)
I read PEP 560 (Core support for typing module and generic types)
I read PEP 604 (Complementary syntax for Union []).
I read PEP 618 (Add Optional Length-Checking To zip)
I compared "python dictionary type" and "excel function"
I tried function synthesis and curry with python
I read PEP 584 (Add Union Operators To dict)
I read PEP 614 (Relaxing Grammar Restrictions On Decorators)
I read and implemented the Variants of UKR
I tried to read and save automatically with VOICEROID2 2
I read PEP-544 (Protocols: Structural subtyping (static duck typing)).
I read PEP 585 (Type Hinting Generics In Standard Collections)
I tried to automatically read and save with VOICEROID2