tarohi24 / notebooks

What I learned
1 stars 0 forks source link

PEP586 Literal #56

Open tarohi24 opened 3 years ago

tarohi24 commented 3 years ago

See https://www.python.org/dev/peps/pep-0586/#literals-enums-and-forward-references for detail information.

A Literal type indicates the specific values it accepts. For example, argument mode in Python's open() can be expressed by the following type notation:

mode: Literal["r", "w", "a", "x", "r+", "w+", "a+", "x+"]