| Server IP : 217.160.0.135 / Your IP : 216.73.216.115 Web Server : Apache System : Linux www 6.18.52-i1-ampere #1203 SMP Mon Sep 14 18:29:59 CEST 2026 aarch64 User : sws1074145052 ( 1074145052) PHP Version : 8.3.32 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /lib/python3/dist-packages/pythran/transformations/__pycache__/ |
Upload File : |
�
cR�a} � �F � d Z ddlmZ ddlmZ ddlZ G d� de� � ZdS )z9 ExpandImportAll replaces import * by all their modules. � )�Transformation)�MODULESNc � � e Zd ZdZd� ZdS )�ExpandImportAllaT
Expands all import when '*' detected
>>> import gast as ast
>>> from pythran import passmanager, backend
>>> node = ast.parse("from math import *")
>>> pm = passmanager.PassManager("test")
>>> _, node = pm.apply(ExpandImportAll, node)
>>> print(pm.dump(backend.Python, node))
from math import acos, acosh, asin, asinh, atan, atan2, atanh, ceil, copysign, cos, cosh, degrees, e, erf, erfc, exp, expm1, fabs, factorial, floor, fmod, frexp, gamma, hypot, isinf, isnan, ldexp, lgamma, log, log10, log1p, modf, pi, pow, radians, sin, sinh, sqrt, tan, tanh, trunc
c �� � |j D ]n}|j dk rad| _ |j � � � |j � d� t t |j � � D � � � � �o|S )N�*Tc 3 �@ K � | ]}t j |d � � V � �d S )N)�ast�alias)�.0�fnames �K/usr/lib/python3/dist-packages/pythran/transformations/expand_import_all.py� <genexpr>z3ExpandImportAll.visit_ImportFrom.<locals>.<genexpr> sJ � � � � "M� "M�&+� #&�)�E�4�"8�"8� "M� "M� "M� "M� "M� "M� )�names�name�update�pop�extend�sortedr �module)�self�noder s r �visit_ImportFromz ExpandImportAll.visit_ImportFrom s� � ��Z� M� M�E��z�S� � �"����
��� � � ��
�!�!� "M� "M�/5�g�d�k�6J�/K�/K�"M� "M� "M� M� M� M���r N)�__name__�
__module__�__qualname__�__doc__r � r r r r s- � � � � � �
�
�� � � � r r )r �pythran.passmanagerr �pythran.tablesr �gastr
r r r r �<module>r# so �� ?� ?� .� .� .� .� .� .� "� "� "� "� "� "� � � � �� � � � �n� � � � � r