U
    ?hM                     @   s,   d dl mZmZ dd Zdd Zdd ZdS )	    )typestypingc                 C   s   t | tttjfS )zi
    Return whether *sig* is a potentially valid signature
    specification (for user-facing APIs).
    )
isinstancestrtupler   	Signature)sig r	   E/var/www/html/venv/lib/python3.8/site-packages/numba/core/sigutils.pyis_signature   s    r   c                 C   s   t | i tjS )z;
    Parameters
    ----------
    signature_str : str
    )evalr   __dict__)Zsignature_strr	   r	   r
   _parse_signature_string   s    r   c                 C   s   t | trt| }n| }t |tr.|d }}n6t |tjrJ|j|j }}ntd| | j	j
|j	j
f dd }|dk	r||| |D ]}|| q||fS )z
    From *sig* (a signature specification), return a ``(args, return_type)``
    tuple, where ``args`` itself is a tuple of types, and ``return_type``
    can be None if not specified.
    NzNinvalid signature: %r (type: %r) evaluates to %r instead of tuple or Signaturec                 S   s   t | tjstd| f d S )Nz;invalid type in signature: expected a type instance, got %r)r   r   Type	TypeError)tyr	   r	   r
   
check_type+   s    z'normalize_signature.<locals>.check_type)r   r   r   r   r   r   argsreturn_typer   	__class____name__)r   parsedr   r   r   r   r	   r	   r
   normalize_signature   s&    


 
r   N)Z
numba.corer   r   r   r   r   r	   r	   r	   r
   <module>   s   
