
    \jU
                        d Z ddlmZ ddlmZ ddl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
          Z	 	 d(d)dZ	 	 d*d+d&Zd'S ),z&Utilities for type argument inference.    )annotations)Sequence)Final)
SUBTYPE_OFSUPERTYPE_OFinfer_constraintsinfer_constraints_for_callable)ArgKind)solve_constraints)CallableTypeInstanceTypeTypeVarLikeTypec                      e Zd ZdZd	dZ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
    mapping_typer   iterable_typereturnNonec                "    || _         || _        d S )N)r   r   )selfr   r   s      N/var/www/app.qaans.com/backend/venv/lib/python3.11/site-packages/mypy/infer.py__init__zArgumentInferContext.__init__   s    #/$1    N)r   r   r   r   r   r   )__name__
__module____qualname____doc__r    r   r   r   r      s2         2 2 2 2 2 2r   r   TFcallee_typer   	arg_typesSequence[Type | None]	arg_kindslist[ArgKind]	arg_namesSequence[str | None] | Noneformal_to_actuallist[list[int]]contextstrictboolallow_polymorphicr   /tuple[list[Type | None], list[TypeVarLikeType]]c                \    t          | |||||          }| 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   )
r    r!   r#   r%   r'   r)   r*   r,   constraints	type_varss
             r   infer_function_type_argumentsr2   "   s@    0 1Y	96F K
 %IYV=NOOOr   r1   Sequence[TypeVarLikeType]templater   actualis_supertypeskip_unsatisfiedlist[Type | None]c                p    t          |||rt          nt                    }t          | ||          d         S )N)r7   r   )r   r   r   r   )r1   r4   r5   r6   r7   r0   s         r   infer_type_argumentsr:   C   s;     $Hfl6bllXbccKYFVWWWXYZZr   N)TF)r    r   r!   r"   r#   r$   r%   r&   r'   r(   r)   r   r*   r+   r,   r+   r   r-   )FF)r1   r3   r4   r   r5   r   r6   r+   r7   r+   r   r8   )r   
__future__r   collections.abcr   typingr   mypy.constraintsr   r   r   r	   
mypy.nodesr
   
mypy.solver   
mypy.typesr   r   r   r   r   r2   r:   r   r   r   <module>rB      sH   , , " " " " " " $ $ $ $ $ $                        ( ( ( ( ( ( D D D D D D D D D D D D2 2 2 2 2 2 2 2, #P P P P PJ "
[ 
[ 
[ 
[ 
[ 
[ 
[r   