| 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� � �F � d Z ddlmZ ddlmZ ddlZ G d� de� � ZdS )z: NormalizeIfElse transform early exit in if into if-else. � )� Ancestors)�TransformationNc �. � � e Zd ZdZ� fd�Zd� Zd� Z� xZS )�NormalizeIfElsea�
>>> import gast as ast
>>> from pythran import passmanager, backend
>>> node = ast.parse("""
... def foo(y):
... if y: return 1
... return 2""")
>>> pm = passmanager.PassManager("test")
>>> _, node = pm.apply(NormalizeIfElse, node)
>>> print(pm.dump(backend.Python, node))
def foo(y):
if y:
return 1
else:
return 2
>>> node = ast.parse("""
... def foo(y):
... if y:
... z = y + 1
... if z:
... return 1
... else:
... return 3
... return 2""")
>>> pm = passmanager.PassManager("test")
>>> _, node = pm.apply(NormalizeIfElse, node)
>>> print(pm.dump(backend.Python, node))
def foo(y):
if y:
z = (y + 1)
if z:
return 1
else:
return 3
else:
return 2
c �b �� t t | � � � t � � d S )N)�superr �__init__r )�self� __class__s ��J/usr/lib/python3/dist-packages/pythran/transformations/normalize_ifelse.pyr zNormalizeIfElse.__init__2 s'