File: //proc/self/root/opt/alt/python312/lib64/python3.12/test/__pycache__/test_dynamic.cpython-312.pyc
�
h�e� � � � d dl Z d dlZd dlZd dlmZmZ G d� dej � Z G d� dej � Ze dk( r ej � yy)� N)� swap_item� swap_attrc �R � e Zd ZdZd� Zd� Zd� Zd� Zd� Zd� Z d� Z
d � Zd
� Zd� Z
d� Zy
)�RebindBuiltinsTestsz=Test all the ways that we can change/shadow globals/builtins.c � � y)a� Perform TestCase-specific configuration on a function before testing.
By default, this does nothing. Example usage: spinning a function so
that a JIT will optimize it. Subclasses should override this as needed.
Args:
func: function to configure.
*args: any arguments that should be passed to func, if calling it.
Returns:
Nothing. Work will be performed on func in-place.
N� )�self�func�argss �8/opt/alt/python312/lib64/python3.12/test/test_dynamic.py�configure_funcz"RebindBuiltinsTests.configure_func s � �
� c �� � d� }| j |� | j |� d� t t � dd� � 5 | j |� d� d d d � y # 1 sw Y y xY w)Nc � � t g d�� S �N)� � � ��lenr r r �fooz=RebindBuiltinsTests.test_globals_shadow_builtins.<locals>.foo � � ��y�>�!r r r c � � y�N� r ��xs r �<lambda>zBRebindBuiltinsTests.test_globals_shadow_builtins.<locals>.<lambda>$ � � r r �r
�assertEqualr �globals�r r s r �test_globals_shadow_builtinsz0RebindBuiltinsTests.test_globals_shadow_builtins s\ � � "����C� �������"�
�w�y�%��
5� '����S�U�A�&� '� '� '�s �A#�#A,c �� � d� }| j |� | j |� d� t t dd� � 5 | j |� d� d d d � y # 1 sw Y y xY w)Nc � � t g d�� S r r r r r r z5RebindBuiltinsTests.test_modify_builtins.<locals>.foo) r r r r c � � yr r r s r r z:RebindBuiltinsTests.test_modify_builtins.<locals>.<lambda>. r r r )r
r! r �builtinsr# s r �test_modify_builtinsz(RebindBuiltinsTests.test_modify_builtins'