Designation of a Python type.
This enum is used to handle advanced types, such as types with generics.
Display implementation can be used to convert to the type hint notation (e.g.
typing.Any, which represents any possible value (unknown type).
typing.NoReturn, which represents functions that never return (they can still panic / throw, similar to
never in Rust).
The first argument represents the parameters of the callable:
Someof a vector of types to represent the signature,
Noneif the signature is unknown (allows any number of arguments with type
The second argument represents the return type.
The argument represents the contents of the tuple:
Someof a vector of types to represent the accepted types,
Someof an empty vector for the empty tuple,
Noneif the number and type of accepted values is unknown.
If the number of accepted values is unknown, but their type is, use
Use this variant to represent a tuple of unknown size but of known types.
If the type is unknown, or if the number of elements is known, use
A Python class.
Returns the module in which a type is declared.
None if the type is declared in the current module.
Returns the name of a type.
The name of a type is the part of the hint that is not generic (e.g.
List instead of
Convenience factory for non-generic builtins (e.g.
othervalues to be equal, and is used by
!=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Auto Trait Implementations§
trueif they are equal.
Returns the argument unchanged.