
    xKgg                     V    d dl Z d dlZd dlmZ  G d dej                        Zd Zd Zy)    N)_dynfuncc                   ^    e Zd ZdZdZ ej                         Zed        Z	d Z
d Zd Zd Zy)	Environmentz~Stores globals and constant pyobjects for runtime.

    It is often needed to convert b/w nopython objects and pyobjects.
    )env_name__weakref__c                     	 | j                   |j                     S # t        $ rE  | |j                               }|j                  |_        || j                   |j                  <   |cY S w xY wN)_memor   KeyErrorlookup_globals)clsfndescinsts      Z/home/alanp/www/video.onchill/myenv/lib/python3.12/site-packages/numba/core/environment.pyfrom_fndesczEnvironment.from_fndesc   s^    	99V__-- 	v,,./D"OODM)-CIIfoo&K		s    AA)(A)c                 $    d| j                   v}| S N__name__)globals)selfis_dyns     r   	can_cachezEnvironment.can_cache   s    4<</z    c                 r    t         | j                  j                  d      | j                  | j                  ffS r   )_rebuild_envr   getconstsr   r   s    r   
__reduce__zEnvironment.__reduce__    s4    LLZ(KKMM
 
 	
r   c                      y r	    r   s    r   __del__zEnvironment.__del__'   s    r   c                 "    d| j                   dS )Nz<Environment z >r   r   s    r   __repr__zEnvironment.__repr__*   s    t}}/r22r   N)r   
__module____qualname____doc__	__slots__weakrefWeakValueDictionaryr
   classmethodr   r   r   r"   r%   r!   r   r   r   r      sF     ,I (G'')E 
3r   r   c                     t        |      }||S t        j                  |       }t        |j                        }||j
                  d d  ||_        |t        j                  |<   |S r	   )lookup_environment	importlibimport_moduler   __dict__r   r   r
   )modnamer   r   envmods        r   r   r   .   s]    
X
&C



!
!'
*C
cll
#CCJJqMCL"%KhJr   c                 @    t         j                  j                  |       S )zPReturns the Environment object for the given name;
    or None if not found
    )r   r
   r   r$   s    r   r.   r.   <   s       **r   )r*   r/   numbar   r   r   r.   r!   r   r   <module>r7      s+      $3(&& $3N+r   