ó
\K]c           @@ sL   d  d l  m Z m Z d  d l Z d  d l m Z d e f d „  ƒ  YZ d S(   i    (   t   print_functiont   absolute_importN(   t   typest   DataModelManagerc           B@ s;   e  Z d  Z d „  Z d „  Z d „  Z d „  Z d „  Z RS(   sB   Manages mapping of FE types to their corresponding data model
    c         C@ s   i  |  _  t j ƒ  |  _ d  S(   N(   t	   _handlerst   weakreft   WeakKeyDictionaryt   _cache(   t   self(    (    s6   lib/python2.7/site-packages/numba/datamodel/manager.pyt   __init__   s    	c         C@ s)   t  | t j ƒ s t ‚ | |  j | <d S(   sN   Register the datamodel factory corresponding to a frontend-type class
        N(   t
   issubclassR   t   Typet   AssertionErrorR   (   R   t	   fetypeclst   handler(    (    s6   lib/python2.7/site-packages/numba/datamodel/manager.pyt   register   s    c         C@ sT   y |  j  | SWn t k
 r" n X|  j t | ƒ } | |  | ƒ } |  j  | <| S(   sM   Returns the corresponding datamodel given the frontend-type instance
        (   R   t   KeyErrorR   t   type(   R   t   fetypeR   t   model(    (    s6   lib/python2.7/site-packages/numba/datamodel/manager.pyt   lookup   s    c         C@ s   |  j  | ƒ S(   s   Shorthand for lookup()
        (   R   (   R   R   (    (    s6   lib/python2.7/site-packages/numba/datamodel/manager.pyt   __getitem__#   s    c         C@ s   t  ƒ  } |  j j ƒ  | _ | S(   s’   
        Make a copy of the manager.
        Use this to inherit from the default data model and specialize it
        for custom target.
        (   R   R   t   copy(   R   t   dmm(    (    s6   lib/python2.7/site-packages/numba/datamodel/manager.pyR   (   s    	(   t   __name__t
   __module__t   __doc__R	   R   R   R   R   (    (    (    s6   lib/python2.7/site-packages/numba/datamodel/manager.pyR      s   				(   t
   __future__R    R   R   t   numbaR   t   objectR   (    (    (    s6   lib/python2.7/site-packages/numba/datamodel/manager.pyt   <module>   s   