File: //proc/self/root/opt/alt/python312/lib64/python3.12/test/__pycache__/test_symtable.cpython-312.pyc
�
h�e5, � �z � d Z ddlZddlZdZd� Z G d� dej
� Zedk( r ej � yy)z&
Test the API of the symtable module.
� Na�
import sys
glob = 42
some_var = 12
some_non_assigned_global_var = 11
some_assigned_global_var = 11
class Mine:
instance_var = 24
def a_method(p1, p2):
pass
def spam(a, b, *var, **kw):
global bar
global some_assigned_global_var
some_assigned_global_var = 12
bar = 47
some_var = 10
x = 23
glob
def internal():
return x
def other_internal():
nonlocal some_var
some_var = 3
return some_var
return internal
def foo():
pass
def namespace_test(): pass
def namespace_test(): pass
type Alias = int
type GenericAlias[T] = list[T]
def generic_spam[T](a):
pass
class GenericMine[T: int]:
pass
c �\ � | j � D ] }|j � |k( s�|c S y �N)�get_children�get_name)�block�name�chs �9/opt/alt/python312/lib64/python3.12/test/test_symtable.py�
find_blockr 7 s- � �� � �"� ��
�;�;�=�D� ��I�� c �� � e Zd Z ej edd� Z eed� Z eed� Z eed� Z ee d� Z
ee d� Z eed� Z eed � Z
eed
� Z eed
� Z eed� Z eed� Z eed� Z eed� Z eed
� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Z d� Z!d� Z"d� Z#d� Z$d� Z%d� Z&d � Z'd!� Z(d"� Z)d#� Z*d$� Z+d%� Z,d&� Z-d'� Z.d(� Z/y))*�SymtableTest�?�exec�Mine�a_method�spam�internal�other_internal�foo�Alias�GenericAlias�generic_spam�GenericMine�Tc � � | j | j j � d� | j | j j � d� | j | j j � d� | j | j
j � d� | j | j j � d� | j | j j � d� | j | j j � d� | j | j j � d� | j | j j � d� | j | j j � d� | j | j j � d� | j | j j � d� | j | j j � d� | j | j j � d� y )N�module�class�functionz
type aliasztype parameterz
TypeVar bound)�assertEqual�top�get_typer r r r r r r �GenericAlias_innerr �generic_spam_innerr �GenericMine_innerr ��selfs r
� test_typezSymtableTest.test_typeP s� � �������*�*�,�h�7�������+�+�-�w�7�������/�/�1�:�>�������+�+�-�z�:�������/�/�1�:�>�������*�*�,�j�9�������,�,�.��=�����*�*�3�3�5�7G�H�����0�0�9�9�;�\�J�����*�*�3�3�5�7G�H�����0�0�9�9�;�Z�H�����)�)�2�2�4�6F�G�����/�/�8�8�:�G�D���������*�O�<r c �L � | j | j j � d� | j | j j � d� | j | j j � d� | j | j
j � d� | j | j j � d� | j | j j � d� | j | j j � d� | j | j j � d� | j | j j � d� | j | j j � d� y )Nr )�
assertGreaterr! �get_idr r r r r r r r r r&