
    shk                     :    S SK r S SKJr  S SKJr   " S S\5      rg)    N)ChainMap)typesc                   @    \ rS rSrSrSS jrS rS rS rS r	S	 r
S
rg)DataModelManager   zBManages mapping of FE types to their corresponding data model
    Nc                 X    U=(       d    0 U l         [        R                  " 5       U l        g)zx
Parameters
-----------
handlers: Mapping[Type, DataModel] or None
    Optionally provide the initial handlers mapping.
N)	_handlersweakrefWeakKeyDictionary_cache)selfhandlerss     p/Users/tiagomarins/Projetos/claudeai/copy_bank/venv/lib/python3.13/site-packages/numba/core/datamodel/manager.py__init__DataModelManager.__init__   s     "R//1    c                 b    [        U[        R                  5      (       d   eX R                  U'   g)zNRegister the datamodel factory corresponding to a frontend-type class
        N)
issubclassr   Typer	   )r   	fetypeclshandlers      r   registerDataModelManager.register   s'     )UZZ0000$+y!r   c                      U R                   U   $ ! [         a     Of = fU R                  [        U5         nU" X5      =o0R                   U'   U$ )zMReturns the corresponding datamodel given the frontend-type instance
        )r   KeyErrorr	   type)r   fetyper   models       r   lookupDataModelManager.lookup   sU    	;;v&& 		..f.&-d&;;F#s    
c                 $    U R                  U5      $ )zShorthand for lookup()
        )r   )r   r   s     r   __getitem__DataModelManager.__getitem__(   s     {{6""r   c                 H    [        U R                  R                  5       5      $ )zr
Make a copy of the manager.
Use this to inherit from the default data model and specialize it
for custom target.
)r   r	   copy)r   s    r   r%   DataModelManager.copy-   s       3 3 566r   c                 X    [        U R                  UR                  5      n[        U5      $ )a  Create a new DataModelManager by chaining the handlers mapping of
`other_manager` with a fresh handlers mapping.

Any existing and new handlers inserted to `other_manager` will be
visible to the new manager. Any handlers inserted to the new manager
can override existing handlers in `other_manager` without actually
mutating `other_manager`.

Parameters
----------
other_manager: DataModelManager
)r   r	   r   )r   other_managerchaineds      r   chainDataModelManager.chain5   s%     4>>=+B+BC((r   )r   r	   )N)__name__
__module____qualname____firstlineno____doc__r   r   r   r"   r%   r*   __static_attributes__ r   r   r   r      s%    
2,	#
7)r   r   )r
   collectionsr   
numba.corer   objectr   r2   r   r   <module>r6      s       <)v <)r   