Current File : //usr/local/apps/python3/lib/python3.11/test/__pycache__/test_call.cpython-311.opt-2.pyc
�

�KeJj���ddlZddlmZ	ddlZn
#e$rdZYnwxYwddlZddlZddlZddlZddl	Z	Gd�de
��ZGd�dej��Z
eGd�dej����ZGd	�d
ej��ZGd�de��ZGd
�de��ZGd�de��ZGd�de��Zd�Zd�ZGd�d��Ze��Ze��ZGd�dej��ZdZdZd�Zd�ZGd�dej��ZGd�d ��Z eGd!�d"ej����Z!e"d#krej#��dSdS)$�N)�cpython_onlyc��eZdZd�Zd�ZdS)�BadStrc��dS)NT�)�self�others  �8/usr/local/apps/python3/lib/python3.11/test/test_call.py�__eq__z
BadStr.__eq__s���t�c�<�t�|��dzS)N�)�str�__hash__�rs r
rzBadStr.__hash__s���|�|�D�!�!�A�%�%rN)�__name__�
__module__�__qualname__rrrrr
rrs2���������&�&�&�&�&rrc��eZdZd�Zd�ZdS)�
FunctionCallsc�T�tjddg��}|�d��t|�����}d�}|di|��}|�|t��|�t|�����|��dS)N)�a�)�b�rc��|S�Nr)�kws r
�fnz+FunctionCalls.test_kwargs_order.<locals>.fns���Irr)�collections�OrderedDict�move_to_end�list�items�assertIsInstance�dict�assertEqual)r�od�expectedr�ress     r
�test_kwargs_orderzFunctionCalls.test_kwargs_orders���
�
$�h��%9�
:�
:��
���s��������
�
�#�#��	�	�	��b�h�h�2�h�h�����c�4�(�(�(�����c�i�i�k�k�*�*�H�5�5�5�5�5rc�h�d�}td��D]}	|d���#t$rY�wxYwdS)Nc��dSrrrrr
�fzBFunctionCalls.test_frames_are_popped_after_failed_calls.<locals>.f(s���Dri�)�range�	TypeError)rr.�_s   r
�)test_frames_are_popped_after_failed_callsz7FunctionCalls.test_frames_are_popped_after_failed_calls%sd��	�	�	��t���	�	�A�
���$�������
�
�
���
����	�	s�"�
/�/N)rrrr+r2rrr
rrs2������6�6�6�	�	�	�	�	rrc���eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z d�Z!d �Z"d!�Z#d"�Z$d#�Z%d$S)%�CFunctionCallsErrorMessagesc�L�d}|�t|ij��dS)Nz7__contains__\(\) takes exactly one argument \(0 given\)��assertRaisesRegexr0�__contains__�r�msgs  r
�
test_varargs0z)CFunctionCallsErrorMessages.test_varargs05s'��H�����y�#�r��?�?�?�?�?rc�P�d}|�t|ijdd��dS)Nz7__contains__\(\) takes exactly one argument \(2 given\)rrr6r9s  r
�
test_varargs2z)CFunctionCallsErrorMessages.test_varargs29s+��H�����y�#�r���1�E�E�E�E�Erc�\�d}|�t|tjddd��dS)Nz@^from_bytes\(\) takes at most 2 positional arguments \(3 given\)�a�littleF)r7r0�int�
from_bytesr9s  r
�
test_varargs3z)CFunctionCallsErrorMessages.test_varargs3=s-��Q�����y�#�s�~�t�X�u�U�U�U�U�Urc��d}|�t|ij��d}|�t|ij��dS)Nz'get expected at least 1 argument, got 0zexpected 1 argument, got 0)r7r0�get�__delattr__r9s  r
�test_varargs1minz,CFunctionCallsErrorMessages.test_varargs1minAsF��8�����y�#�r�v�6�6�6�+�����y�#�r�~�>�>�>�>�>rc�L�d}|�t|t��dS)Nz,getattr expected at least 2 arguments, got 0�r7r0�getattrr9s  r
�test_varargs2minz,CFunctionCallsErrorMessages.test_varargs2minHs%��=�����y�#�w�7�7�7�7�7rc�P�d}|�t|tdd��dS)Nz(input expected at most 1 argument, got 2rr)r7r0�inputr9s  r
�test_varargs1maxz,CFunctionCallsErrorMessages.test_varargs1maxLs)��9�����y�#�u�a��;�;�;�;�;rc�R�d}|�t|ijddd��dS)Nz'get expected at most 2 arguments, got 3rrr)r7r0rEr9s  r
�test_varargs2maxz,CFunctionCallsErrorMessages.test_varargs2maxPs-��8�����y�#�r�v�q�!�Q�?�?�?�?�?rc�P�d}|�t|ijd���dS)N�+__contains__\(\) takes no keyword argumentsr��xr6r9s  r
�test_varargs1_kwz,CFunctionCallsErrorMessages.test_varargs1_kwTs,��<�����y�#�r��!��D�D�D�D�Drc�R�d}|�t|ijdd���dS)NrRr�rT�yr6r9s  r
�test_varargs2_kwz,CFunctionCallsErrorMessages.test_varargs2_kwXs.��<�����y�#�r��!�q��I�I�I�I�Irc�P�d}|�t|td���dS)Nz#bool\(\) takes no keyword argumentsrrS)r7r0�boolr9s  r
�test_varargs3_kwz,CFunctionCallsErrorMessages.test_varargs3_kw\s*��4�����y�#�t�q��9�9�9�9�9rc�P�d}|�t|gjd���dS)Nz-^list[.]index\(\) takes no keyword arguments$rrS)r7r0�indexr9s  r
�test_varargs4_kwz,CFunctionCallsErrorMessages.test_varargs4_kw`s,��>�����y�#�r�x�1��=�=�=�=�=rc�P�d}|�t|td���dS)Nz(^hasattr\(\) takes no keyword arguments$rrS)r7r0�hasattrr9s  r
�test_varargs5_kwz,CFunctionCallsErrorMessages.test_varargs5_kwd�*��9�����y�#�w�!��<�<�<�<�<rc�P�d}|�t|td���dS)Nz(^getattr\(\) takes no keyword arguments$rrSrIr9s  r
�test_varargs6_kwz,CFunctionCallsErrorMessages.test_varargs6_kwhrcrc�P�d}|�t|td���dS)Nz%^next\(\) takes no keyword arguments$rrS)r7r0�nextr9s  r
�test_varargs7_kwz,CFunctionCallsErrorMessages.test_varargs7_kwls*��6�����y�#�t�q��9�9�9�9�9rc�Z�d}|�t|tjd���dS)Nz/^_struct[.]pack\(\) takes no keyword arguments$rrS)r7r0�struct�packr9s  r
�test_varargs8_kwz,CFunctionCallsErrorMessages.test_varargs8_kwps,��@�����y�#�v�{�a��@�@�@�@�@rc�Z�d}|�t|tjd���dS)Nz4^_struct[.]pack_into\(\) takes no keyword arguments$rrS)r7r0rj�	pack_intor9s  r
�test_varargs9_kwz,CFunctionCallsErrorMessages.test_varargs9_kwts-��E�����y�#�v�/?�1��E�E�E�E�Erc�r�d}|�t|tj��jd���dS)Nz.^deque[.]index\(\) takes no keyword arguments$rrS)r7r0r �dequer^r9s  r
�test_varargs10_kwz-CFunctionCallsErrorMessages.test_varargs10_kwxs6��?�����y�#�{�/@�/B�/B�/H�A��N�N�N�N�Nrc��d}|�t|tjjtjd��d���dS)Nz.^Struct[.]pack\(\) takes no keyword arguments$�rrS)r7r0rj�Structrkr9s  r
�test_varargs11_kwz-CFunctionCallsErrorMessages.test_varargs11_kw|s=��?�����y�#�v�}�/A�6�=�QS�CT�CT�XY��Z�Z�Z�Z�Zrc�Z�d}|�t|tt���dS)Nz-^staticmethod\(\) takes no keyword arguments$��func)r7r0�staticmethod�idr9s  r
�test_varargs12_kwz-CFunctionCallsErrorMessages.test_varargs12_kw�s*��>�����y�#�|�"��E�E�E�E�Erc�Z�d}|�t|tt���dS)Nz,^classmethod\(\) takes no keyword arguments$rx)r7r0�classmethodr{r9s  r
�test_varargs13_kwz-CFunctionCallsErrorMessages.test_varargs13_kw�s*��=�����y�#�{���D�D�D�D�Drc�^�d}|�t|tjddd���dS)Nz:^product\(\) takes at most 1 keyword argument \(2 given\)$rrr)�repeat�foo)r7r0�	itertools�productr9s  r
�test_varargs14_kwz-CFunctionCallsErrorMessages.test_varargs14_kw�sC��K�����y�#�(�0�!�A�1�	�	F�	F�	F�	F�	Frc	�V�d}|�t|tdddd���dS)Nz?^ImportError\(\) takes at most 2 keyword arguments \(3 given\)$rrrr)�name�pathr�)r7r0�ImportErrorr9s  r
�test_varargs15_kwz-CFunctionCallsErrorMessages.test_varargs15_kw�sB��P�����y�#�*�A�A�A�1�	�	F�	F�	F�	F�	Frc	�V�d}|�t|tdddd���dS)Nz7^min\(\) takes at most 2 keyword arguments \(3 given\)$rrrr)�default�keyr�)r7r0�minr9s  r
�test_varargs16_kwz-CFunctionCallsErrorMessages.test_varargs16_kw�sB��H�����y�#�"�A�q�a�Q�	�	@�	@�	@�	@�	@rc�Z�d}|�t|tdddddd��	�	dS)	Nz3'foo' is an invalid keyword argument for print\(\)$rrrr��)�sep�end�file�flushr�)r7r0�printr9s  r
�test_varargs17_kwz-CFunctionCallsErrorMessages.test_varargs17_kw�sF��D�����y�#�$�a�Q�A�A�Q�A�	�	O�	O�	O�	O�	Orc��d}|�t|��5tditd��di��ddd��dS#1swxYwYdS)Nz'invalid keyword argument for print\(\)$rrr��,)rr)r7r0r�rr9s  r
�test_varargs18_kwz-CFunctionCallsErrorMessages.test_varargs18_kw�s���8��
�
#�
#�I�s�
3�
3�	0�	0��/�/�6�%�=�=�#�.�/�/�/�	0�	0�	0�	0�	0�	0�	0�	0�	0�	0�	0�	0����	0�	0�	0�	0�	0�	0��A�A�Ac��d}|�t|��5tditd��di��ddd��dS#1swxYwYdS)Nz'invalid keyword argument for round\(\)$��?r�r)r�)r7r0�roundrr9s  r
�test_varargs19_kwz-CFunctionCallsErrorMessages.test_varargs19_kw�s���8��
�
#�
#�I�s�
3�
3�	.�	.��-�-�6�%�=�=�!�,�-�-�-�	.�	.�	.�	.�	.�	.�	.�	.�	.�	.�	.�	.����	.�	.�	.�	.�	.�	.r�c�N�d}|�t|ijd��dS)Nz'keys\(\) takes no arguments \(1 given\)r�r7r0�keysr9s  r
�test_oldargs0_1z+CFunctionCallsErrorMessages.test_oldargs0_1�s)��8�����y�#�r�w��:�:�:�:�:rc�P�d}|�t|ijdd��dS)Nz'keys\(\) takes no arguments \(2 given\)rrr�r9s  r
�test_oldargs0_2z+CFunctionCallsErrorMessages.test_oldargs0_2�s+��8�����y�#�r�w��1�=�=�=�=�=rc�P�d}|�t|ijd���dS)N�#keys\(\) takes no keyword argumentsrrSr�r9s  r
�test_oldargs0_1_kwz.CFunctionCallsErrorMessages.test_oldargs0_1_kw�s,��4�����y�#�r�w�!��<�<�<�<�<rc�R�d}|�t|ijdd���dS)Nr�rrWr�r9s  r
�test_oldargs0_2_kwz.CFunctionCallsErrorMessages.test_oldargs0_2_kw�s.��4�����y�#�r�w�!�q��A�A�A�A�Arc�L�d}|�t|gj��dS)Nz0count\(\) takes exactly one argument \(0 given\)�r7r0�countr9s  r
�test_oldargs1_0z+CFunctionCallsErrorMessages.test_oldargs1_0�s'��A�����y�#�r�x�8�8�8�8�8rc�P�d}|�t|gjdd��dS)Nz0count\(\) takes exactly one argument \(2 given\)rrr�r9s  r
�test_oldargs1_2z+CFunctionCallsErrorMessages.test_oldargs1_2�s+��A�����y�#�r�x��A�>�>�>�>�>rc�P�d}|�t|gjd���dS�N�$count\(\) takes no keyword argumentsrrSr�r9s  r
�test_oldargs1_0_kwz.CFunctionCallsErrorMessages.test_oldargs1_0_kw�s,��5�����y�#�r�x�1��=�=�=�=�=rc�R�d}|�t|gjid���dSr�r�r9s  r
�test_oldargs1_1_kwz.CFunctionCallsErrorMessages.test_oldargs1_1_kw�s.��5�����y�#�r�x��q��A�A�A�A�Arc�R�d}|�t|gjdd���dS)Nr�rrWr�r9s  r
�test_oldargs1_2_kwz.CFunctionCallsErrorMessages.test_oldargs1_2_kw�s.��5�����y�#�r�x�1���B�B�B�B�BrN)&rrrr;r=rCrGrKrNrPrUrYr\r_rbrerhrlrorrrvr|rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrr
r4r42s\������@�@�@�F�F�F�V�V�V�?�?�?�8�8�8�<�<�<�@�@�@�E�E�E�J�J�J�:�:�:�>�>�>�=�=�=�=�=�=�:�:�:�A�A�A�F�F�F�O�O�O�[�[�[�F�F�F�E�E�E�F�F�F�
F�F�F�
@�@�@�
O�O�O�
0�0�0�.�.�.�;�;�;�>�>�>�=�=�=�B�B�B�9�9�9�?�?�?�>�>�>�B�B�B�C�C�C�C�Crr4c��eZdZ	d�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�ZdS)�TestCallingConventionsc�,�tx|_|_dSr)�	_testcapi�obj�
expected_selfrs r
�setUpzTestCallingConventions.setUp�s��(1�1���4�%�%�%rc�t�|�|j�ddd��|jdf��dS�Nrrr�rrr�r'r��meth_varargsr�rs r
�test_varargsz#TestCallingConventions.test_varargs�sF������H�!�!�!�Q��*�*�
�
��+�	
�	
�	
�	
�	
rc�Z�|�|jjd�|jdf��dS�Nr�r�rs r
�test_varargs_extz'TestCallingConventions.test_varargs_ext�s>�����!�D�H�!�9�-�
�
��+�	
�	
�	
�	
�	
rc�J��d}��t|�fd���dS)Nz+meth_varargs\(\) takes no keyword argumentsc�:���j�d���S�Nr)�k)r�r�rs�r
�<lambda>z>TestCallingConventions.test_varargs_error_kw.<locals>.<lambda>�s���D�H�$9�$9�A�$9�$>�$>�r�r7r0r9s` r
�test_varargs_error_kwz,TestCallingConventions.test_varargs_error_kw�s;���<������s�>�>�>�>�	
�	
�	
�	
�	
rc��|�|j�dddd���|jdddd�f��dS�Nrrrr��rr�rr�r'r��meth_varargs_keywordsr�rs r
�test_varargs_keywordsz,TestCallingConventions.test_varargs_keywords�sU������H�*�*�1�a�1��*�:�:�
�
��q�q�)9�)9�:�	
�	
�	
�	
�	
rc	�r�|�|jjddgiddd���|jdddd�f��dSr�r�rs r
�test_varargs_keywords_extz0TestCallingConventions.test_varargs_keywords_ext�s\�����*�D�H�*�Q��F�G�A�A�6F�6F�G�G�
�
��q�q�)9�)9�:�	
�	
�	
�	
�	
rc�p�|�|j�d��|jdf��dS�Nr�r'r��meth_or�rs r
�test_ozTestCallingConventions.test_o�s4����������+�+�d�.@�!�-D�E�E�E�E�Erc�\�|�|jjdg�|jdf��dSr�r�rs r
�
test_o_extz!TestCallingConventions.test_o_ext�s3���������1�#�.��1C�Q�0G�H�H�H�H�Hrc�V�d}|�t||jj��dS)Nz1meth_o\(\) takes exactly one argument \(0 given\))r7r0r�r�r9s  r
�test_o_error_no_argz*TestCallingConventions.test_o_error_no_args)��B�����y�#�t�x��?�?�?�?�?rc�J��d}��t|�fd���dS)Nz1meth_o\(\) takes exactly one argument \(2 given\)c�:���j�dd��S�Nrr�r�r�rs�r
r�z>TestCallingConventions.test_o_error_two_args.<locals>.<lambda>s���D�H�O�O�A�q�$9�$9�rr�r9s` r
�test_o_error_two_argsz,TestCallingConventions.test_o_error_two_argss;���B������s�9�9�9�9�	
�	
�	
�	
�	
rc�J��d}��t|�fd���dS)Nz1meth_o\(\) takes exactly one argument \(3 given\)c�"���jjd�Sr�r�rs�r
r�z9TestCallingConventions.test_o_error_ext.<locals>.<lambda>
s���O�D�H�O�Y�$?�rr�r9s` r
�test_o_error_extz'TestCallingConventions.test_o_error_ext
s;���B������s�?�?�?�?�	
�	
�	
�	
�	
rc�J��d}��t|�fd���dS)N�%meth_o\(\) takes no keyword argumentsc�:���j�d���Sr�r�rs�r
r�z8TestCallingConventions.test_o_error_kw.<locals>.<lambda>����D�H�O�O�a�O�$8�$8�rr�r9s` r
�test_o_error_kwz&TestCallingConventions.test_o_error_kw�;���6������s�8�8�8�8�	
�	
�	
�	
�	
rc�J��d}��t|�fd���dS)Nr�c�:���j�d���Sr�r�rs�r
r�z<TestCallingConventions.test_o_error_arg_kw.<locals>.<lambda>r�rr�r9s` r
�test_o_error_arg_kwz*TestCallingConventions.test_o_error_arg_kwr�rc�j�|�|j���|j��dSr�r'r��meth_noargsr�rs r
�test_noargsz"TestCallingConventions.test_noargss/�������-�-�/�/��1C�D�D�D�D�Drc�V�|�|jjg�|j��dSrr�rs r
�test_noargs_extz&TestCallingConventions.test_noargs_exts.�����-���-�r�2�D�4F�G�G�G�G�Grc�J��d}��t|�fd���dS)Nz.meth_noargs\(\) takes no arguments \(1 given\)c�8���j�d��Sr��r�r�rs�r
r�z>TestCallingConventions.test_noargs_error_arg.<locals>.<lambda>%s���D�H�$8�$8��$;�$;�rr�r9s` r
�test_noargs_error_argz,TestCallingConventions.test_noargs_error_arg"s;���?������s�;�;�;�;�	
�	
�	
�	
�	
rc�J��d}��t|�fd���dS)Nz.meth_noargs\(\) takes no arguments \(2 given\)c�:���j�dd��Sr�r�rs�r
r�z?TestCallingConventions.test_noargs_error_arg2.<locals>.<lambda>+s���D�H�$8�$8��A�$>�$>�rr�r9s` r
�test_noargs_error_arg2z-TestCallingConventions.test_noargs_error_arg2(s;���?������s�>�>�>�>�	
�	
�	
�	
�	
rc�J��d}��t|�fd���dS)Nz.meth_noargs\(\) takes no arguments \(3 given\)c�"���jjd�Sr�r�rs�r
r�z>TestCallingConventions.test_noargs_error_ext.<locals>.<lambda>1s���$8�D�H�$8�)�$D�rr�r9s` r
�test_noargs_error_extz,TestCallingConventions.test_noargs_error_ext.s;���?������s�D�D�D�D�	
�	
�	
�	
�	
rc�J��d}��t|�fd���dS)Nz*meth_noargs\(\) takes no keyword argumentsc�:���j�d���Sr�r�rs�r
r�z=TestCallingConventions.test_noargs_error_kw.<locals>.<lambda>7s���D�H�$8�$8�1�$8�$=�$=�rr�r9s` r
�test_noargs_error_kwz+TestCallingConventions.test_noargs_error_kw4s;���;������s�=�=�=�=�	
�	
�	
�	
�	
rc�t�|�|j�ddd��|jdf��dSr��r'r��
meth_fastcallr�rs r
�
test_fastcallz$TestCallingConventions.test_fastcall:sF������H�"�"�1�a��+�+�
�
��+�	
�	
�	
�	
�	
rc�Z�|�|jjd�|jdf��dSr�rrs r
�test_fastcall_extz(TestCallingConventions.test_fastcall_ext@s>�����"�D�H�"�I�.�
�
��+�	
�	
�	
�	
�	
rc�J��d}��t|�fd���dS)Nz,meth_fastcall\(\) takes no keyword argumentsc�:���j�d���Sr�)r�r	rs�r
r�z?TestCallingConventions.test_fastcall_error_kw.<locals>.<lambda>Is���D�H�$:�$:�Q�$:�$?�$?�rr�r9s` r
�test_fastcall_error_kwz-TestCallingConventions.test_fastcall_error_kwFs;���=������s�?�?�?�?�	
�	
�	
�	
�	
rc��|�|j�dddd���|jdddd�f��dSr��r'r��meth_fastcall_keywordsr�rs r
�test_fastcall_keywordsz-TestCallingConventions.test_fastcall_keywordsLsU������H�+�+�A�q�A��+�;�;�
�
��q�q�)9�)9�:�	
�	
�	
�	
�	
rc	�n�|�|jjdiddd���|jdddd�f��dS)Nr�rr�r�rrs r
�test_fastcall_keywords_extz1TestCallingConventions.test_fastcall_keywords_extRsX�����+�D�H�+�V�H�Q�Q�7G�7G�H�H�
�
��q�q�)9�)9�:�	
�	
�	
�	
�	
rN)rrrr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrr
rrrrrrr
r�r��s��������2�2�2�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�F�F�F�I�I�I�@�@�@�
�
�
�
�
�
�
�
�
�
�
�
�E�E�E�H�H�H�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
rr�c��eZdZ	d�ZdS)�TestCallingConventionsInstancec�D�tj��x|_|_dSr)r��MethInstancer�r�rs r
r�z$TestCallingConventionsInstance.setUp\s ��(1�(>�(@�(@�@���4�%�%�%rN�rrrr�rrr
rrYs+������I�A�A�A�A�Arrc��eZdZ	d�ZdS)�TestCallingConventionsClassc�6�tjx|_|_dSr�r��	MethClassr�r�rs r
r�z!TestCallingConventionsClass.setUpcs��(1�(;�;���4�%�%�%rNrrrr
rr`s&������F�<�<�<�<�<rrc��eZdZ	d�ZdS)�#TestCallingConventionsClassInstancec�X�tj��|_tj|_dSrrrs r
r�z)TestCallingConventionsClassInstance.setUpjs#���&�(�(���&�0����rNrrrr
r!r!gs&������0�1�1�1�1�1rr!c��eZdZ	d�ZdS)�TestCallingConventionsStaticc�D�tj��|_d|_dSr)r��
MethStaticr�r�rs r
r�z"TestCallingConventionsStatic.setUprs ���'�)�)���!����rNrrrr
r$r$os&������G�"�"�"�"�"rr$c�
�||gSrr��arg1�arg2s  r
�pyfuncr+ws���$�<�rc��dS�N�noargrrrr
�pyfunc_noargr/{s���7rc�F�eZdZd�Zd�Zed���Zed���ZdS)�PythonClassc�
�||gSrr)rr)r*s   r
�methodzPythonClass.method�s���d�|�rc��dSr-rrs r
�method_noargzPythonClass.method_noarg�s���wrc��dS)Nr~r)�clss r
�class_methodzPythonClass.class_method�s���}rc��dS)Nrzrrrr
�
static_methodzPythonClass.static_method�s���~rN)	rrrr3r5r~r8rzr:rrr
r1r1sh����������������[������\���rr1c�j�eZdZ	edddgfeddfejddfejddfej	dddgfej
ddfejddfejddfgZedd	diddgfedddd
�ddgfej	dd	diddgfej	dddd
�ddgfgZe
j��Ze
e
feefe
je
jfe
j��e
jfe
jdffD]�\ZZe�ejdedffejdedeffejdedffejdedffejdedeffejdedeffejdefejded
ffg��e�ejdddiedddiffejdddiedddiffejdiedeffejdddiedddiffejdddiedddiffejdiedeffg����d�Zd�Zd�Zd�Zd�Z dS)�
FastCallTestsr�rrrr.r~rz)rr*r(N)�{r=rTrXc��t|t��r0|dtur!|didfvrg|dd��|d�R}|�||��dS)N���)�
isinstance�tuple�
NULL_OR_EMPTYr')r�resultr)s   r
�check_resultzFastCallTests.check_result�so���h��&�&�	8�8�B�<�=�+H�+H��b�z�b�$�Z�'�'�7�X�c�r�c�]�7�F�2�J�7�7�������*�*�*�*�*rc�0�|jD]�\}}}|�||���5tj||��}|�||��|s+tj|d��}|�||��ddd��n#1swxYwY��dS)N�ry�args)�
CALLS_POSARGS�subTestr��pyobject_fastcallrD)rryrGr)rCs     r
r
zFastCallTests.test_fastcall�s���%)�$6�	8�	8� �D�$�����4�d��3�3�
8�
8�"�4�T�4�@�@���!�!�&�(�3�3�3��8�&�8��t�D�D�F��%�%�f�h�7�7�7�
8�
8�
8�
8�
8�
8�
8�
8�
8�
8�
8����
8�
8�
8�
8��	8�	8s�AB
�
B	�B	c�
�|jD]�\}}}|�||���5tj||d��}|�||��|s,tj|dd��}|�||��ddd��n#1swxYwY��|jD]c\}}}}|�|||���5tj|||��}|�||��ddd��n#1swxYwY�ddS)NrF�ryrG�kwargs)rHrIr��pyobject_fastcalldictrD�CALLS_KWARGS)rryrGr)rCrMs      r
�test_vectorcall_dictz"FastCallTests.test_vectorcall_dict�s���%)�$6�		8�		8� �D�$�����4�d��3�3�
8�
8�"�8��t�T�J�J���!�!�&�(�3�3�3��8�&�<�T�4��N�N�F��%�%�f�h�7�7�7�
8�
8�
8�
8�
8�
8�
8�
8�
8�
8�
8����
8�
8�
8�
8��-1�,=�	4�	4�(�D�$������4�d�6��B�B�
4�
4�"�8��t�V�L�L���!�!�&�(�3�3�3�
4�
4�
4�
4�
4�
4�
4�
4�
4�
4�
4����
4�
4�
4�
4��	4�	4s$�AB�B	�B	�>-C7�7C;	�>C;	c�D�|jD]�\}}}|�||���5tj||d��}|�||��tj||d��}|�||��|sXtj|dd��}|�||��tj|dd��}|�||��ddd��n#1swxYwY��|jD]�\}}}}|�|||���5t
|�����}|t
|�����z}tj|||��}|�||��ddd��n#1swxYwY��dS)NrFrrL)	rHrIr��pyobject_vectorcallrDrOrAr��values)rryrGr)rCrM�kwnamess       r
�test_vectorcallzFastCallTests.test_vectorcall	s+��%)�$6�	8�	8� �D�$�����4�d��3�3�
8�
8�"�6�t�T�4�H�H���!�!�&�(�3�3�3�#�6�t�T�2�F�F���!�!�&�(�3�3�3��8�&�:�4��t�L�L�F��%�%�f�h�7�7�7�'�:�4��r�J�J�F��%�%�f�h�7�7�7�!
8�
8�
8�
8�
8�
8�
8�
8�
8�
8�
8����
8�
8�
8�
8��$-1�,=�	4�	4�(�D�$������4�d�6��B�B�
4�
4�����
�
�.�.���e�F�M�M�O�O�4�4�4��"�6�t�T�7�K�K���!�!�&�(�3�3�3�	
4�
4�
4�
4�
4�
4�
4�
4�
4�
4�
4����
4�
4�
4�
4��	4�	4s%�B3C$�$C(	�+C(	�A2F�F	�F	c�r�Gd�d��}||�����}tddd|fi|j��dS)Nc� �eZdZdgZd�Zd�ZdS)�>FastCallTests.test_fastcall_clearing_dict.<locals>.IntWithDictrMc��||_dSr)rM)rrMs  r
�__init__zGFastCallTests.test_fastcall_clearing_dict.<locals>.IntWithDict.__init__+s
��$����rc�^�|j���tj��dS)Nr)rM�clear�gc�collectrs r
�	__index__zHFastCallTests.test_fastcall_clearing_dict.<locals>.IntWithDict.__index__-s&����!�!�#�#�#��
�����qrN)rrr�	__slots__rZr_rrr
�IntWithDictrX)s9������!�
�I�
%�
%�
%�
�
�
�
�
rra)�optimize�passrt�exec)�compilerM)rrarTs   r
�test_fastcall_clearing_dictz)FastCallTests.test_fastcall_clearing_dict&sj��	�	�	�	�	�	�	�	�
�K�����/�/�/��	���F�A�2�2���2�2�2�2�2r)!rrrr+r/r1r8r:�PYTHON_INSTANCEr3r5rHrOr�r�	_instancerr&r�r��extendr�r�rBr	rr�r�rDr
rPrUrfrrr
r<r<�sF�������
��!�Q�� �
�r�7�#�
�	!�2�}�5�	�	"�B��7�
�	��!�Q��0�	�	%�r�7�3�	�	%�r�=�9�	�	&��N�;�#�M�6
����{�Q��F�+�	��a��+�+�a��V�4�
�	����{�Q��F�;�	�	��a��%;�%;�a��V�D��L�'�	�&�(�(�I�	�I��	�I��	�	�i�1�2�	��	�	�	�	� 3�4�	�	�t�$��"�"���]�	���
�
�v�
�v�'>�?�
�
&����
�>�
@�
�
����(?�@�
�
��]�B�$7�8�
�
'����
�>�
@�
�
'��]�B�
�6�
8�
�_�b�-�0�
�Z��=�#�"6�7�
�	�	�	�	���
�
&���c�
�]�F�S�#�J�$G�
I�
�
&��S�#�J���S�#�J� ?�
A�
�
&���]�F�M�B�
D�
�
'���c�
�]�F�S�#�J�$G�
I�
�
'��S�#�J���S�#�J� ?�
A�
�
'���]�F�M�B�
D�

�
	�
	�
	�
	�+�+�+�8�8�8�4�4�4�&4�4�4�:3�3�3�3�3rr<iic��	|Srrrs r
�testfunctionrk<�
����Krc��	|Srr)rrs  r
�testfunction_kwrnArlrc�&�eZdZd�Zd�Zd�Zd�ZdS)�
TestPEP590c���ddl}|�d��t��}|�t	t
��jtz��|�t	tj
��jtz��|�t	tj��jtz��|�t	t��jtz��|�t	|��jtz��|�tj
jtz��|�tjjtz��|�tjjtz��Gd�dtj
��}|�|jtz��dS)Nrrc��eZdZdS)�DTestPEP590.test_method_descriptor_flag.<locals>.MethodDescriptorHeapN�rrrrrr
�MethodDescriptorHeaprsW��������Drru)�	functools�	lru_cacherk�assertFalse�type�repr�	__flags__�Py_TPFLAGS_METHOD_DESCRIPTOR�
assertTruer#�append�__add__r��MethodDescriptorBase�MethodDescriptorDerived�MethodDescriptorNopGet)rrw�cachedrus    r
�test_method_descriptor_flagz&TestPEP590.test_method_descriptor_flagHs�������'��$�$�Q�'�'��5�5������d���-�0L�L�M�M�M�����T�[�)�)�3�6R�R�S�S�S�����T�\�*�*�4�7S�S�T�T�T�����\�*�*�4�7S�S�T�T�T�����V���.�1M�M�N�N�N����	�6�@�C_�_�`�`�`����	�9�C�Fb�b�c�c�c�����9�C�Fb�b�c�c�c�	�	�	�	�	�9�#A�	�	�	����-�7�:V�V�W�W�W�W�Wrc���|�tjjtz��|�tjjtz��|�tjjtz��|�tjjtz��Gd�dtj��}|�|jtz��dS)Nc��eZdZdS)�=TestPEP590.test_vectorcall_flag.<locals>.MethodDescriptorHeapNrtrrr
rur�brvrru)	r~r�r�r|�Py_TPFLAGS_HAVE_VECTORCALLr�ryr��MethodDescriptor2)rrus  r
�test_vectorcall_flagzTestPEP590.test_vectorcall_flag[s������	�6�@�C]�]�^�^�^����	�9�C�F`�`�a�a�a�����9�C�F`�`�a�a�a����	�3�=�@Z�Z�[�[�[�	�	�	�	�	�9�#A�	�	�	����-�7�:T�T�U�U�U�U�Urc��ttd����}tj��}|�||�|��dS)Nr�)rAr/r�r��assertIs)rrGr.s   r
�test_vectorcall_overridez#TestPEP590.test_vectorcall_overridefsC���U�1�X�X�����,�.�.���
�
�a�a��h��%�%�%�%�%rc�`��ttd��fidftjgdfidfgjdidftdgfddidft
didftdddidftj��did	ftj	��did	ftj
��did
fg	}ddlm�m}ddl
m}dd
lm}�fd�}|D]�\}}}}	|�t%|����5|s |�|	|||����|�|	||||����ddd��n#1swxYwY��Gd�dtj��}
Gd�dtj��}Gd�d��}Gd�d|tj��}
|t(jifdd	idfijifdd	idf|
��did	f|��didf|
��did	fgz
}|D�]L\}}}}	|�t%|����5|dd�}|||d��}||��}|sl|�|	||���|�|	�||d����|�|	||���|�|	||���|�|	||i|����|�|	||||����|�|	||i|����|�|	||i|����ddd��n#1swxYwY��NdS)N�*r)r�$�start�)r�rTF)rR�pyvectorcall_call)�
MethodType)�partialc�n��g|�|����R}t|��}�|||��Sr)rSrA)ryrGrMrTrRs    �r
�
vectorcallz.TestPEP590.test_vectorcall.<locals>.vectorcall�s=���*�D�*�6�=�=�?�?�*�*�D��F�m�m�G�&�&�t�T�7�;�;�;rc��eZdZdS)�8TestPEP590.test_vectorcall.<locals>.MethodDescriptorHeapNrtrrr
rur��rvrruc��eZdZd�ZdS)�>TestPEP590.test_vectorcall.<locals>.MethodDescriptorOverriddenc��dS)N�newr)r�ns  r
�__call__zGTestPEP590.test_vectorcall.<locals>.MethodDescriptorOverridden.__call__�s���urN)rrrr�rrr
�MethodDescriptorOverriddenr��s#������
�
�
�
�
rr�c���eZdZ�fd�Z�xZS)�-TestPEP590.test_vectorcall.<locals>.SuperBasec�0��t��j|�Sr��superr��rrG�	__class__s  �r
r�z6TestPEP590.test_vectorcall.<locals>.SuperBase.__call__�����'�u�w�w�'��.�.r�rrrr��
__classcell__�r�s@r
�	SuperBaser���8�������
/�
/�
/�
/�
/�
/�
/�
/�
/rr�c���eZdZ�fd�Z�xZS)�9TestPEP590.test_vectorcall.<locals>.MethodDescriptorSuperc�0��t��j|�Srr�r�s  �r
r�zBTestPEP590.test_vectorcall.<locals>.MethodDescriptorSuper.__call__�r�rr�r�s@r
�MethodDescriptorSuperr��r�rr�r�r�r)�lenr/r#r�sumrkrnr�r�r�r�rRr��typesr�rwr�rIrr'r&�update)r�callsr�r�r�r�ryrGrMr)rur�r�r��args1�meth�wrappedrRs                 @r
rUzTestPEP590.test_vectorcallps
�����b�	�	�|�R��,��+��A�w��D�1��)�T�2�t�,����w����R�0���r�2�.�!�5�4��+�r�:��0�2�2�D�"�d�C��3�5�5�t�R��F��-�/�/��r�5�A�C��	E�D�D�D�D�D�D�D�$�$�$�$�$�$�%�%�%�%�%�%�	<�	<�	<�	<�	<�
/4�	R�	R�*�T�4������c�$�i�i�(�(�
R�
R��N��$�$�X�/@�/@��t�/L�/L�M�M�M�� � ��+<�+<�T�4��+P�+P�Q�Q�Q�
R�
R�
R�
R�
R�
R�
R�
R�
R�
R�
R����
R�
R�
R�
R��	�	�	�	�	�9�#A�	�	�	�	�	�	�	�	��)G�	�	�	�	/�	/�	/�	/�	/�	/�	/�	/�	/�	/�	/�	/�	/�I�y�/M�	/�	/�	/�	�
�[�2�%�%���t�4�
�Y����d�|�T�2�
!�
!�
#�
#�T�2�t�4�
'�
'�
)�
)�4��U�;�
"�
"�
$�
$�d�B��5�
�	
��/4�
	E�
	E�*�T�4������c�$�i�i�(�(�
E�
E��Q�R�R���!�z�$��Q��0�0��!�'�$�-�-���?��$�$�X�t�t�T�{�;�;�;��$�$�X�/B�/B�4��t�/T�/T�U�U�U��$�$�X�t�t�U�|�<�<�<��$�$�X�w�w��~�>�>�>�� � ��4�4��+@��+@�+@�A�A�A�� � ��:�:�d�D�&�+I�+I�J�J�J�� � ��4�4��+A�&�+A�+A�B�B�B�� � ��7�7�D�+C�F�+C�+C�D�D�D�
E�
E�
E�
E�
E�
E�
E�
E�
E�
E�
E����
E�
E�
E�
E��
	E�
	Es&�!AD1�1D5	�8D5	�
DL!�!L%	�(L%	N)rrrr�r�r�rUrrr
rprpFs`������X�X�X�&	V�	V�	V�&�&�&�JE�JE�JE�JE�JErrpc�@�eZdZd�Zed���Zed���ZdS)�Ac��dSrr)rrTrXs   r
�method_two_argszA.method_two_args�s���rc��dSrrrrr
�static_no_argszA.static_no_args�����rc��dSrr��args r
�positional_onlyzA.positional_only�r�rN)rrrr�rzr�r�rrr
r�r��sY������
�
�
��
�
��\�
��
�
��\�
�
�
rr�c�L�eZdZejd���Zd�Zd�Zd�Zd�Z	d�Z
dS)�!TestErrorMessagesUseQualifiedNamec#��K�|�t��5}dV�ddd��n#1swxYwY|�t|j��|��dSr)�assertRaisesr0r'r�	exception)r�message�cms   r
�check_raises_type_errorz9TestErrorMessagesUseQualifiedName.check_raises_type_error�s�����
�
�
�y�
)�
)�	�R��E�E�E�	�	�	�	�	�	�	�	�	�	�	����	�	�	�	�����R�\�*�*�G�4�4�4�4�4s�.�2�2c��d}|�|��5t���d��ddd��dS#1swxYwYdS)Nz?A.method_two_args() missing 1 required positional argument: 'y'rT�r�r�r�r9s  r
�test_missing_argumentsz8TestErrorMessagesUseQualifiedName.test_missing_arguments�s���O��
�
)�
)�#�
.�
.�	%�	%�
�C�C����$�$�$�	%�	%�	%�	%�	%�	%�	%�	%�	%�	%�	%�	%����	%�	%�	%�	%�	%�	%s�"A�A�Ac��d}|�|��5t�d��ddd��dS#1swxYwYdS)Nz?A.static_no_args() takes 0 positional arguments but 1 was givenzoops it's an arg)r�r�r�r9s  r
�test_too_many_positionalz:TestErrorMessagesUseQualifiedName.test_too_many_positional�s���O��
�
)�
)�#�
.�
.�	1�	1�
���/�0�0�0�	1�	1�	1�	1�	1�	1�	1�	1�	1�	1�	1�	1����	1�	1�	1�	1�	1�	1s�A�A�Ac��d}|�|��5t�d���ddd��dS#1swxYwYdS)NzYA.positional_only() got some positional-only arguments passed as keyword arguments: 'arg'rTr�)r�r�r�r9s  r
�&test_positional_only_passed_as_keywordzHTestErrorMessagesUseQualifiedName.test_positional_only_passed_as_keyword�s���i��
�
)�
)�#�
.�
.�	'�	'�
���#��&�&�&�	'�	'�	'�	'�	'�	'�	'�	'�	'�	'�	'�	'����	'�	'�	'�	'�	'�	's�A�A�Ac��d}|�|��5t���d���ddd��dS#1swxYwYdS)Nz<A.method_two_args() got an unexpected keyword argument 'bad'rT)�badr�r9s  r
�test_unexpected_keywordz9TestErrorMessagesUseQualifiedName.test_unexpected_keyword�s���L��
�
)�
)�#�
.�
.�	)�	)�
�C�C���C��(�(�(�	)�	)�	)�	)�	)�	)�	)�	)�	)�	)�	)�	)����	)�	)�	)�	)�	)�	)s�#A�A�Ac��d}|�|��5t���ddd���ddd��dS#1swxYwYdS)Nz8A.method_two_args() got multiple values for argument 'x'rTrX�oopsrSr�r9s  r
�test_multiple_valuesz6TestErrorMessagesUseQualifiedName.test_multiple_values�s���H��
�
)�
)�#�
.�
.�	4�	4�
�C�C����S�F��3�3�3�	4�	4�	4�	4�	4�	4�	4�	4�	4�	4�	4�	4����	4�	4�	4�	4�	4�	4s�%A
�
A�AN)rrr�
contextlib�contextmanagerr�r�r�r�r�r�rrr
r�r��s~��������5�5���5�
%�%�%�
1�1�1�
'�'�'�
)�)�)�
4�4�4�4�4rr��__main__)$�unittest�test.supportrr�r�rjr r�r]r�rr�TestCaserr4r�rrr!r$r+r/r1rg�objectrBr<r�r}rkrnrpr�r�r�mainrrr
�<module>r�s�������%�%�%�%�%�%�������������I�I�I�����
�
�
�
���������	�	�	�	�����&�&�&�&�&�S�&�&�&������H�%����8�WC�WC�WC�WC�WC�(�"3�WC�WC���WC�vH
�H
�H
�H
�H
�X�.�H
�H
�H
�VA�A�A�A�A�%;�A�A�A�<�<�<�<�<�"8�<�<�<�1�1�1�1�1�*@�1�1�1�"�"�"�"�"�#9�"�"�"�������
�
�
�
�
�
�
�
� �+�-�-������
�b3�b3�b3�b3�b3�H�%�b3�b3�b3�J%��&�����
���
tE�tE�tE�tE�tE��"�tE�tE�tE�n

�

�

�

�

�

�

�

��4�4�4�4�4��(9�4�4���4�D�z����H�M�O�O�O�O�O��s���