Undocumented
Class |
|
protocol for types that have ``__args__`` |
Class |
|
a descriptor that refers to a callable. |
Class |
|
Undocumented |
Class |
|
a descriptor that refers to a descriptor. |
Class |
|
protocol for generic types. |
Class |
|
a descriptor that refers to a descriptor. |
Class |
|
Undocumented |
Function | de |
return the non-optional type for Optional[], Union[None, ...], x|None, etc. without de-stringifying forward refs. |
Function | de |
Given a type, filter out ``Union`` types that include ``NoneType`` to not include the ``NoneType``. |
Function | de |
Resolve annotations that may be string based into real objects. |
Function | de |
Undocumented |
Function | eval |
Undocumented |
Function | eval |
Undocumented |
Function | expand |
Return a type as a tuple of individual types, expanding for ``Union`` types. |
Function | flatten |
Undocumented |
Function | is |
Undocumented |
Function | is |
Undocumented |
Function | is |
Undocumented |
Function | is |
Undocumented |
Function | is |
Undocumented |
Function | is |
Undocumented |
Function | is |
return True if the given type has an __origin__ with the given name and optional module. |
Function | is |
return True if the given type has an __origin__ that shares a base with the given class |
Function | is |
Undocumented |
Function | is |
Undocumented |
Function | make |
Make a Union type. |
Function | resolve |
Undocumented |
Variable |
|
Undocumented |
Function | _copy |
Undocumented |
Function | _get |
Undocumented |
Type Variable | _DESC |
Undocumented |
Type Variable | _ |
Undocumented |
Type Variable | _FN |
Undocumented |
Type Variable | _KT |
Undocumented |
Type Variable | _ |
Undocumented |
Type Variable | _ |
Undocumented |
Type Variable | _T |
Undocumented |
Type Variable | _VT |
Undocumented |
Type Variable | _ |
Undocumented |
Type Alias | _ |
Undocumented |
Variable | _ |
Undocumented |
return the non-optional type for Optional[], Union[None, ...], x|None, etc. without de-stringifying forward refs. unfortunately this seems to require lots of hardcoded heuristics
Given a type, filter out ``Union`` types that include ``NoneType`` to not include the ``NoneType``.
Type[ Any]
, annotation: _AnnotationScanType
, originating_module: str
, locals_: Mapping[ str, Any]
, *, str_cleanup_fn: Optional[ Callable[ [ str, str], str]]
= None, include_generic: bool
= False) -> Type[ Any]
:
(source)
¶
Resolve annotations that may be string based into real objects. This is particularly important if a module defines "from __future__ import annotations", as everything inside of __annotations__ is a string. We want to at least have generic containers like ``Mapped``, ``Union``, ``List``, etc.
Type[ Any]
, annotation: ArgsTypeProcotol
, originating_module: str
, locals_: Mapping[ str, Any]
, *, str_cleanup_fn: Optional[ Callable[ [ str, str], str]]
= None) -> Type[ Any]
:
(source)
¶
Undocumented
str
, module_name: str
, *, locals_: Optional[ Mapping[ str, Any]]
= None) -> Any
:
(source)
¶
Undocumented
str
, module_name: str
, *, locals_: Optional[ Mapping[ str, Any]]
= None) -> Any
:
(source)
¶
Undocumented
Type[ Any]
, include_union: bool
= False, discard_none: bool
= False) -> Tuple[ Type[ Any], ...]
:
(source)
¶
Return a type as a tuple of individual types, expanding for ``Union`` types.
Any
, class_obj: Union[ Tuple[ Type[ Any], ...], Type[ Any]]
) -> bool
:
(source)
¶
return True if the given type has an __origin__ that shares a base with the given class
Make a Union type. This is needed by :func:`.de_optionalize_union_types` which removes ``NoneType`` from a ``Union``.
GenericProtocol[ _T]
, elements: Tuple[ _AnnotationScanType, ...]
) -> Type[ _T]
:
(source)
¶
Undocumented