Sindbad~EG File Manager

Current Path : /usr/local/lib/python3.12/test/test_capi/__pycache__/
Upload File :
Current File : //usr/local/lib/python3.12/test/test_capi/__pycache__/test_number.cpython-312.opt-2.pyc

�

(Μg�4���ddlZddlZddlZddlZddlZddlmZmZejd�Z	ddl	m
Z
mZ	ddlm
Z
dZGd�d�ZGd�d	�ZGd
�d�ZGd�d
e�ZGd�de�ZGd�de�Zd�ZGd�de�ZGd�de�ZGd�dej4�Zedk(rej:�yy#e$rdZ
Y��wxYw)�N)�cpython_only�
import_helper�	_testcapi)�PY_SSIZE_T_MAX�PY_SSIZE_T_MIN)�ndarrayc��eZdZdd�Zy)�BadDescrNc��t��N)�RuntimeError)�self�obj�objtypes   �7/usr/local/lib/python3.12/test/test_capi/test_number.py�__get__zBadDescr.__get__s����r)�__name__�
__module__�__qualname__r�rrr
r
s��rr
c�B��eZdZd�Ze�fd��Ze�fd��Z�xZS)�
WithDunderc�d�|jr|jS|jr|j�yr)�val�exc)r�argss  r�_methzWithDunder._meths'���8�8��8�8�O��8�8��(�(�N�rc���t�|�|�}||_d|_t	||j
|j�|Sr��super�__new__rr�setattr�methnamer)�clsrr�	__class__s   �r�with_valzWithDunder.with_vals8����g�o�c�"����������S�\�\�3�9�9�-��
rc���t�|�|�}d|_||_t	||j
|j�|Srr )r%rrr&s   �r�with_exczWithDunder.with_exc%s8����g�o�c�"����������S�\�\�3�9�9�-��
r)rrrr�classmethodr'r)�
__classcell__�r&s@rrrs0����
�������rrc���eZdZ�fd�Z�xZS)�
HasBadAttrc�d��t�|�|�}t||jt	��|Sr)r!r"r#r$r
)r%rr&s  �rr"zHasBadAttr.__new__.s(����g�o�c�"����S�\�\�8�:�.��
r)rrrr"r+r,s@rr.r.-s
����rr.c��eZdZdZy)�	IndexLike�	__index__N�rrrr$rrrr1r14����Hrr1c��eZdZdZy)�IntLike�__int__Nr3rrrr6r67s���Hrr6c��eZdZdZy)�	FloatLike�	__float__Nr3rrrr9r9:r4rr9c�8�t|jdz|fi�S)N�Subclass)�typer)�bases r�
subclassofr?>s����
�
�
�*�T�G�R�8�8rc��eZdZy)�	SomeErrorN�rrrrrrrArAB���rrAc��eZdZy)�
OtherErrorNrBrrrrErEErCrrEc��eZdZd�Zd�Zd�Zejedud�d��Z	ejedud�d��Z
d�Zed	��Z
d
�Zd�Zd�Zd
�Zd�Zy)�CAPITestc�z�tj}|j|d��|j|tj	d���|j|t
j	d���|j|d��|j|tj	d���|j|d��|j|g��|j|d��|j|t���|j|t��y)N��c��?�@��?@�abc)
r�number_check�
assertTruer1r'r6r9�assertFalse�object�NULL)r�checks  r�
test_checkzCAPITest.test_checkJs����&�&������a��!�����i�0�0��3�4�5�����g�.�.�r�2�3�4�����c�
�#�����i�0�0��6�7�8�����d��$�����r��#�����u��&�����v�x��)�����t��%rc���tjtjtjtjd�}|j�D]}\}}|j
t|t��|j
t|t�tt|�}dD])}	||�|j||�||���+�y#t$r|j
t||�Y�QwxYw)N)�__neg__�__pos__�__abs__�
__invert__)r�*������Q�	@rM)r�number_negative�number_positive�number_absolute�
number_invert�items�assertRaises�	TypeErrorrR�SystemErrorrS�getattr�operator�assertEqual)r�methmap�name�func�op�xs      r�test_unary_opszCAPITest.test_unary_opsZs���'�7�7�'�7�7�'�7�7�!*�!8�!8�:��
"�-�-�/�J�D�$����i��v�x�8�
���k�4��6���4�(�B�,��5��q�E��$�$�T�!�W�b��e�4�
-�*��!�:��%�%�i��q�9�:�s�&C� C4�3C4c�z�idtj�dtj�dtj�dtj�dtj
�dtj�dtj�dtj�d	tj�d
tj�dtj�dtj�d
tj�dtj�dtj�dtj �dtj"�tj$tj&tj(tj*tj,tj.tj0tj2tj4tj6d�
�}|j9�D]�\}}gd�}|D]B}|j;t<|t?�|�|j;t<||t?���DtAtB|tD�}tGjH|d�D]/\}}	|||�|jK|||�|||���1��y#t<tLtNf$r(}|j;|jP|||�Yd}~�ld}~wwxYw)N�__add__�__sub__�__mul__�
__matmul__�__floordiv__�__truediv__�__mod__�
__divmod__�
__lshift__�
__rshift__�__and__�__xor__�__or__�__pow__�__iadd__�__isub__�__imul__)
�__imatmul__�
__ifloordiv__�__itruediv__�__imod__�__ilshift__�__irshift__�__iand__�__ixor__�__ior__�__ipow__)rr[r]r\�{rM�))r�
number_add�number_subtract�number_multiply�number_matrixmultiply�number_floordivide�number_truedivide�number_remainder�
number_divmod�
number_lshift�
number_rshift�
number_and�
number_xor�	number_or�number_power�number_inplaceadd�number_inplacesubtract�number_inplacemultiply�number_inplacematrixmultiply�number_inplacefloordivide�number_inplacetruedivide�number_inplaceremainder�number_inplacelshift�number_inplacershift�number_inplaceand�number_inplacexor�number_inplaceor�number_inplacepowerrbrcrdrRrfrg�divmod�	itertools�combinationsrh�
ValueError�ZeroDivisionErrorr&)	rrirjrk�casesrmrl�yrs	         r�test_binary_opszCAPITest.test_binary_opsqsv���9�i�2�2���i�7�7���i�7�7�� ��!@�!@��"�9�#?�#?�	�
!�)�"=�"=���i�8�8�
� ��!8�!8�� ��!8�!8�� ��!8�!8���i�2�2���i�2�2���Y�0�0���i�4�4���y�:�:���y�?�?�� �y�?�?�!�"#,�"H�"H�$-�$G�$G�#,�#E�#E�(�@�@�"+�"@�"@�"+�"@�"@�(�:�:�(�:�:�'�8�8�(�<�<�5��:"�-�-�/�J�D�$�0�E����!�!�)�T�6�8�Q�?��!�!�)�T�1�f�h�?��
��4��0�B�!�.�.�u�a�8���1�;��q�!�H��$�$�T�!�Q�Z��A�q��:�
9�*��"�:�/@�A�A��%�%�c�m�m�T�1�a�@�@��A�s�	I>�>J:�J5�5J:Nzneeds _testbufferc��tj}tj}ddgddggd�}}}|j|||�|�|j|ddg�|j	t
|t
dgd�d�ddgddggd�}}}|j|||�|�|j||�|j	t
|t
dgd�d�y)NrIr���)rIr�r�r��rI)rr�r�rhrcrdr)r�add�
inplaceadd�a�b�rs      r�
test_misc_addzCAPITest.test_misc_add�s����"�"���0�0�
��a�&�1�a�&�,�a�1������Q���A�&�����Q��F�#����)�S�'�1�#�t�*<�a�@��a�&�1�a�&�,�a�1������A�q�)�1�-�����A�����)�Z��!��d�1C�Q�Grc���tj}tj}dgdddg}}}|j|||�|�|j||fdgdf�|j|||�|�|j||fdgdf�|j|dgd�g�|j	t
|t
dgd�d�|j	t
|dgd�|j	t|dgtdz�|j	t|ddgtdzdz�dgdddg}}}|j|||�|�|j||f|df�dg}|j|||�|�|j||fdgdf�|j	t
|t
dgd�d�|j	t|dgtdz�|j	t|ddgtdzdz�y)NrIr�r\r�rK)
rr�r�rhrcrdr�
OverflowErrorr�MemoryError)r�multiply�inplacemultiplyr�r�r�s      r�test_misc_multiplyzCAPITest.test_misc_multiply�s����,�,��#�:�:���#�q�1�a�&�a�1������!�Q���+����!�Q��1�#�q��*�����!�Q���+����!�Q��1�#�q��*�����1�#�r�*�B�/����)�X�w��s�D�/A�1�E����)�X��s�C�8����-��A�3���8J�K����+�x�!�Q����9J�Q�9N�O��#�q�1�a�&�a�1�������A�.��2����!�Q��!�Q��(�
�C�������A�.��2����!�Q��1�#�q��*����)�_�g�q�c�4�6H�!�L����-��1�#�~�PQ�?Q�R����+���A���PQ�@Q�TU�@U�Vrc	�X�tj}Gd�dt�}|j|ddd�t	ddd��|jt|ddd�|jt|dd|jt��|jt|ddt��y)Nc��eZdZdZy)�(CAPITest.test_misc_power.<locals>.HasPowr}Nr3rrr�HasPowr��s�� �Hrr�r�����?)
rr�rrh�powrcrdr'�NotImplementedrR)r�powerr�s   r�test_misc_powerzCAPITest.test_misc_power�s����&�&��	!�Z�	!�	
����q�"�a��#�a��Q�-�8����)�U�A�r�4�8����)�U�A�r�6�?�?�>�3R�S����)�U�A�r�6�8�<rc��tj}|jt�5}|td�ddd�|jdt
j��|jt�5}|ttj�ddd�|jdt
|j��|jt�5}|dd�ddd�y#1swY��xYw#1swY�bxYw#1swYyxYw)Nr[z6Did you mean "print(<message>, file=<output_stream>)"?z
Did you mean rI�spam)rr�rcrd�print�assertIn�str�	exception�max�sys�stderr�assertNotIn)r�rshift�contexts   r�test_rshift_printzCAPITest.test_rshift_print�s����(�(��
�
�
�y�
)�W��5�"��*��
�
�0�14�W�5F�5F�1G�	I�
�
�
�y�
)�W��3��
�
�#�*�����#�g�.?�.?�*@�A�
�
�
�y�
)�W��1�f��*�
)�*�
)��*�
)��*�
)�s#�C'�6C3�
C?�'C0�3C<�?Dc���tj}|j|d�d�|j|d�d�|j|d�d�|j|d�d�|j|td��d�|j|t	d��d�|j|t
j
d��d�|j|tj
d��d�|jt|tj
d��tj�5tjdt�|jt|tj
d	��ddd�|jt�5|j|tj
d	��d�ddd�|jt|tj!t��|jt|d
�|jt|t#��|jt$|t&�y#1swY��xYw#1swY��xYw)Nr[r�rI�42s42rJ��?�errorT��?)r�number_longrh�	bytearray�
memoryviewr1r'r6rcrd�warnings�catch_warnings�simplefilter�DeprecationWarning�assertWarnsr
r)rRrerS)r�longs  r�	test_longzCAPITest.test_long�s����$�$������b��2�&�����d��Q�'�����d��R�(�����e��b�)�����i��.�/��4�����j��/�0�"�5�����i�0�0��4�5�r�:�����g�.�.�r�2�3�R�8����)�T�7�+;�+;�C�+@�A�
�
$�
$�
&��!�!�'�+=�>����0�$��8H�8H��8N�O�'��
�
�0�
1����T�'�"2�"2�4�"8�9�1�=�2����,��g�.>�.>�|�.L�M����)�T�2�.����)�T�6�8�4����+�t�T�2�'�
&��2�
1�s�AI�),I)�I&�)I2c��tj}|j|d�d�|j|d�d�|j|d�d�|j|tj	d��d�|j|t
j	d��d�|j|t
j	d��d	�|j
t|tj	d
��tj�5tjdt�|j
t|tj	tt�d���ddd�|jt�5|j|tj	tt�d���d�ddd�|j
t|tj!t��|j
t|t
j	d��|j
t"|t
j	dd
z��|j
t|d�|j
t|t%��|j
t&|t(�y#1swY��=xYw#1swY��xYw)Nr�r�g�^@z1.25rLrJg�X@r\g�i�r�r�i�r�)r�number_floatrhr9r'r1rcrdr�r�r�r�r?�floatr�r
r)r�rRrerS)r�float_s  r�
test_floatzCAPITest.test_floats����'�'��������t�,�������d�+��������.�����	� 2� 2�4� 8�9�4�@�����	� 2� 2�2� 6�7��>�����	� 2� 2�2� 6�7��>����)�V�Y�-?�-?��-D�E�
�
$�
$�
&��!�!�'�+=�>����0�&�)�:L�:L�M^�Z�X]�M^�_c�Md�:e�f�'��
�
�0�
1����V�I�$6�$6�7H�z�%�7H��7N�$O�P�RV�W�2����,��	�0B�0B�<�0P�Q����)�V�Y�-?�-?��-E�F����-���1C�1C�A�t�G�1L�M����)�V�R�0����)�V�V�X�6����+�v�t�4�'�
&��2�
1�s�AJ+�
?J8�+J5�8Kc�Z�tj}|j|d�d�tj�5tj
dt�|jt|tjd��ddd�|jt�5|j|tjd��d�ddd�|jt|tjd��|jt|tjt��|jt|d�|jt|d�|jt|t��|jt|t �y#1swY��xYw#1swY��xYw)Nr�r�TrIr�r�r�)r�number_indexrhr�r�r�r�rcr1r'r�rdr
r)rRrerS)r�indexs  r�
test_indexzCAPITest.test_indexs-���&�&������r��B�'�
�
$�
$�
&��!�!�'�+=�>����0�%��9K�9K�D�9Q�R�'��
�
�0�
1����U�9�#5�#5�d�#;�<�a�@�2����)�U�I�,>�,>�s�,C�D����,��y�/A�/A�,�/O�P����)�U�D�1����)�U�D�1����)�U�F�H�5����+�u�d�3�'�
&��2�
1�s�AF�,F!�F�!F*c��tj}|j|dd�td��|j|dd�t	d��|j|dd�td��|j|dd�t
d��|jt|td�|jt|dd�|jt|dd�|jt|d	d�y)
N�
r�r����
r�r�r�)r�
number_tobaserh�bin�octr��hexrcrerSrd)r�tobases  r�test_tobasezCAPITest.test_tobase2s����(�(�������A���B��0������A���B��0������B���R��1������B���R��1����+�v�t�Q�7����+�v�q�!�4����)�V�T�1�5����)�V�T�1�5rc��tj}gtdd��t�t�D]}|j||t�|��!|j|tdzt�t�|j|tdz
t�t�|jt|tdzt�|jt|tdzt�|jt|tt�y)Ni�����r�)r�number_asssizet�rangerrrhr�rSrcr
rerd)r�asssizet�ns   r�
test_asssizetzCAPITest.test_asssizet@s����,�,��@�5��Q�<�@��@��@�A����X�a��7��;�A�����.��"3�T�:�N�K�����.��"3�T�:�N�K����-��>�B�3F�
�V����,��.�2�2E�|�T����+�x��y�Ar)rrrrUrnr��unittest�skipIfrr�r�r�rr�r�r�r�r�rrrrrGrGIs���&� 5�..;�f�X�_�_�W��_�&9�:�
H�;�
H��X�_�_�W��_�&9�:�W�;�W�4=�����3�25�64�&6�BrrG�__main__)r�rgr�rr��test.supportrr�
import_modulerrr�_testbufferr�ImportErrorrSr
rr.r1r6r9r?�	ExceptionrArE�TestCaserGr�mainrrr�<module>rs�����
���4�'�M�'�'��4�	�4��#�������,���
���j���
��9�	�	�	�	��	�BB�x� � �BB�J�z���H�M�M�O���A
���G��s�C�C�C

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists