← Back
Editing: inline_builtins.cpython-311.pyc
� cR�a� � � � d Z ddlmZ ddlmZ ddlmZ ddlmZ ddl m Z ddlmZm Z ddlmZ dd lmZ dd lZ G d� de� � Zd S ) z; Expand some builtins implementation when it is profitable.� )�Aliases)�PureExpressions)�Transformation)�MODULES)�FunctionIntr)�path_to_attr�path_to_node)�PythranSyntaxError)�deepcopyNc �Z � e Zd ZdZd� Zd� Zd� Zd� Zd� Zd� Z d� Z d � Zd � Zd� Z d� Zd � ZdS )�InlineBuiltinsa( Replace some builtins by their bodies. This may trigger some extra optimizations later on! >>> import gast as ast >>> from pythran import passmanager, backend >>> pm = passmanager.PassManager("test") >>> node = ast.parse(''' ... def foo(a): ... return a + 1 ... def bar(b): ... return builtins.map(bar, (1, 2))''') >>> _, node = pm.apply(InlineBuiltins, node) >>> print(pm.dump(backend.Python, node)) def foo(a): return (a + 1) def bar(b): return [bar(1), bar(2)] c �F � t j | t t � � d S �N)r �__init__r r )�selfs �G/usr/lib/python3/dist-packages/pythran/optimizations/inline_builtins.pyr zInlineBuiltins.__init__&