module documentation

Base value for abstract classes. Unless forced to by a circular dependency, don't import BaseValue directly from this module; use the alias in abstract.py instead.

Class BaseValue A single abstract value such as a type or function signature.
Function _compute_template Compute the precedence list of template parameters according to C3.
Function _get_template Get the value's class template.
def _compute_template(val: Any): (source)

Compute the precedence list of template parameters according to C3. 1. For the base class list, if it contains `typing.Generic`, then all the type parameters should be provided. That means we don't need to parse extra base class and then we can get all the type parameters. 2. If there is no `typing.Generic`, parse the precedence list according to C3 based on all the base classes. 3. If `typing.Generic` exists, it must contain at least one type parameters. And there is at most one `typing.Generic` in the base classes. Report error if the check fails. Args: val: The abstract.BaseValue to compute a template for. Returns: parsed type parameters Raises: GenericTypeError: if the type annotation for generic type is incorrect

def _get_template(val: Any): (source)

Get the value's class template.