class documentation

class CallableType(FunctionLike): (source)

View In Hierarchy

Type of a non-overloaded callable object (such as function).

Class Method deserialize Undocumented
Method __eq__ Undocumented
Method __hash__ Undocumented
Method __init__ Undocumented
Method accept Undocumented
Method argument_by_name Undocumented
Method argument_by_position Undocumented
Method copy_modified Undocumented
Method expand_param_spec Undocumented
Method formal_arguments Return a list of the formal arguments of this callable, ignoring *arg and **kwargs.
Method get_name Undocumented
Method is_generic Undocumented
Method is_type_obj Undocumented
Method kw_arg The formal argument for **kwargs.
Method max_possible_positional_args Returns maximum number of positional arguments this method could possibly accept.
Method param_spec Return ParamSpec if callable can be called with one.
Method serialize Undocumented
Method try_synthesizing_arg_from_kwarg Undocumented
Method try_synthesizing_arg_from_vararg Undocumented
Method type_object Undocumented
Method type_var_ids Undocumented
Method var_arg The formal argument for *args.
Method with_name Return a copy of this type with the specified name.
Method with_unpacked_kwargs Undocumented
Class Variable __slots__ Undocumented
Instance Variable arg_kinds Undocumented
Instance Variable arg_names Undocumented
Instance Variable arg_types Undocumented
Instance Variable bound_args Undocumented
Instance Variable def_extras Undocumented
Instance Variable definition Undocumented
Instance Variable fallback Undocumented
Instance Variable from_concatenate Undocumented
Instance Variable from_type_type Undocumented
Instance Variable implicit Undocumented
Instance Variable is_ellipsis_args Undocumented
Instance Variable min_args Undocumented
Instance Variable name Undocumented
Instance Variable ret_type Undocumented
Instance Variable special_sig Undocumented
Instance Variable type_guard Undocumented
Instance Variable unpack_kwargs Undocumented
Instance Variable variables Undocumented
Property is_kw_arg Does this callable have a **kwargs argument?
Property is_var_arg Does this callable have a *args argument?
Property items Undocumented

Inherited from FunctionLike:

Instance Variable _can_be_false Undocumented

Inherited from Type (via FunctionLike, ProperType):

Method __repr__ Undocumented
Method can_be_false.setter Undocumented
Method can_be_false_default Undocumented
Method can_be_true.setter Undocumented
Method can_be_true_default Undocumented
Method is_singleton_type Undocumented
Property can_be_false Undocumented
Property can_be_true Undocumented
Instance Variable _can_be_true Undocumented

Inherited from Context (via FunctionLike, ProperType, Type):

Method set_line If target is a node, pull line (and column) information into this node. If column is specified, this will override any column information coming from a node.
Instance Variable column Undocumented
Instance Variable end_column Undocumented
Instance Variable end_line Undocumented
Instance Variable line Undocumented
@classmethod
def deserialize(cls, data: JsonDict) -> CallableType: (source)

Undocumented

def __eq__(self, other: object) -> bool: (source)

Undocumented

def __hash__(self) -> int: (source)

Undocumented

def __init__(self, arg_types: Sequence[Type], arg_kinds: list[ArgKind], arg_names: Sequence[str|None], ret_type: Type, fallback: Instance, name: str|None = None, definition: SymbolNode|None = None, variables: Sequence[TypeVarLikeType]|None = None, line: int = -1, column: int = -1, is_ellipsis_args: bool = False, implicit: bool = False, special_sig: str|None = None, from_type_type: bool = False, bound_args: Sequence[Type|None] = (), def_extras: dict[str, Any]|None = None, type_guard: Type|None = None, from_concatenate: bool = False, unpack_kwargs: bool = False): (source)

Undocumented

def accept(self, visitor: TypeVisitor[T]) -> T: (source)

Undocumented

def argument_by_name(self, name: str|None) -> FormalArgument|None: (source)

Undocumented

def argument_by_position(self, position: int|None) -> FormalArgument|None: (source)

Undocumented

def copy_modified(self: CT, arg_types: Bogus[Sequence[Type]] = _dummy, arg_kinds: Bogus[list[ArgKind]] = _dummy, arg_names: Bogus[list[str|None]] = _dummy, ret_type: Bogus[Type] = _dummy, fallback: Bogus[Instance] = _dummy, name: Bogus[str|None] = _dummy, definition: Bogus[SymbolNode] = _dummy, variables: Bogus[Sequence[TypeVarLikeType]] = _dummy, line: int = _dummy_int, column: int = _dummy_int, is_ellipsis_args: Bogus[bool] = _dummy, implicit: Bogus[bool] = _dummy, special_sig: Bogus[str|None] = _dummy, from_type_type: Bogus[bool] = _dummy, bound_args: Bogus[list[Type|None]] = _dummy, def_extras: Bogus[dict[str, Any]] = _dummy, type_guard: Bogus[Type|None] = _dummy, from_concatenate: Bogus[bool] = _dummy, unpack_kwargs: Bogus[bool] = _dummy) -> CT: (source)

Undocumented

def expand_param_spec(self, c: CallableType|Parameters, no_prefix: bool = False) -> CallableType: (source)

Undocumented

def formal_arguments(self, include_star_args: bool = False) -> list[FormalArgument]: (source)

Return a list of the formal arguments of this callable, ignoring *arg and **kwargs. To handle *args and **kwargs, use the 'callable.var_args' and 'callable.kw_args' fields, if they are not None. If you really want to include star args in the yielded output, set the 'include_star_args' parameter to 'True'.

def get_name(self) -> str|None: (source)

Undocumented

def is_generic(self) -> bool: (source)

Undocumented

def is_type_obj(self) -> bool: (source)

Undocumented

def kw_arg(self) -> FormalArgument|None: (source)

The formal argument for **kwargs.

def max_possible_positional_args(self) -> int: (source)

Returns maximum number of positional arguments this method could possibly accept. This takes into account *arg and **kwargs but excludes keyword-only args.

def param_spec(self) -> ParamSpecType|None: (source)

Return ParamSpec if callable can be called with one. A Callable accepting ParamSpec P args (*args, **kwargs) must have the two final parameters like this: *args: P.args, **kwargs: P.kwargs.

def serialize(self) -> JsonDict: (source)

Undocumented

def try_synthesizing_arg_from_kwarg(self, name: str|None) -> FormalArgument|None: (source)

Undocumented

def try_synthesizing_arg_from_vararg(self, position: int|None) -> FormalArgument|None: (source)

Undocumented

def type_object(self) -> mypy.nodes.TypeInfo: (source)

Undocumented

def type_var_ids(self) -> list[TypeVarId]: (source)

Undocumented

def var_arg(self) -> FormalArgument|None: (source)

The formal argument for *args.

def with_name(self, name: str) -> CallableType: (source)

Return a copy of this type with the specified name.

def with_unpacked_kwargs(self) -> NormalizedCallableType: (source)

Undocumented

__slots__: tuple[str, ...] = (source)

Undocumented

arg_kinds = (source)

Undocumented

arg_names = (source)

Undocumented

arg_types = (source)

Undocumented

bound_args = (source)

Undocumented

def_extras = (source)

Undocumented

definition = (source)

Undocumented

fallback = (source)

Undocumented

from_concatenate = (source)

Undocumented

from_type_type = (source)

Undocumented

implicit = (source)

Undocumented

is_ellipsis_args = (source)

Undocumented

min_args = (source)

Undocumented

Undocumented

ret_type = (source)

Undocumented

special_sig = (source)

Undocumented

type_guard = (source)

Undocumented

unpack_kwargs = (source)

Undocumented

variables = (source)

Undocumented

Does this callable have a **kwargs argument?

Does this callable have a *args argument?