Welcome to Typing Specification’s documentation!¶
- Typing Specification
- Basics of the type system
- Type system features
- Using None
- Type aliases
- Callable
- Generics
- User-defined generic types
- Scoping rules for type variables
- Instantiating generic classes and type erasure
- Arbitrary generic types as base classes
- Abstract generic types
- Type variables with an upper bound
- Covariance and contravariance
- Variance Inference
- Forward references
- Union types
- Support for singleton types in unions
- The
Any
type - The
NoReturn
type - The
Never
type - The type of class objects
- Annotating instance and class methods
- Version and platform checking
TYPE_CHECKING
ClassVar
- Protocols
- Function/method overloading
- Literal
- TypedDict
Required
andNotRequired
- The
final
decorator - The
Final
annotation - Annotated
- ParamSpec
- TypeVarTuple
- TypeGuard
Self
- The
dataclass_transform
decorator Unpack
@override
assert_type()
reveal_type()
# type: ignore
commentscast()
NewType
- Interaction with Python features
- Communicating type information
- Syntax alternatives