o
    8Î®c|  ã                   @   sx   d Z ddlZddlmZ edƒZejejejej	dœZ
eejejejiZejee< ejee< dd„ Zdd	„ Zd
d„ ZdS )z4
Typing support for the buffer protocol (PEP 3118).
é    N)ÚtypesÚbBhHiIlLqQnN)ÚfÚdÚZfÚZdc                 C   s^   | t v rd|d f }|  ¡ rd| }t |¡S zt|  d¡ W S  ty.   td| f ƒ‚w )zh
    Return the Numba type for an item with format string *fmt* and size
    *itemsize* (in bytes).
    zint%dé   Úuú=zunsupported PEP 3118 format %r)Ú_pep3118_int_typesÚisupperr   ÚIntegerÚ_pep3118_scalar_mapÚlstripÚKeyErrorÚ
ValueError)ÚfmtÚitemsizeÚname© r   úA/tmp/pip-target-vg8gfxp4/lib/python/numba/core/typing/bufproto.pyÚdecode_pep3118_format   s   
ÿr   c                 C   s$   zt |  W S  ty   tj Y S w )zF
    Get the Numba type class for buffer-compatible Python *typ*.
    )Ú	_type_mapr   r   ÚBuffer)Útypr   r   r   Úget_type_class1   s
   

þr   c                 C   s   | j rdS | jr
dS dS )z5
    Infer layout of the given memoryview *val*.
    ÚCÚFÚA)Úc_contiguousÚf_contiguous)Úvalr   r   r   Úinfer_layout=   s
   
ÿþr"   )Ú__doc__ÚarrayÚ
numba.corer   Úsetr   Úfloat32Úfloat64Ú	complex64Ú
complex128r   Ú	bytearrayÚ	ByteArrayÚPyArrayr   Ú
MemoryViewÚ
memoryviewÚBytesÚbytesr   r   r"   r   r   r   r   Ú<module>   s"    üþ

