| Server IP : 217.160.0.135 / Your IP : 216.73.217.85 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 : /usr/lib/python3/dist-packages/pythran/analyses/__pycache__/ |
Upload File : |
�
cR�ag � �F � d Z ddlmZ ddlmZ ddlZ G d� de� � ZdS )z'
Locals computes the value of locals()
� )�ModuleAnalysisNc � � � e Zd ZdZ� fd�Z� fd�Zd� Zd� Zd� Zd� Z d� Z
d � Zd
� Zd� Z
eZeZeZeZeZeZeZeZeZeZeZeZeZ� xZS )�Localsa�
Statically compute the value of locals() before each statement
Yields a dictionary binding every node to the set of variable names defined
*before* this node.
Following snippet illustrates its behavior:
>>> import gast as ast
>>> from pythran import passmanager
>>> pm = passmanager.PassManager('test')
>>> code = '''
... def b(n):
... m = n + 1
... def b(n):
... return n + 1
... return b(m)'''
>>> tree = ast.parse(code)
>>> l = pm.gather(Locals, tree)
>>> sorted(l[tree.body[0].body[0]])
['n']
>>> sorted(l[tree.body[0].body[1]])
['b', 'm', 'n']
c � �� t � � | _ t � � | _ d| _ t t | � � � � � d S )Nr )�dict�result�set�locals�nesting�superr �__init__)�self� __class__s ��B/usr/lib/python3/dist-packages/pythran/analyses/locals_analysis.pyr
zLocals.__init__$ sB �� ��f�f����e�e������
�f�d���$�$�&�&�&�&�&� c � �� t t | � � � |� � || j vr| j | j | j |<