ML i dZddlmZddlmZddlmZddlmZm Z m Z m Z ddl m Z ddlmZddlmZmZmZmZGd d eZ d dd Z d dd Zy )z&Utilities for type argument inference.) annotations)Sequence) NamedTuple) SUBTYPE_OF SUPERTYPE_OFinfer_constraintsinfer_constraints_for_callable)ArgKind)solve_constraints) CallableTypeInstanceTypeTypeVarLikeTypec&eZdZUdZded<ded<y)ArgumentInferContextaType argument inference context. We need this because we pass around ``Mapping`` and ``Iterable`` types. These types are only known by ``TypeChecker`` itself. It is required for ``*`` and ``**`` argument inference. https://github.com/python/mypy/issues/11144 r mapping_type iterable_typeN)__name__ __module__ __qualname____doc____annotations__P/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/mypy/infer.pyrrsrrcVt||||||}|j} t| |||S)a)Infer the type arguments of a generic function. Return an array of lower bound types for the type variables -1 (at index 0), -2 (at index 1), etc. A lower bound is None if a value could not be inferred. Arguments: callee_type: the target generic function arg_types: argument types at the call site (each optional; if None, we are not considering this argument in the current pass) arg_kinds: nodes.ARG_* values for arg_types formal_to_actual: mapping from formal to actual variable indices )r variablesr ) callee_type arg_types arg_kinds arg_namesformal_to_actualcontextstrictallow_polymorphic constraints type_varss rinfer_function_type_argumentsr(!s;01Y 96FK %%I Y V=N OOrcVt|||rtnt}t|||dS)N)skip_unsatisfiedr)rrrr )r'templateactual is_supertyper*r&s rinfer_type_argumentsr.Bs-$HfllXbcK Y FV WXY ZZrN)TF)rr rzSequence[Type | None]r z list[ArgKind]r!zSequence[str | None] | Noner"zlist[list[int]]r#rr$boolr%r/returnz/tuple[list[Type | None], list[TypeVarLikeType]])FF) r'zSequence[TypeVarLikeType]r+rr,rr-r/r*r/r0zlist[Type | None])r __future__rcollections.abcrtypingrmypy.constraintsrrrr mypy.nodesr mypy.solver mypy.typesr r rrrr(r.rrrr8s,"$ (DD : *#PP$PP+ P & P " P PP5PJ" [( [ [  [ [  [  [r