typeddjango / awesome-python-typing

Collection of awesome Python types, stubs, plugins, and tools to work with them.

Home Page:https://github.com/typeddjango

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Suggest adding to Articles

reorx opened this issue · comments

Below is a personal document I wrote before, might be useful for people who are new to python typing, feel free to take some into the Articles part.


Python Type Hints

Basic Guides

Advanced Guides

PEP 563 -- Postponed Evaluation of Annotations

https://www.python.org/dev/peps/pep-0563/

This PEP describes the support of referencing a type that is yet to defined in the annotation, and how to enabling it by calling from __future__ import annotations in Python after 3.7

In Python before 3.7 (<= 3.6), same thing can be achieved by adding single quote around the type, this is called Forward references in PEP 484.

Literal

Protocol

Generic

@reorx PEPs are 100% should be listed in this doc. Thanks! Can you please add them?