o
    Td	                     @   s|   d Z ddlmZmZmZ ddlmZmZ edZej	Z	e	dej
dd Ze	dejdd Ze	eeejd	d
 ZdS )z7
This file implements print functionality for the CPU.
    )typestypingcgutils)Registryimpl_ret_untracked	printimpl
print_itemc           	      C   sT   |j \}|j}| |}|||}|| || |  }t| ||j	|S )z(
    Print a single constant value.
    )
argsliteral_valueget_python_apiunserializeserialize_objectprint_objectdecrefget_dummy_valuer   return_type)	contextbuildersigr	   tyvalpyapistrobjres r   j/home/ncw/WWW/www-new/content/articles/pi-bbp/venv/lib/python3.10/site-packages/numba/cpython/printimpl.pyprint_item_impl   s   


r   c              	   C   s   |j \}|\}| |}| |}| jr| j||| ||||}|jt	||ddN\}	}
|	 |
| || W d   n1 sHw   Y  |
 | |jd}||}|| || W d   n1 spw   Y  W d   n1 sw   Y  |  }t| ||j|S )z~
    Print a single native value by boxing it in a Python object and
    invoking the Python interpreter's print routine.
    T)likelyNzthe print() function)r	   r   get_env_manager
enable_nrtnrtincreffrom_native_valueif_elser   is_not_nullr   r   insert_const_stringmodulestring_from_stringerr_write_unraisabler   r   r   )r   r   r   r	   r   r   r   env_managerobjif_okif_errorcstrr   r   r   r   r   r   !   s0   




c                 C   s   |  |}| }tt|j|D ]&\}\}}ttj|}	| 	d|	}
|
||g |t
|d k r7|d q|d || |  }t| ||j|S )z 
    A entire print() call.
    r       
)r   
gil_ensure	enumeratezipr	   r   	signaturer   noneget_functionlenprint_stringgil_releaser   r   r   )r   r   r   r	   r   giliargtypeargvalr4   impr   r   r   r   print_varargs_impl@   s   



r?   N)__doc__
numba.corer   r   r   numba.core.imputilsr   r   registrylowerLiteralr   AnyprintVarArgr?   r   r   r   r   <module>   s    



