| 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/optimizations/__pycache__/ |
Upload File : |
�
cR�a� � �b � d Z ddlmZmZ ddlmZ ddlmZmZ dddddd�Z G d� de� � Z
dS ) zCIterTransformation replaces expressions by iterators when possible.� )�PotentialIterator�Aliases)�Transformation)�path_to_attr�path_to_nodeN))�builtins�list)r �tuple)�numpy�array)r �asarray)r �copyc �$ � e Zd ZdZd� Zd� Zd� ZdS )�IterTransformationa
Replaces expressions by iterators when possible.
>>> import gast as ast
>>> from pythran import passmanager, backend
>>> node = ast.parse('''
... def foo(l):
... return builtins.sum(l)
... def bar(n):
... return foo(builtins.list(n))
... ''')
>>> pm = passmanager.PassManager("test")
>>> _, node = pm.apply(IterTransformation, node)
>>> print(pm.dump(backend.Python, node))
def foo(l):
return builtins.sum(l)
def bar(n):
return foo(n)
c �F � t j | t t � � dS )zGather required information.N)r �__init__r r )�selfs �K/usr/lib/python3/dist-packages/pythran/optimizations/iter_transformation.pyr zIterTransformation.__init__'