o
    ÕtBhæ  ã                   @  s˜   d Z ddlmZ ddlmZmZ ddlmZmZm	Z	m
Z
 ddlmZ ddlmZ ddlmZmZmZmZ G dd	„ d	eƒZ	
d$d%dd„Z	d&d'd!d"„Zd#S )(z&Utilities for type argument inference.é    )Úannotations)Ú
NamedTupleÚSequence)Ú
SUBTYPE_OFÚSUPERTYPE_OFÚinfer_constraintsÚinfer_constraints_for_callable)ÚArgKind)Úsolve_constraints)ÚCallableTypeÚInstanceÚTypeÚ	TypeVarIdc                   @  s"   e Zd ZU dZded< ded< dS )ÚArgumentInferContexta  Type 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__© r   r   úa/var/www/html/riverr-enterprise-integrations-main/venv/lib/python3.10/site-packages/mypy/infer.pyr      s   
 	r   TÚcallee_typer   Ú	arg_typesúSequence[Type | None]Ú	arg_kindsúlist[ArgKind]Úformal_to_actualúlist[list[int]]ÚcontextÚstrictÚboolÚreturnúlist[Type | None]c                 C  s$   t | ||||ƒ}|  ¡ }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   Útype_var_idsr
   )r   r   r   r   r    r!   ÚconstraintsÚ	type_varsr   r   r   Úinfer_function_type_arguments    s
   
ÿr(   Fr%   úlist[TypeVarId]Útemplater   ÚactualÚis_supertypec                 C  s   t |||rtntƒ}t| |ƒS )N)r   r   r   r
   )r%   r*   r+   r,   r&   r   r   r   Úinfer_type_arguments?   s   
r-   N)T)r   r   r   r   r   r   r   r   r    r   r!   r"   r#   r$   )F)
r%   r)   r*   r   r+   r   r,   r"   r#   r$   )r   Ú
__future__r   Útypingr   r   Úmypy.constraintsr   r   r   r   Ú
mypy.nodesr	   Ú
mypy.solver
   Ú
mypy.typesr   r   r   r   r   r(   r-   r   r   r   r   Ú<module>   s    ú ÿ