ó
\K]c           @   s9   d  Z  d d l m Z d d l m Z e d „  ƒ Z d S(   s™   
This file provides internal compiler utilities that support certain special
operations with tuple and workarounds for limitations enforced in userland.
iÿÿÿÿ(   t   alloca_once(   t	   intrinsicc         C   s(   d „  } | | | | j  ƒ } | | f S(   s  Return a copy of the tuple with item at *idx* replaced with *val*.

    Operation: ``out = tup[:idx] + (val,) + tup[idx + 1:]

    **Warning**

    - No boundchecking.
    - The dtype of the tuple cannot be changed.
      *val* is always cast to the existing dtype of the tuple.
    c   	      S   su   | \ } } } t  | | j ƒ } | j | | ƒ | j | | j d ƒ | g d t ƒ} | j | | ƒ | j | ƒ S(   Ni    t   inbounds(   R    t   typet   storet   gept   Truet   load(	   t   contextt   buildert	   signaturet   argst   tupt   idxt   valt   stackt   offptr(    (    s1   lib/python2.7/site-packages/numba/unsafe/tuple.pyt   codegen   s    '(   t   dtype(   t	   typingctxR   R   R   R   t   sig(    (    s1   lib/python2.7/site-packages/numba/unsafe/tuple.pyt   tuple_setitem
   s    		N(   t   __doc__t   numba.cgutilsR    t   numba.extendingR   R   (    (    (    s1   lib/python2.7/site-packages/numba/unsafe/tuple.pyt   <module>   s   