ķ
\K]c           @   sĐ   d  Z  d d l Z d d l Z d d l m Z e d  Z i e j d 6e j d 6e j	 d 6e j
 d 6Z i e j e 6e j e j 6Z e j e e <e j d k rą e j e e <n  d
   Z d   Z d   Z d S(   s4   
Typing support for the buffer protocol (PEP 3118).
i˙˙˙˙N(   t   typest   bBhHiIlLqQnNt   ft   dt   Zft   Zdi   c         C   s   |  t  k rC d | d f } |  j   r6 d | } n  t j |  Sy t |  j d  SWn$ t k
 r~ t d |  f   n Xd S(   sh   
    Return the Numba type for an item with format string *fmt* and size
    *itemsize* (in bytes).
    s   int%di   t   ut   =s   unsupported PEP 3118 format %rN(   t   _pep3118_int_typest   isupperR    t   Integert   _pep3118_scalar_mapt   lstript   KeyErrort
   ValueError(   t   fmtt   itemsizet   name(    (    s4   lib/python2.7/site-packages/numba/typing/bufproto.pyt   decode_pep3118_format   s    c         C   s(   y t  |  SWn t k
 r# t j SXd S(   sF   
    Get the Numba type class for buffer-compatible Python *typ*.
    N(   t	   _type_mapR   R    t   Buffer(   t   typ(    (    s4   lib/python2.7/site-packages/numba/typing/bufproto.pyt   get_type_class3   s    c         C   sZ   t  j d k r- |  j r d S|  j r) d Sd S|  j d k rV |  j d |  j k rV d Sd S(   s5   
    Infer layout of the given memoryview *val*.
    i   t   Ct   Ft   Ai   i    (   i   (   t   syst   version_infot   c_contiguoust   f_contiguoust   ndimt   stridesR   (   t   val(    (    s4   lib/python2.7/site-packages/numba/typing/bufproto.pyt   infer_layout?   s    %(   i   (   t   __doc__t   arrayR   t   numbaR    t   setR   t   float32t   float64t	   complex64t
   complex128R   t	   ByteArrayt	   bytearrayt   PyArrayR   t
   MemoryViewt
   memoryviewR   t   Bytest   bytesR   R   R!   (    (    (    s4   lib/python2.7/site-packages/numba/typing/bufproto.pyt   <module>   s$   



		