B
      ›\D  ã               @   s@   d dl mZmZmZ d dlmZmZ dd„ Zdd„ Zdd„ Z	d	S )
é    )Úprint_functionÚdivisionÚabsolute_import)Ú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   ú-lib/python3.7/site-packages/numba/sigutils.pyÚis_signature   s    r   c             C   s   t | i tjƒS )N)Ú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|||ƒ x|D ]}||ƒ q‚W ||fS )z¾
    From *sig* (a signature specification), return a ``(return_type, args)``
    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   Z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   Zparsedr   r   r   r   r   r   r   Únormalize_signature   s     



r   N)
Z
__future__r   r   r   Znumbar   r   r   r   r   r   r   r   r   Ú<module>   s   