| Server IP : 217.160.0.135 / Your IP : 216.73.217.25 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�
� �N � d Z ddlmZ ddlmZmZmZ ddlZ G d� de� � Z dS )zF FalsePolymorphism try to rename variable to avoid false polymorphism.� )�Transformation)�DefUseChains�UseDefChains�IdentifiersNc �( � � e Zd ZdZ� fd�Zd� Z� xZS )�FalsePolymorphisma�
Rename variable when possible to avoid false polymorphism.
>>> import gast as ast
>>> from pythran import passmanager, backend
>>> node = ast.parse("def foo(): a = 12; a = 'babar'")
>>> pm = passmanager.PassManager("test")
>>> _, node = pm.apply(FalsePolymorphism, node)
>>> print(pm.dump(backend.Python, node))
def foo():
a = 12
a_ = 'babar'
c �n �� t t | � � � t t � � d S �N)�superr �__init__r r )�self� __class__s ��L/usr/lib/python3/dist-packages/pythran/transformations/false_polymorphism.pyr zFalsePolymorphism.__init__ s* �� �
���&�&�/�/��l�K�K�K�K�K� c � � | � t |� � }| j j | D ]:} |� |� � � � � �+# t $ r Y �7w xY wt � � }| j j | D �]u}||v r�t � � }|g}|r�|� � � }||v r�|� � � |� � � k r�F|� |� � |�
� � D ]}|� |� � �d� | j �
|j g � � D � � } |� | � � |��|� |� � |� � � }
|
}||v r |dz
}||v � |� |� � ||
k r��6d| _ |D ]5}|j }
t# |
t$ j � � r|
j |
k r||
_ �6��w|S )Nc 3 �X K � | ]%}t |j t j � � �!|V � �&d S r
)�
isinstance�node�ast�Name)�.0�ds r � <genexpr>z6FalsePolymorphism.visit_FunctionDef.<locals>.<genexpr><