Sindbad~EG File Manager

Current Path : /usr/local/lib/python3.9/test/__pycache__/
Upload File :
Current File : //usr/local/lib/python3.9/test/__pycache__/test_descr.cpython-39.opt-2.pyc

a

��g,��@sZddlZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
mZddlmZzddlZWney�dZYn0Gdd�de
j�ZGdd�de
j�ZGdd	�d	e
j�ZGd
d�de
j�ZGdd
�d
e
j�ZGdd�de
j�ZGdd�de
j�ZGdd�de�ZGdd�de
j�Zedk�rVe
��dS)�N)�deepcopy)�supportc@s�eZdZdd�Zd0dd�Zd1d	d
�Zd2d
d�Zd3dd�Zd4dd�Zd5dd�Z	dd�Z
dd�Zgfdd�Zd d!�Z
d"d#�Zd$d%�Zd&d'�Ze�d(�d)d*��Ze�d(�d+d,��Zd-d.�Zd/S)6�
OperatorsTestcOs�tjj|g|�Ri|��ddddddddd	d
ddd
dddddddd�|_t|j���D],\}}|��rr|d}nd|}||j|<qXddddddd�|_t|j���D],\}}|��r�|d}nd|}||j|<q�dS)N�+�-�*�@�/z//�divmodz**z<<z>>�&�^�|�cmp�<�<=�==�!=�>�>=)�add�sub�mul�matmul�truediv�floordivr
�pow�lshift�rshift�and�xor�orr�lt�le�eq�ne�gt�gez(a, b)za %s b�abs�~�int�float)�pos�negr'�invertr)r*z(a)z%s a)�unittest�TestCase�__init__�binops�list�items�islower�unops)�self�args�kwargs�name�expr�r;�+/usr/local/lib/python3.9/test/test_descr.pyr0sN�
�	
zOperatorsTest.__init__�len(a)�__len__c	Cs�d|i}|�t||�|�t|�}t||�}||jvrB|jd}q,|�t|d|�|j|�|�||�|�t||�}|�|�|�dS)N�ar�im_func��assertEqual�eval�type�getattr�__dict__�	__bases__)	r6r?�resr:�meth�d�t�m�bmr;r;r<�	unop_testJs


zOperatorsTest.unop_test�a+b�__add__c
Cs�||d�}|�t||�|�t|�}t||�}||jvrD|jd}q.|�t|d|�|j|�|�|||�|�t||�}	|�|	|�|�dS)N�r?�brr@rA)
r6r?rRrHr:rIrJrKrLrMr;r;r<�
binop_testZs



zOperatorsTest.binop_test�a[b:c]�__getitem__cCs�|||d�}|�t||�|�t|�}t||�}	||jvrF|jd}q0|�t|	d|	�|j|�|�|	|t||��|�t||�}
|�|
t||��|�dS)N�r?rR�crr@)rBrCrDrErFrG�slice)r6r?rRrWrHr:rIrJrKrLrMr;r;r<�sliceop_testis


zOperatorsTest.sliceop_test�a+=b�__iadd__c
Cs�t|�|d�}t||�|�|d|�t|�}t||�}||jvrP|jd}q:|�t|d|�|j|�t|�|d<||d|�|�|d|�t|�|d<t|d|�}	|	|�|�|d|�dS)NrQr?rr@�r�execrBrDrErFrG)
r6r?rRrH�stmtrIrJrKrLrMr;r;r<�
setop_testws


zOperatorsTest.setop_test�a[b]=c�__setitem__cCs�t|�||d�}t||�|�|d|�t|�}t||�}	||jvrR|jd}q<|�t|	d|	�|j|�t|�|d<|	|d||�|�|d|�t|�|d<t|d|�}
|
||�|�|d|�dS)NrVr?rr@r\)r6r?rRrWrHr^rIrJrKrLrMr;r;r<�set2op_test�s



zOperatorsTest.set2op_test�a[b:c]=dcCs�t|�|||d�}t||�|�|d|�t|�}	||	jvrJ|	jd}	q4t|	|�}
|�t|
d|
�|	j|�t|�|d<|
|dt||�|�|�|d|�t|�|d<t|d|�}|t||�|�|�|d|�dS)N)r?rRrWrJr?rr@)rr]rBrDrFrGrErX)r6r?rRrWrJrHr^rIZ
dictionaryrKrLrMr;r;r<�setsliceop_test�s


zOperatorsTest.setsliceop_testc	Cs6|�dgdgddgdd�|�gd�dddd�|�gd�dd	dd�|�gd�ddd
d�|�gd�d	dddgdd�|�dgdgddgd
d�|�ddgdgd�dd�|�gd�ddd�|�ddgdgd�dd�|�ddgdgd�dd�|�ddgddddgdd�|�gd�ddddggd�dd�dS) N��rOrP�rerf��b in a�__contains__�r�a[b]rUrTrZr[rh�rerfrerfrerf�a*=b�__imul__r=r>�a*b�__mul__�b*a�__rmul__r`ra�rerfrhrk���rerurvrkrc)rSrYr_rNrbrd�r6r;r;r<�
test_lists�s�zOperatorsTest.test_listsc	CsX|�ddd�dddd�|�ddd�dddd�|�ddd�dddd	�ddd�}g}t|���D]}|�|�qbg}t|�D]}|�|�q~|�||�g}|��D]}|�|�q�|�||�g}t�|�D]}|�|�q�|�||�ddd�}|�|dd
d�|�t	t
|�i�|�|�t	|��i�|�|�ddd�dddddd
�dd�dS)Nrfrk�rerhrerirjrrlrUr=r>rhrgr`ra)
rSr2�keys�append�iterrB�__iter__�dictrNrC�repr�__repr__rb)r6rJ�l1�i�lr;r;r<�
test_dicts�s4

�zOperatorsTest.test_dictscCs�||d�}|j��D]>\}}||vrd|}t||�rt||�}|�|||||�qt|j���D]<\}}||vrbd|}t||�rbt||�}|�||||�qbdS)NrQz__%s__)r1r3�hasattrrCrSr2r5rN)r6r?rR�skiprr9r:rHr;r;r<�number_operators�s




zOperatorsTest.number_operatorscCs||�dd�|�d��d�|�d��d�Gdd�dt�}|�|d�d�z|�dWntylYn0|�d	�dS)
N�drhrerc@seZdZdd�ZdS)z"OperatorsTest.test_ints.<locals>.CcSstS�N��NotImplemented�r6�otherr;r;r<rP�sz*OperatorsTest.test_ints.<locals>.C.__add__N)�__name__�
__module__�__qualname__rPr;r;r;r<�C�sr�ru�z+NotImplemented should have caused TypeError)r�rB�__bool__r)�	TypeError�fail�r6r�r;r;r<�	test_ints�szOperatorsTest.test_intscCs|�dd�dS)NgY@�@)r�rxr;r;r<�test_floatsszOperatorsTest.test_floatscCs�|jddgd�d�Gdd�dt�}|ddd	�}|�t|�d
�|�|jd�||dd	�}|�t|�d�|�|jd�|d
�}|�t|�d�|�|jd�dS)NyY@�@)	r!r"r%r&r)r*rr
�mod)r�c@s&eZdZdgZdd�Zdd�ZeZdS)z,OperatorsTest.test_complexes.<locals>.Number�precc_s$tj|g|�R�}|�dd�|_|S)Nr��)�complex�__new__�getr�)�clsr7�kwds�resultr;r;r<r�sz4OperatorsTest.test_complexes.<locals>.Number.__new__cSsJ|j}|jdkrd||jfS|jdkr6d||jfSd||j||jfS)N��%.*gz%.*gjz(%.*g+%.*gj))r��imag�real)r6r�r;r;r<r�s

z5OperatorsTest.test_complexes.<locals>.Number.__repr__N)r�r�r��	__slots__r�r��__str__r;r;r;r<�Numbersr�g��Q�	@rv�r�z3.14rfz3.1gPm@z234.5r�)r�r�rBr�r�)r6r�r?r;r;r<�test_complexesszOperatorsTest.test_complexescCs2|�t�dd�tdd��|�t�dd�d�dS)Nr�g@r�reg�)rBr��__radd__r*�__rsub__rxr;r;r<�test_explicit_reverse_methods'sz+OperatorsTest.test_explicit_reverse_methods�"the module 'xxsubtype' is internalc	Cs.ddl}ddl}d&dd�}||j|j<|�|dg�|dg�|ddg�dd�|�|gd��ddd	d
�|�|gd��ddd	d
�|�|gd��dddd
�|�|gd��dd|ddg�dd
�|�|dg�|dg�|ddg�dd�|�|ddg�d|gd��dd�|�|gd��ddd�|�|ddg�d|gd��dd�|�|ddg�d|gd��dd�|�|ddg�dd|ddg�dd�|�	|gd��dd|ddg�|gd ��d!d�Gd"d#�d#|j�}|�}|�
|g�|�
|��d�|�d$�|�
|d$g�|�
|�
�d�|�d%�|�
|�
�d%�dS)'NrcSsddl}|�|�S�Nr)�	xxsubtype�spamlist)r��memo�spamr;r;r<r�1sz/OperatorsTest.test_spam_lists.<locals>.spamlistrerfrOrPrgrirjrkrlrUrTrZr[rhrmrnror=r>rprqrrrsr`rartrurvrwrcc@seZdZdd�ZdS)z(OperatorsTest.test_spam_lists.<locals>.CcSsdS�Nrer;rxr;r;r<�fooN�z,OperatorsTest.test_spam_lists.<locals>.C.fooN�r�r�r�r�r;r;r;r<r�Msr�r��*)N)�copyr��_deepcopy_dispatchr�rSrYr_rNrbrdrBr�r|�getstate�setstate)r6r�r�r�r�r?r;r;r<�test_spam_lists,sP
 �� ������

zOperatorsTest.test_spam_listsc
Csddl}ddl}ddd�}||j|j<|�|ddd��dddd	�|�|ddd��dddd	�|�|ddd��ddd
d�|ddd��}g}t|���D]}|�|�q�g}t|�D]}|�|�q�|�	||�g}|�
�D]}|�|�q�|�	||�g}t|i���
|�D]}|�|��q|�	||�ddd�}||�}	|�|	ddd
�|�|	t
|�dd�|�|ddd��dd|dddd��dd�Gdd�d|j�}
|
�}|�	t|���g�|�	|��d�d|d<|�	t|���dg�|�	|��d�|�d�|�	|��d�dS)NrcSs2ddl}|��}t|���D]\}}|||<q|Sr�)r��spamdictr2r3)rJr�r��sd�k�vr;r;r<r�\s

z/OperatorsTest.test_spam_dicts.<locals>.spamdictrfrkrzrerirjrlrUr=r>zrepr(a)r�rhrgr`rac@seZdZdd�ZdS)z(OperatorsTest.test_spam_dicts.<locals>.CcSsdSr�r;rxr;r;r<r��r�z,OperatorsTest.test_spam_dicts.<locals>.C.fooNr�r;r;r;r<r�sr��barr��r�r�r�)N)r�r�r�r�rSr2r{r|r}rBr~rDrNr�rbr3r�r�r�)r6r�r�r�rJr�r�r�Z	straightdZspamdr�r?r;r;r<�test_spam_dictsXsL

"�
zOperatorsTest.test_spam_dictscCs|�ttj���tj�dSr�)rB�range�sys�maxsizer>rxr;r;r<�test_wrap_lenfunc_bad_cast�sz(OperatorsTest.test_wrap_lenfunc_bad_castN)r=r>)rOrP)rTrU)rZr[)r`ra)rcra)r�r�r�r0rNrSrYr_rbrdryr�r�r�r�r�r�r�impl_detailr�r�r�r;r;r;r<rs&0





!
+
1rcs.eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Z�fd)d*�Zejd+d,��Ze�d-�d.d/��Zd0d1�Zejd2d3��Ze�d-�d4d5��Zd6d7�Z d8d9�Z!d:d;�Z"e#j$d<d=��Z%d>d?�Z&e#j$d@dA��Z'dBdC�Z(dDdE�Z)dFdG�Z*e�dH�dIdJ��Z+dKdL�Z,dMdN�Z-dOdP�Z.dQdR�Z/e#�0e1j2j3dSkdT�dUdV��Z4ej5dWdX��Z6dYdZ�Z7d[d\�Z8d]d^�Z9�fd_d`�Z:dadb�Z;dcdd�Z<dedf�Z=dgdh�Z>didj�Z?dkdl�Z@dmdn�ZAdodp�ZBdqdr�ZCdsdt�ZDdudv�ZEdwdx�ZFdydz�ZGd{d|�ZHd}d~�ZIdd��ZJd�d��ZKd�d��ZLd�d��ZMd�d��ZNd�d��ZOd�d��ZPd�d��ZQd�d��ZRd�d��ZSd�d��ZTd�d��ZUd�d��ZVd�d��ZWd�d��ZXd�d��ZYd�d��ZZd�d��Z[d�d��Z\d�d��Z]d�d��Z^d�d��Z_e�d��d�d���Z`d�d��Zad�d��Zbd�d��Zcd�d��Zdd�d��Zed�d��Zfd�d��Zgd�d��Zhd�d��Zid�d��Zjd�dÄZkd�dńZld�dDŽZmd�dɄZnd�d˄Zod�d̈́Zpd�dτZqd�dфZrd�dӄZsd�dՄZtd�dׄZud�dلZvd�dۄZwd�d݄Zxd�d߄Zyd�d�Zzd�d�Z{d�d�Z|d�d�Z}d�d�Z~d�d�Z�fd�d�Z�e#�0e�d�ud�d�d��Z��Z�S)��ClassPropertiesAndMethodscCs|�t||�d||f�dS)Nz%r has no attribute %r)�
assertTruer��r6�objr9r;r;r<�
assertHasAttr�s
�z'ClassPropertiesAndMethods.assertHasAttrcCs|�t||�d||f�dS)Nz%r has unexpected attribute %r)�assertFalser�r�r;r;r<�assertNotHasAttr�s
�z*ClassPropertiesAndMethods.assertNotHasAttrc	s���ttt����it�t�}��|i���|jt���|t�G�fdd�dt�}��t|t��|d�}��|jd�|ddd�}��|ddko�|dd�|�}��|jd	���|��d	�|�	d
���|jd
���|��d
�|�	d���|jd���|��d���|dd
�d
|d<��|dd
�d}t
|�D]0}|�||<t
|�D]}|||||<�qh�qRt
|�D].}t
|�D]}��|||||��q��q�dS)Ncs@eZdZdZ�fdd�Zdd�Z�fdd�Zdd	�Zd
d�ZdS)
z6ClassPropertiesAndMethods.test_python_dicts.<locals>.C���csD|r��t|�d�|d|_|r@t|���D]\}}|||<q.dS�Nrer)rB�len�stater2r3)�
self_localr?�kwr�r�rxr;r<r0�s
z?ClassPropertiesAndMethods.test_python_dicts.<locals>.C.__init__cSs|�|d�Sr�)r��r6�keyr;r;r<rU�szBClassPropertiesAndMethods.test_python_dicts.<locals>.C.__getitem__cs"��|td��t�|||�dSr�)�assertIsInstancerDrra)r�r��valuerxr;r<ra�szBClassPropertiesAndMethods.test_python_dicts.<locals>.C.__setitem__cSs
||_dSr��r��r6r�r;r;r<r��sz?ClassPropertiesAndMethods.test_python_dicts.<locals>.C.setstatecSs|jSr�r�rxr;r;r<r��sz?ClassPropertiesAndMethods.test_python_dicts.<locals>.C.getstateN)	r�r�r�r�r0rUrar�r�r;rxr;r<r��sr�r�rerfr�r�r�r�r�
r���2)r��
issubclassrr�rB�assertIs�	__class__r�r�r�r�)	r6rJr��a1�a2r?�Nr��jr;rxr<�test_python_dicts�s@


z+ClassPropertiesAndMethods.test_python_dictscCslGdd�dt�}|�}|�gd��|�|dd�|�|dd�|�|dd	�|�|dd
�d�dS)Nc@seZdZdd�ZdS)z6ClassPropertiesAndMethods.test_python_lists.<locals>.CcSs&t|t�r|j|jfSt�||�dS�Nr�)�
isinstancerX�start�stopr2rU�r6r�r;r;r<rU�s
zBClassPropertiesAndMethods.test_python_lists.<locals>.C.__getitem__N�r�r�r�rUr;r;r;r<r��sr��rrerfrr�re�erf�f��)r�r�)r2�extendrB�r6r�r?r;r;r<�test_python_lists�sz+ClassPropertiesAndMethods.test_python_listscs�Gdd�dtd�}|�}|�|��d�|�d�|�|��d�Gdd�dt�}Gdd	�d	|d�}|�|��|�|�}|�|j|�Gd
d�dt�}Gdd�d|d�}|�|jd
�|�}|�|jd
�Gdd�dt��G�fdd�dt�}Gdd�d|d�}|�|jd�|�|j	d�|�
d|j�|�}|�|��d�G�fdd�dt��Gdd�d�d�}	Gdd�d|	�}
Gdd�d|	�}Gdd	�d	||
�}|�|��
�d�Gdd �d |
|�}|�|��
�d!�G�fd"d#�d#t��Gd$d�d�d�}	|	�}|�|d%�d&|_|�|jd&�|�|jd'�Gd(d)�d)���}Gd*d�d|d�}	Gd+d�d|	�}
Gd,d�d|	�}Gd-d	�d	||
�}|�|�jd�G�fd.d/�d/t��Gd0d�d�d�}|��jd
�|�}|�t|�|�|��jd
�Gd1d�dt�}|�}z
|�Wnt�yYn0|�d2�Gd3d�dt�}	Gd4d�dt�}
Gd5d�dt|	d�}Gd6d	�d	|
|�}|�|	t|��g�G�fd7d8�d8t�}
G�fd9d:�d:|
�}Gd;d�d|
d�}	|�d8g�����Gd<d�d|d�}
|�d:d8g�����Gd=d�d|	|
�}|�d:d8g�����|�
d>|j�Gd?d@�d@|
|	�}|�d:d8g�����|�
d>|j�GdAd	�d	|td�}|�d:d8g�����|�
d>|j�GdBd �d ||
d�}|�d:d8g�����|�
d>|j�t���fdCdD�}GdEdF�dF|d�}GdGdH�dHt|d�}GdIdJ�dJ||d�}|��|�|��|�|��|�g�G��fdKdL�dL�}G��fdMdN�dN|�}GdOd�d|d�}	|�|t|	��|�dLg�����|�dLg�����GdPd�d|d�}
|�|t|
��|�dNdLg�����|�dNdLg�����GdQd�d|	|
�}|�|t|��|�dNdLg�����|�dNdLg�����GdRd@�d@|
|	�}|�|t|��|�dNdLg�����|�dNdLg�����|�t��$GdSd	�d	|td�}Wd�n1�s�0YGdTd �d ||d�}|�|t|��|�dNdLg�����|�dNdLg�����GdUdV�dVt�|�}|�|t|��|�dNdLg�����|�dNdLg�����GdWdX�dX|t��}|�|t|��|�dNdLg�����|�dNdLg�����|�t��$GdYdF�dF|t��}Wd�n1�s40Y|�t��$GdZdF�dFt�|�}Wd�n1�st0YdS)[Nc@s$eZdZdd�Zdd�Zdd�ZdS)�3ClassPropertiesAndMethods.test_metaclass.<locals>.CcSs
d|_dSr��Z	_C__staterxr;r;r<r0�sz<ClassPropertiesAndMethods.test_metaclass.<locals>.C.__init__cSs|jSr�r�rxr;r;r<r��sz<ClassPropertiesAndMethods.test_metaclass.<locals>.C.getstatecSs
||_dSr�r�r�r;r;r<r��sz<ClassPropertiesAndMethods.test_metaclass.<locals>.C.setstateN�r�r�r�r0r�r�r;r;r;r<r��sr���	metaclassrr�c@seZdZdd�ZdS)z<ClassPropertiesAndMethods.test_metaclass.<locals>._metaclasscSs|Sr�r;�r�r;r;r<�myself�r�zCClassPropertiesAndMethods.test_metaclass.<locals>._metaclass.myselfN)r�r�r�r�r;r;r;r<�
_metaclass�sr�c@seZdZdS��3ClassPropertiesAndMethods.test_metaclass.<locals>.DN�r�r�r�r;r;r;r<�D�src@seZdZdd�ZdS)z4ClassPropertiesAndMethods.test_metaclass.<locals>.M1cSsd|d<t�||||�S)Nre�__spam__�rDr�)r�r9�basesrr;r;r<r��sz<ClassPropertiesAndMethods.test_metaclass.<locals>.M1.__new__N�r�r�r�r�r;r;r;r<�M1�src@seZdZdS�r�Nrr;r;r;r<r��srec@seZdZdS)z;ClassPropertiesAndMethods.test_metaclass.<locals>._instanceNrr;r;r;r<�	_instance�sr
cs$eZdZedd��Z�fdd�ZdS)z4ClassPropertiesAndMethods.test_metaclass.<locals>.M2cSs t�|�}||_||_||_|Sr�)�objectr�r9rr)r�r9rrr6r;r;r<r��s

z<ClassPropertiesAndMethods.test_metaclass.<locals>.M2.__new__cs<��}|jD]*}|�d�rqt|||j|�||��q|S)N�__)r�
startswith�setattr�__get__)r6�itr��r
r;r<�__call__s

z=ClassPropertiesAndMethods.test_metaclass.<locals>.M2.__call__N)r�r�r��staticmethodr�rr;rr;r<�M2�s
rc@seZdZdd�ZdS)r�cSsdS�Nr�r;rxr;r;r<r�sz8ClassPropertiesAndMethods.test_metaclass.<locals>.C.spamN�r�r�r�r�r;r;r;r<r�
sr;r�r�cseZdZ��fdd�Z�ZS)z;ClassPropertiesAndMethods.test_metaclass.<locals>.autosupercsZt�|��||||�}|dd�dkr4|dd�}q|rBd|}nd}t||t|��|S)Nre�_z
_%s__superZ__super)�superr�r)r�r9rrr�)r��	autosuperr;r<r�s�
zCClassPropertiesAndMethods.test_metaclass.<locals>.autosuper.__new__�r�r�r�r��
__classcell__r;)r�r�r<rsrc@seZdZdd�ZdS)�3ClassPropertiesAndMethods.test_metaclass.<locals>.AcSsdS�N�Ar;rxr;r;r<rI%sz8ClassPropertiesAndMethods.test_metaclass.<locals>.A.methN�r�r�r�rIr;r;r;r<r$src@seZdZdd�ZdS)�3ClassPropertiesAndMethods.test_metaclass.<locals>.BcSsd|j��S�N�B��	_B__superrIrxr;r;r<rI(sz8ClassPropertiesAndMethods.test_metaclass.<locals>.B.methNr r;r;r;r<r#'sr#c@seZdZdd�ZdS)r�cSsd|j��S�Nr���	_C__superrIrxr;r;r<rI+sz8ClassPropertiesAndMethods.test_metaclass.<locals>.C.methNr r;r;r;r<r�*sc@seZdZdd�ZdS)rcSsd|j��S�Nr)�	_D__superrIrxr;r;r<rI.sz8ClassPropertiesAndMethods.test_metaclass.<locals>.D.methNr r;r;r;r<r-sZDCBAc@seZdZdd�ZdS)�3ClassPropertiesAndMethods.test_metaclass.<locals>.EcSsd|j��S)N�E)Z	_E__superrIrxr;r;r<rI2sz8ClassPropertiesAndMethods.test_metaclass.<locals>.E.methNr r;r;r;r<r,1sr,ZEBCAcseZdZ��fdd�Z�ZS)z>ClassPropertiesAndMethods.test_metaclass.<locals>.autopropertyc	s�i}|��D]v\}}|�d�rL|dd�}|�|d�\}}|}||f||<q|�d�r|dd�}|�|d�\}}|}||f||<q|��D]\}\}}t||�||<q�t�|��||||�S)NZ_get_ru)NNZ_set_)r3r
r��propertyrr�)	r�r9rr�hitsr��valr��set)r��autopropertyr;r<r�9s"

�zFClassPropertiesAndMethods.test_metaclass.<locals>.autoproperty.__new__rr;)r1rr<r16sr1c@seZdZdd�Zdd�ZdS)rcSs|jSr���_A__xrxr;r;r<�_get_xKs�:ClassPropertiesAndMethods.test_metaclass.<locals>.A._get_xcSs||_dSr�r2�r6�xr;r;r<�_set_xMsz:ClassPropertiesAndMethods.test_metaclass.<locals>.A._set_xN)r�r�r�r4r8r;r;r;r<rJsr7r�i�c@seZdZdS)z@ClassPropertiesAndMethods.test_metaclass.<locals>.multimetaclassNrr;r;r;r<�multimetaclassUsr9c@seZdZdd�ZdS)rcSsdSrr;rxr;r;r<r4Ysr5N�r�r�r�r4r;r;r;r<rXsc@seZdZdd�ZdS)r!cSsd|j��Sr")r%r4rxr;r;r<r4\sz:ClassPropertiesAndMethods.test_metaclass.<locals>.B._get_xNr:r;r;r;r<r#[sc@seZdZdd�ZdS)r�cSsd|j��Sr&)r(r4rxr;r;r<r4_sz:ClassPropertiesAndMethods.test_metaclass.<locals>.C._get_xNr:r;r;r;r<r�^sc@seZdZdd�ZdS)rcSsd|j��Sr))r*r4rxr;r;r<r4bsz:ClassPropertiesAndMethods.test_metaclass.<locals>.D._get_xNr:r;r;r;r<rascseZdZdZ�fdd�ZdS)z3ClassPropertiesAndMethods.test_metaclass.<locals>.Trcs�jd7_dSr���counter�r6r7��Tr;r<r0isz<ClassPropertiesAndMethods.test_metaclass.<locals>.T.__init__N)r�r�r�r<r0r;r>r;r<r?gsr?c@seZdZdSr	rr;r;r;r<r�ksc@seZdZdSr	rr;r;r;r<r�rr�z5calling object w/o call method should raise TypeErrorc@seZdZdd�ZdS)rc_stj|i|��Sr�r�r7r8r;r;r<r�{sz;ClassPropertiesAndMethods.test_metaclass.<locals>.A.__new__Nrr;r;r;r<rzsc@seZdZdS�r!Nrr;r;r;r<r#~sc@seZdZdSr	rr;r;r;r<r��sc@seZdZdSrrr;r;r;r<r�scs.eZdZe��fdd��Zedd��Z�ZS)z7ClassPropertiesAndMethods.test_metaclass.<locals>.AMetacs��d�t��||||�S)N�AMeta�r|rr���mclsr9r�ns�r��	new_callsr;r<r��s
z?ClassPropertiesAndMethods.test_metaclass.<locals>.AMeta.__new__cSsiSr�r;�rEr9rr;r;r<�__prepare__�szCClassPropertiesAndMethods.test_metaclass.<locals>.AMeta.__prepare__�r�r�r�rr��classmethodrJrr;�rHrr<rB�srBcs2eZdZe��fdd��Ze�fdd��Z�ZS)z7ClassPropertiesAndMethods.test_metaclass.<locals>.BMetacs��d�t��||||�S)N�BMetarCrDrGr;r<r��s
z?ClassPropertiesAndMethods.test_metaclass.<locals>.BMeta.__new__cst��||�}d|d<|S)NT�BMeta_was_here)rrJrDrr;r<rJ�szCClassPropertiesAndMethods.test_metaclass.<locals>.BMeta.__prepare__rKr;rMrr<rN�srNc@seZdZdS�rNrr;r;r;r<r�sc@seZdZdSrArr;r;r;r<r#�sc@seZdZdSr	rr;r;r;r<r��srOc@seZdZdS�z4ClassPropertiesAndMethods.test_metaclass.<locals>.C2Nrr;r;r;r<�C2�srRc@seZdZdSrrr;r;r;r<r�sc@seZdZdS�r+Nrr;r;r;r<r,�scs�Sr�r;r@)�markerr;r<�func�sz6ClassPropertiesAndMethods.test_metaclass.<locals>.funcc@seZdZdS�z3ClassPropertiesAndMethods.test_metaclass.<locals>.XNrr;r;r;r<�X�srWc@seZdZdS)z3ClassPropertiesAndMethods.test_metaclass.<locals>.YNrr;r;r;r<�Y�srXc@seZdZdS)z3ClassPropertiesAndMethods.test_metaclass.<locals>.ZNrr;r;r;r<�Z�srYcs.eZdZ��fdd�Ze�fdd��Z�ZS)z:ClassPropertiesAndMethods.test_metaclass.<locals>.ANotMetacs��d�t��|�S�N�ANotMetarC�rEr7r8rGr;r<r��s
zBClassPropertiesAndMethods.test_metaclass.<locals>.ANotMeta.__new__cs��d�iSrZ�r|rI)�
prepare_callsr;r<rJ�s
zFClassPropertiesAndMethods.test_metaclass.<locals>.ANotMeta.__prepare__�r�r�r�r�rLrJrr;�rHr^rr<r[�sr[cs0eZdZ��fdd�Ze��fdd��Z�ZS)z:ClassPropertiesAndMethods.test_metaclass.<locals>.BNotMetacs��d�t��|�S�N�BNotMetarCr\rGr;r<r��s
zBClassPropertiesAndMethods.test_metaclass.<locals>.BNotMeta.__new__cs��d�t��||�Sra)r|rrJrI)r�r^r;r<rJ�s
zFClassPropertiesAndMethods.test_metaclass.<locals>.BNotMeta.__prepare__r_r;r`rr<rb�srbc@seZdZdSrPrr;r;r;r<r�sc@seZdZdSrArr;r;r;r<r#�sc@seZdZdSr	rr;r;r;r<r��sc@seZdZdSrQrr;r;r;r<rRsc@seZdZdSrrr;r;r;r<rsc@seZdZdSrSrr;r;r;r<r,sc@seZdZdS)z3ClassPropertiesAndMethods.test_metaclass.<locals>.FNrr;r;r;r<�Fsrcc@seZdZdS)z4ClassPropertiesAndMethods.test_metaclass.<locals>.F2Nrr;r;r;r<�F2srdc@seZdZdSrVrr;r;r;r<rW*sc@seZdZdSrVrr;r;r;r<rW-s)rDrBr�r�r�r�rrr9r�assertInrr�rIr�r7r3r<r�r�r��clearrF�assertRaisesr))r6r�r?r�rrJrrWrrr#r,r9rBrNrRrUrWrXrYr[rbrcrdr;)r?r
r1rrTrHr^r<�test_metaclass�s 

		44z(ClassPropertiesAndMethods.test_metaclasscs�g�tt��G��fdd�d��}|d�}d|_|j}|`|��gd��zGdd�dtjt�}WntytYn0|�d�d	d
��Gdd�d����fd
d�t	d�D�}|���
�|�dS)NcsBeZdZ�fdd�Z��fdd�Z��fdd�Z��fdd�Zd	S)
z<ClassPropertiesAndMethods.test_module_subclasses.<locals>.MMcs��||�dSr�)r0�r6r9)�MTr;r<r05szEClassPropertiesAndMethods.test_module_subclasses.<locals>.MM.__init__cs��d|f���||�S)NrE)r|�__getattribute__ri�rj�logr;r<rk7szMClassPropertiesAndMethods.test_module_subclasses.<locals>.MM.__getattribute__cs"��d||f���|||�dS)Nr)r|�__setattr__�r6r9r�rlr;r<rn:szHClassPropertiesAndMethods.test_module_subclasses.<locals>.MM.__setattr__cs��d|f���||�dS)N�delattr)r|�__delattr__rirlr;r<rq=szHClassPropertiesAndMethods.test_module_subclasses.<locals>.MM.__delattr__N)r�r�r�r0rkrnrqr;rlr;r<�MM4srrr?r�))rr�r��rEr�)rpr�c@seZdZdS)z@ClassPropertiesAndMethods.test_module_subclasses.<locals>.ModuleNrr;r;r;r<�ModuleJsrtz?inheriting from ModuleType and str at the same time should failcSsd�tjtjdd��S)Nr�r�)r�)�join�random�choices�string�
ascii_lettersr;r;r;r<�random_nameSszEClassPropertiesAndMethods.test_module_subclasses.<locals>.random_namec@seZdZdS)z;ClassPropertiesAndMethods.test_module_subclasses.<locals>.ANrr;r;r;r<rUsrcsg|]}t���fi��qSr;�rD��.0r�)rrzr;r<�
<listcomp>Wr�zDClassPropertiesAndMethods.test_module_subclasses.<locals>.<listcomp>r�)rDr�r�rB�types�
ModuleType�strr�r�r��__subclasses__)r6rrr?r7rtZ
subclassesr;)rrjrmrzr<�test_module_subclasses0s"
z0ClassPropertiesAndMethods.test_module_subclassescsLGdd�dt����}|�|��d�|�d�|�|��d�G�fdd�dt��}|�}|�t|���g�d|d<|�t|���d	g�|�|dd�|�|��d�|�d�|�|��d�|�|j|t�tf�Gd
d�dt�}Gdd
�d
|t�}|�|��	�d�|�t
|��d�|�|��	�d�|�t
|��d�dS)Nc@s$eZdZdd�Zdd�Zdd�ZdS)z>ClassPropertiesAndMethods.test_multiple_inheritance.<locals>.CcSs
d|_dSr�r�rxr;r;r<r0]szGClassPropertiesAndMethods.test_multiple_inheritance.<locals>.C.__init__cSs|jSr�r�rxr;r;r<r�_szGClassPropertiesAndMethods.test_multiple_inheritance.<locals>.C.getstatecSs
||_dSr�r�r�r;r;r<r�aszGClassPropertiesAndMethods.test_multiple_inheritance.<locals>.C.setstateNr�r;r;r;r<r�\sr�rr�cseZdZ�fdd�ZdS)z>ClassPropertiesAndMethods.test_multiple_inheritance.<locals>.Dcsti��|���|�dSr�)rDr0rx�r�r;r<r0hszGClassPropertiesAndMethods.test_multiple_inheritance.<locals>.D.__init__N�r�r�r�r0r;r�r;r<rgsr�world�hello)r�r�c@seZdZdd�Zdd�ZdS)zAClassPropertiesAndMethods.test_multiple_inheritance.<locals>.NodecSst|���Sr�)r)r�rxr;r;r<�__int__wszIClassPropertiesAndMethods.test_multiple_inheritance.<locals>.Node.__int__cSsdS)NZ23r;rxr;r;r<r�yszEClassPropertiesAndMethods.test_multiple_inheritance.<locals>.Node.fooN)r�r�r�r�r�r;r;r;r<�Nodevsr�c@seZdZdd�ZdS)zAClassPropertiesAndMethods.test_multiple_inheritance.<locals>.FragcSsdS)NZ42r;rxr;r;r<r�|szEClassPropertiesAndMethods.test_multiple_inheritance.<locals>.Frag.fooNr�r;r;r;r<�Frag{sr��r�)rrBr�r�rr2r{r3�__mro__r�r))r6r?rrJr�r�r;r�r<�test_multiple_inheritanceZs*

z3ClassPropertiesAndMethods.test_multiple_inheritancecCs�Gdd�dt�}|�|���d�Gdd�d|�}|�|���d�|�|���d�Gdd�d|�}|�|���d�|�|���d�Gdd�d||�}|�|���d�|�|���d�|�|j||||tf�Gd	d
�d
||�}|�|���d�|�|���d�|�|j||||tf�zGdd�d||�}Wnt�yPYn0|�d
�zGdd�d||�}Wnt�y�Yn0|�d�dS)Nc@seZdZdd�ZdS)z=ClassPropertiesAndMethods.test_diamond_inheritance.<locals>.AcSsdSrr;rxr;r;r<r��r�zBClassPropertiesAndMethods.test_diamond_inheritance.<locals>.A.spamNrr;r;r;r<r�src@seZdZdd�Zdd�ZdS)z=ClassPropertiesAndMethods.test_diamond_inheritance.<locals>.BcSsdSr"r;rxr;r;r<�boo�r�zAClassPropertiesAndMethods.test_diamond_inheritance.<locals>.B.boocSsdSr"r;rxr;r;r<r��r�zBClassPropertiesAndMethods.test_diamond_inheritance.<locals>.B.spamN)r�r�r�r�r�r;r;r;r<r#�sr#c@seZdZdd�ZdS)z=ClassPropertiesAndMethods.test_diamond_inheritance.<locals>.CcSsdSr&r;rxr;r;r<r��r�zAClassPropertiesAndMethods.test_diamond_inheritance.<locals>.C.booN)r�r�r�r�r;r;r;r<r��sr�c@seZdZdS)z=ClassPropertiesAndMethods.test_diamond_inheritance.<locals>.DNrr;r;r;r<r�r�rc@seZdZdS)z=ClassPropertiesAndMethods.test_diamond_inheritance.<locals>.ENrr;r;r;r<r,�r�r,c@seZdZdS)z=ClassPropertiesAndMethods.test_diamond_inheritance.<locals>.FNrr;r;r;r<rc�r�rcz#expected MRO order disagreement (F)c@seZdZdS)z=ClassPropertiesAndMethods.test_diamond_inheritance.<locals>.GNrr;r;r;r<�G�r�r�z#expected MRO order disagreement (G))rrBr�r�r�r�r�)r6rr#r�rr,rcr�r;r;r<�test_diamond_inheritance�s4
z2ClassPropertiesAndMethods.test_diamond_inheritancec
Cs�Gdd�dt�}Gdd�dt�}Gdd�dt�}Gdd�d|�}Gd	d
�d
|�}Gdd�d||||�}|�|j||||||tf�dS)
Nc@seZdZdS)z<ClassPropertiesAndMethods.test_ex5_from_c3_switch.<locals>.ANrr;r;r;r<r�r�rc@seZdZdS)z<ClassPropertiesAndMethods.test_ex5_from_c3_switch.<locals>.BNrr;r;r;r<r#�r�r#c@seZdZdS)z<ClassPropertiesAndMethods.test_ex5_from_c3_switch.<locals>.CNrr;r;r;r<r��r�r�c@seZdZdS)z<ClassPropertiesAndMethods.test_ex5_from_c3_switch.<locals>.XNrr;r;r;r<rW�r�rWc@seZdZdS)z<ClassPropertiesAndMethods.test_ex5_from_c3_switch.<locals>.YNrr;r;r;r<rX�r�rXc@seZdZdS)z<ClassPropertiesAndMethods.test_ex5_from_c3_switch.<locals>.ZNrr;r;r;r<rY�r�rY�rrBr�)r6rr#r�rWrXrYr;r;r<�test_ex5_from_c3_switch�sz1ClassPropertiesAndMethods.test_ex5_from_c3_switchc	Cs�Gdd�dt�}Gdd�d|�}Gdd�d|�}Gdd�d|�}Gd	d
�d
|�}Gdd�d||�}Gd
d�d|�}Gdd�d||�}|�|j|||||tf�|�|j||||tf�|�|j||||||||tf	�dS)Nc@seZdZdS)z9ClassPropertiesAndMethods.test_monotonicity.<locals>.BoatNrr;r;r;r<�Boat�r�r�c@seZdZdS)z<ClassPropertiesAndMethods.test_monotonicity.<locals>.DayBoatNrr;r;r;r<�DayBoat�r�r�c@seZdZdS)z>ClassPropertiesAndMethods.test_monotonicity.<locals>.WheelBoatNrr;r;r;r<�	WheelBoat�r�r�c@seZdZdS)z?ClassPropertiesAndMethods.test_monotonicity.<locals>.EngineLessNrr;r;r;r<�
EngineLess�r�r�c@seZdZdS)zCClassPropertiesAndMethods.test_monotonicity.<locals>.SmallMultihullNrr;r;r;r<�SmallMultihull�r�r�c@seZdZdS)zCClassPropertiesAndMethods.test_monotonicity.<locals>.PedalWheelBoatNrr;r;r;r<�PedalWheelBoat�r�r�c@seZdZdS)zCClassPropertiesAndMethods.test_monotonicity.<locals>.SmallCatamaranNrr;r;r;r<�SmallCatamaran�r�r�c@seZdZdS)z;ClassPropertiesAndMethods.test_monotonicity.<locals>.PedaloNrr;r;r;r<�Pedalo�r�r�r�)	r6r�r�r�r�r�r�r�r�r;r;r<�test_monotonicity�s&��
��z+ClassPropertiesAndMethods.test_monotonicityc
Cs�Gdd�dt�}Gdd�dt�}Gdd�dt�}Gdd�d||�}Gd	d
�d
||�}Gdd�d||�}|�|j||||||tf�dS)
Nc@seZdZdS)zAClassPropertiesAndMethods.test_consistency_with_epg.<locals>.PaneNrr;r;r;r<�Pane�r�r�c@seZdZdS)zKClassPropertiesAndMethods.test_consistency_with_epg.<locals>.ScrollingMixinNrr;r;r;r<�ScrollingMixin�r�r�c@seZdZdS)zIClassPropertiesAndMethods.test_consistency_with_epg.<locals>.EditingMixinNrr;r;r;r<�EditingMixin�r�r�c@seZdZdS)zKClassPropertiesAndMethods.test_consistency_with_epg.<locals>.ScrollablePaneNrr;r;r;r<�ScrollablePane�r�r�c@seZdZdS)zIClassPropertiesAndMethods.test_consistency_with_epg.<locals>.EditablePaneNrr;r;r;r<�EditablePane�r�r�c@seZdZdS)zSClassPropertiesAndMethods.test_consistency_with_epg.<locals>.EditableScrollablePaneNrr;r;r;r<�EditableScrollablePane�r�r�r�)r6r�r�r�r�r�r�r;r;r<�test_consistency_with_epg�s��z3ClassPropertiesAndMethods.test_consistency_with_epgcs�d}�fdd�}Gdd�dt�}Gdd�d|�}Gdd	�d	t�}|td
td||fi�|t|td||fi�|t|td|||fi�Gdd
�d
t�}Gdd�d|�}Gdd�d|�}Gdd�d||�}	Gdd�d||�}
|t|td|	|
fi�dS)NzCCannot create a consistent method resolution
order (MRO) for bases c
spz||�WnP|y\}z8t��rHt|��|�sH��dt|�|f�WYd}~nd}~00��d|�dS)NzMessage %r, expected %rzExpected %s)r�check_impl_detailr�r
r�)�exc�expected�callabler7�msgrxr;r<�raises�s
�z?ClassPropertiesAndMethods.test_mro_disagreement.<locals>.raisesc@seZdZdS)z:ClassPropertiesAndMethods.test_mro_disagreement.<locals>.ANrr;r;r;r<r�r�rc@seZdZdS)z:ClassPropertiesAndMethods.test_mro_disagreement.<locals>.BNrr;r;r;r<r#�r�r#c@seZdZdS)z:ClassPropertiesAndMethods.test_mro_disagreement.<locals>.CNrr;r;r;r<r��r�r�zduplicate base class ArWc@seZdZdS)zCClassPropertiesAndMethods.test_mro_disagreement.<locals>.GridLayoutNrr;r;r;r<�
GridLayout�r�r�c@seZdZdS)zGClassPropertiesAndMethods.test_mro_disagreement.<locals>.HorizontalGridNrr;r;r;r<�HorizontalGrid�r�r�c@seZdZdS)zEClassPropertiesAndMethods.test_mro_disagreement.<locals>.VerticalGridNrr;r;r;r<�VerticalGrid�r�r�c@seZdZdS)z?ClassPropertiesAndMethods.test_mro_disagreement.<locals>.HVGridNrr;r;r;r<�HVGrid�r�r�c@seZdZdS)z?ClassPropertiesAndMethods.test_mro_disagreement.<locals>.VHGridNrr;r;r;r<�VHGrid�r�r�ZConfusedGrid)rr�rD)r6Zmro_err_msgr�rr#r�r�r�r�r�r�r;rxr<�test_mro_disagreement�s,����z/ClassPropertiesAndMethods.test_mro_disagreementc	Cs�t�}|�|jt�|�t|�t�t�}|�||�|�|d�z
d|_WnttfybYn0|�	d�|�t�d�Gdd�dt�}|�}|�|j
i�d|_|�|jd�|�|j
ddi�dS)Nr�r�z1object() should not allow setting a foo attributerFc@seZdZdS)z:ClassPropertiesAndMethods.test_object_class.<locals>.CdictNrr;r;r;r<�Cdictsr�re)rrBr�rD�assertNotEqualr�r��AttributeErrorr�r�rF)r6r?rRr�r7r;r;r<�test_object_class�s$

z+ClassPropertiesAndMethods.test_object_classc
Cs`Gdd�dtj�}t�d�}|�|jtju�|�t|d��||_|�|j|u�|�t|d��tj|_|�|jtju�|�t|d��Gdd�dt�}|�t��|d_Wd�n1s�0YGdd	�d	t	�}|�t��|d
_Wd�n1�s0YGdd�dt
�}|�t��|d
_Wd�n1�sH0YGdd�dt�}|�t��|d_Wd�n1�s�0YGdd�dt�}|�t��|d_Wd�n1�s�0YGdd�dt
�}|�t��|d_Wd�n1�s0YGdd�dt�}	|�t��|	t�_Wd�n1�sR0YdS)Nc@seZdZdZdS)zjClassPropertiesAndMethods.test_object_class_assignment_between_heaptypes_and_nonheaptypes.<locals>.SubTypereN�r�r�r�r?r;r;r;r<�SubTypesr�rLr?c@seZdZdZdS)zhClassPropertiesAndMethods.test_object_class_assignment_between_heaptypes_and_nonheaptypes.<locals>.MyIntr;N�r�r�r�r�r;r;r;r<�MyInt-sr�rec@seZdZdZdS)zjClassPropertiesAndMethods.test_object_class_assignment_between_heaptypes_and_nonheaptypes.<locals>.MyFloatr;Nr�r;r;r;r<�MyFloat2sr���?c@seZdZdZdS)zlClassPropertiesAndMethods.test_object_class_assignment_between_heaptypes_and_nonheaptypes.<locals>.MyComplexr;Nr�r;r;r;r<�	MyComplex7sr�y�?@c@seZdZdZdS)zhClassPropertiesAndMethods.test_object_class_assignment_between_heaptypes_and_nonheaptypes.<locals>.MyStrr;Nr�r;r;r;r<�MyStr<sr�c@seZdZdZdS)zjClassPropertiesAndMethods.test_object_class_assignment_between_heaptypes_and_nonheaptypes.<locals>.MyBytesr;Nr�r;r;r;r<�MyBytesAsr��ac@seZdZdZdS)zjClassPropertiesAndMethods.test_object_class_assignment_between_heaptypes_and_nonheaptypes.<locals>.MyTupler;Nr�r;r;r;r<�MyTupleFsr�r;c@seZdZdZdS)znClassPropertiesAndMethods.test_object_class_assignment_between_heaptypes_and_nonheaptypes.<locals>.MyFrozenSetr;Nr�r;r;r;r<�MyFrozenSetKsr�)rr�r�r�r�r�r)rgr�r*r�r��bytes�tuple�	frozenset)
r6r�rLr�r�r�r�r�r�r�r;r;r<�?test_object_class_assignment_between_heaptypes_and_nonheaptypess>
$&&&&&zYClassPropertiesAndMethods.test_object_class_assignment_between_heaptypes_and_nonheaptypesc	s�Gdd�dt�}|�}��|d���|d�Gdd�dt�}|�}��|d���|d�d|_��|jd�d|_��|jd�|`��|d�Gd	d
�d
t�}|�}��|d���|d���|d���|d�d|_d
|_d|_��|jd���|jd
���|jd�Gdd�dt�}|d�}��|d���|d���|��d�z
d|_Wnt�ytYn0��	d�zGdd�dt�}Wnt
�y�Yn0��	d�zGdd�dt�}Wnt
�y�Yn0��	d�zGdd�dt�}Wnt
�yYn0��	d�zGdd�dt�}Wnt
�yDYn0��	d�zGdd�dt�}Wnt
�yxYn0��	d�Gd d�dt�}Gd!d�dt�}|�}d|_��|jd�Gd"d�dt�}|�}d|_��|jd�d#�G�fd$d�dt�}|�}d|_��|jd���
t�d%�t�zGd&d�dt�}Wnt
tf�yZYn0��	d'�G�fd(d)�d)t��Gd*d�dt�}|�}��|_��|_��|_���jd�~t�����jd%�Gd+d,�d,|�}|�}��|_��|_���jd
�~t�����jd%�Gd-d.�d.|�}	|	�}��|_��|_��|_���jd�~t�����jd%�Gd/d0�d0t�}
|
�}��|g|_���jd�d}t�����jd%�ttd1��rGd2d3�d3t�}|�}
tt���}td4�D]}|
|
k�q�tt���}��||�G�fd5d6�d6t�}t�d7��}|�}~Wd�n1�sT0Y��|��d8�Gd9d:�d:t�}��t��|�`Wd�n1�s�0YdS);Nc@seZdZgZdS)z0ClassPropertiesAndMethods.test_slots.<locals>.C0Nr�r;r;r;r<�C0Rsr�rFr�c@seZdZdgZdS)z0ClassPropertiesAndMethods.test_slots.<locals>.C1r?Nr�r;r;r;r<�C1Xsr�r?rec@seZdZgd�ZdS)z0ClassPropertiesAndMethods.test_slots.<locals>.C3rVNr�r;r;r;r<�C3dsr�rRrWrfrhc@s"eZdZdgZdd�Zdd�ZdS)z0ClassPropertiesAndMethods.test_slots.<locals>.C4�__acSs
||_dSr��Z_C4__a�r6r�r;r;r<r0usz9ClassPropertiesAndMethods.test_slots.<locals>.C4.__init__cSs|jSr�r�rxr;r;r<r�wsz4ClassPropertiesAndMethods.test_slots.<locals>.C4.getN)r�r�r�r�r0r�r;r;r;r<�C4rsr�rur�rvz$Double underscored names not mangledc@seZdZdgZdS��/ClassPropertiesAndMethods.test_slots.<locals>.CNr�r;r;r;r<r��sr�z[None] slots not caughtc@seZdZdgZdS)r�zfoo barNr�r;r;r;r<r��sz['foo bar'] slots not caughtc@seZdZdgZdS)r�zfoobarNr�r;r;r;r<r��sz['foo\0bar'] slots not caughtc@seZdZdgZdS)r��1Nr�r;r;r;r<r��sz['1'] slots not caughtc@seZdZdgZdS)r�r�Nr�r;r;r;r<r��sz[''] slots not caughtc@seZdZgd�ZdS)r�)r?Za_bZ_aZA0123456789ZNr�r;r;r;r<r��sc@seZdZdZdS�r��abcNr�r;r;r;r<r��sc@seZdZdZdSr�r�r;r;r;r<r��sr�cseZdZ�ZdSr�r�r;)�slotsr;r<r��src@seZdZed�gZdS)r��N)r�r�r��chrr�r;r;r;r<r��szhr(128)] slots not caughtcs(eZdZdZ�fdd�Z�fdd�ZdS)z5ClassPropertiesAndMethods.test_slots.<locals>.Countedrcs�jd7_dSr�r;rx��Countedr;r<r0�sz>ClassPropertiesAndMethods.test_slots.<locals>.Counted.__init__cs�jd8_dSr�r;rxr�r;r<�__del__�sz=ClassPropertiesAndMethods.test_slots.<locals>.Counted.__del__N)r�r�r�r<r0r�r;r�r;r<r��sr�c@seZdZgd�ZdS)r�rVNr�r;r;r;r<r��sc@seZdZdS)z/ClassPropertiesAndMethods.test_slots.<locals>.DNrr;r;r;r<r�src@seZdZdgZdS)z/ClassPropertiesAndMethods.test_slots.<locals>.E�eNr�r;r;r;r<r,�sr,c@seZdZddgZdS)z/ClassPropertiesAndMethods.test_slots.<locals>.Fr?rRNr�r;r;r;r<rc�src�get_objectsc@seZdZdd�ZdS)z/ClassPropertiesAndMethods.test_slots.<locals>.GcSsdS)NFr;r�r;r;r<�__eq__�sz6ClassPropertiesAndMethods.test_slots.<locals>.G.__eq__N�r�r�r�r�r;r;r;r<r��sr�r�cs(eZdZddgZdd�Z�fdd�ZdS)z/ClassPropertiesAndMethods.test_slots.<locals>.Hr?rRcSsd|_d|_dS�NrerfrQrxr;r;r<r0
sz8ClassPropertiesAndMethods.test_slots.<locals>.H.__init__cs ��|jd���|jd�dSr�)rBr?rR)�self_rxr;r<r�
sz7ClassPropertiesAndMethods.test_slots.<locals>.H.__del__N)r�r�r�r�r0r�r;rxr;r<�Hsr��stderrr�c@seZdZdZdS)z/ClassPropertiesAndMethods.test_slots.<locals>.Xr?Nr�r;r;r;r<rWsrW)rr�r?rBrRrWr�Z_ClassPropertiesAndMethods__ar�r�r�r�r�r�rDr��UnicodeEncodeErrorr<r�
gc_collect�zr�r��gcr�r�r�Zcaptured_output�getvaluerg)r6r�r7r�r�r�r�rWrr,rc�sr��gZorig_objectsr�Znew_objectsr��hrWr;)r�r6r�r<�
test_slotsPs







"z$ClassPropertiesAndMethods.test_slotscCs0Gdd�dt�}|�}|�|d�|�|d�d|_|�|jddi�Gdd�dt�}|�}|�|d�|�|d�z
d|_Wnty�Yn0|�d	�Gd
d�d||�}|�}|�|d�|�|d�d|_|�|jddi�Gdd
�d
||�}|�}|�|d�|�|d�d|_|�|jddi�dS)Nc@seZdZdgZdS)z7ClassPropertiesAndMethods.test_slots_special.<locals>.DrFNr�r;r;r;r<rsrrF�__weakref__r�r�c@seZdZdgZdS)z7ClassPropertiesAndMethods.test_slots_special.<locals>.Wr�Nr�r;r;r;r<�W$sr�z!shouldn't be allowed to set a.fooc@seZdZgZdS)z8ClassPropertiesAndMethods.test_slots_special.<locals>.C1Nr�r;r;r;r<r�0sr�c@seZdZgZdS)z8ClassPropertiesAndMethods.test_slots_special.<locals>.C2Nr�r;r;r;r<rR8srR)rr�r�r�rBrFr�r�)r6rr?r�r�rRr;r;r<�test_slots_specials6

z,ClassPropertiesAndMethods.test_slots_specialc	s`G�fdd�dt�}Gdd�d�}Gdd�d||dd�}��|jdtj�|�}��|jd	���|d�d	|_��|jd	���	t
��Gd
d�d�}Wd�n1s�0YGdd
�d
|dd�}��|j|jdd�d
���|jdtj�|�}��|d�d|_��|jd���	t
��Gdd�d�}Wd�n1�sR0YdS)NcseZdZ��fdd�Z�ZS)z;ClassPropertiesAndMethods.test_slots_special2.<locals>.Metacs��||�t��||||�Sr�)rerr�)r�r9r�	namespace�attr�r�r6r;r<r�CszCClassPropertiesAndMethods.test_slots_special2.<locals>.Meta.__new__rr;rxrr<�MetaBsr�c@seZdZdd�ZdS)z9ClassPropertiesAndMethods.test_slots_special2.<locals>.C1cSs
d|_dSr)rRrxr;r;r<r0HszBClassPropertiesAndMethods.test_slots_special2.<locals>.C1.__init__Nr�r;r;r;r<r�Gsr�cs"eZdZdgZ�fdd�Z�ZS)z9ClassPropertiesAndMethods.test_slots_special2.<locals>.C2rcst���dSr��rr0rxrr;r<r0LszBClassPropertiesAndMethods.test_slots_special2.<locals>.C2.__init__)r�r�r�r�r0rr;r;rr<rRJsrRr)r�r�r�c@seZdZdZdgZdS)z9ClassPropertiesAndMethods.test_slots_special2.<locals>.C3r�rN)r�r�r�rr�r;r;r;r<r�Vsr�c@seZdZdgZdS)z9ClassPropertiesAndMethods.test_slots_special2.<locals>.Q1r�Nr�r;r;r;r<�Q1Zsr�r�����qc@seZdZe�ZdgZdS)z9ClassPropertiesAndMethods.test_slots_special2.<locals>.Q2r�N)r�r�r�rr�r;r;r;r<�Q2dsr�)rDr�rFr�MemberDescriptorTyperBrRr�rrgr�r�)	r6r�r�rRrWr�r�r�r�r;rxr<�test_slots_special2@s0�,�z-ClassPropertiesAndMethods.test_slots_special2cCs`ddl}Gdd�d|jd�}Gdd�dt�}|�|�|�}|�||�|�t|jj|d�dS)Nrc@seZdZdZdS)z>ClassPropertiesAndMethods.test_slots_descriptor.<locals>.MyABCr?Nr�r;r;r;r<�MyABClsr�r�c@seZdZdS)zBClassPropertiesAndMethods.test_slots_descriptor.<locals>.UnrelatedNrr;r;r;r<�	Unrelatedosr�rh)	r��ABCMetar�registerr�rgr�r?�__set__)r6r�r�r��ur;r;r<�test_slots_descriptorhs
z/ClassPropertiesAndMethods.test_slots_descriptorcCsHGdd�dt�}Gdd�d|�}Gdd�d|�}d|_|�|jd�|�|jd�|�|jd�Gdd	�d	t�}|�}|�|d
�d|_|�|jd�dd
�|_|�|��d�dd
�|_|�t|�d�dd
�|_|�t	|�d�|�|jd�|�|d�dd�}||_
|�|jd�d|_|�|jd�dd�}||_
z
d|_Wnt�yZYn0|�d�|�|jd�Gdd�d|�}|�}d|_|�|jd�Gdd�dt	�}	|�d|	d�d�|�|	d�dd�|�d|	d �d!�|�|	d �dd!�|�|	d �|	d�d!�Gd"d#�d#t�}
Gd$d%�d%|
d&�}|�|t�dS)'Nc@seZdZdS�z2ClassPropertiesAndMethods.test_dynamics.<locals>.DNrr;r;r;r<r{src@seZdZdS)z2ClassPropertiesAndMethods.test_dynamics.<locals>.ENrr;r;r;r<r,}sr,c@seZdZdS)z2ClassPropertiesAndMethods.test_dynamics.<locals>.FNrr;r;r;r<rcsrcrec@seZdZdS)z2ClassPropertiesAndMethods.test_dynamics.<locals>.CNrr;r;r;r<r��sr��foobarrfcSsdSrr;rxr;r;r<�<lambda>�r�z9ClassPropertiesAndMethods.test_dynamics.<locals>.<lambda>r�cSsdS)N�C()r;rxr;r;r<r��r�r�cSsdSr�r;rxr;r;r<r��r�r�r�cSs|dkrdSt�dS�Nr��r�rir;r;r<�	mygetattr�sz:ClassPropertiesAndMethods.test_dynamics.<locals>.mygetattrr�cSs|dkrt�t�|||�Sr�)r�rrnror;r;r<�	mysetattr�sz:ClassPropertiesAndMethods.test_dynamics.<locals>.mysetattrznot spamzexpected AttributeErrorc@seZdZdSr�rr;r;r;r<r�sc@seZdZdS)z2ClassPropertiesAndMethods.test_dynamics.<locals>.INrr;r;r;r<�I�srr?Zaarhrvc@seZdZdS)zAClassPropertiesAndMethods.test_dynamics.<locals>.dynamicmetaclassNrr;r;r;r<�dynamicmetaclass�src@seZdZdS)z:ClassPropertiesAndMethods.test_dynamics.<locals>.someclassNrr;r;r;r<�	someclass�srr�)rr�rBr�r��methodr�r�r�r)�__getattr__r��newrnr�r�rDr�)r6rr,rcr�r?rrrJrrrr;r;r<�
test_dynamicsys\




z'ClassPropertiesAndMethods.test_dynamicscCs�zGdd�dtt�}Wnty(Yn0|�d�zGdd�dtd�}Wnty\Yn0|�d�Gdd�d�}zGdd�dtt��}Wnty�Yn0|�d	�zGd
d�dt�}Wnty�Yn0|�d�zGdd�dt�}Wnt�yYn0|�d
�Gdd�dt�}Gdd�dt�}Gdd�dt|d�}Gdd�dt|d�}zGdd�d||�}Wnt�y�Yn0|�d�dS)Nc@seZdZdS��0ClassPropertiesAndMethods.test_errors.<locals>.CNrr;r;r;r<r��sr�z5inheritance from both list and dict should be illegalc@seZdZdSr
rr;r;r;r<r��sz+inheritance from non-type should be illegalc@seZdZdS)z6ClassPropertiesAndMethods.test_errors.<locals>.ClassicNrr;r;r;r<�Classic�src@seZdZdSr
rr;r;r;r<r��sz,inheritance from CFunction should be illegalc@seZdZdZdS�rreNr�r;r;r;r<r��sz__slots__ = 1 should be illegalc@seZdZdgZdSr
r�r;r;r;r<r��sz!__slots__ = [1] should be illegalc@seZdZdS)z1ClassPropertiesAndMethods.test_errors.<locals>.M1Nrr;r;r;r<r�src@seZdZdS)z1ClassPropertiesAndMethods.test_errors.<locals>.M2Nrr;r;r;r<r�src@seZdZdS)z1ClassPropertiesAndMethods.test_errors.<locals>.A1Nrr;r;r;r<�A1�srr�c@seZdZdS)z1ClassPropertiesAndMethods.test_errors.<locals>.A2Nrr;r;r;r<�A2�src@seZdZdS)z0ClassPropertiesAndMethods.test_errors.<locals>.BNrr;r;r;r<r#�sr#z5finding the most derived metaclass should have failed)r2rr�r�rrDr�)r6r�rrrrrr#r;r;r<�test_errors�sF




z%ClassPropertiesAndMethods.test_errorsc	s$Gdd�dt�}|�}|�|�d�|df�|�|�d�|df�|�|�d�|df�Gdd�d|�}|�}|�|�d�|df�|�|�d�|df�|�|�d�|df�|�|�|d�|df�dd�}t|�}|�|�dt�d	�td	f�|�|�d�d	�td	f�|�|jj|�|�|jj|�|�t||�jj|�|�t||�jj|�|�t||���|f�|�t||���|f�td��d�}|�	t
|�zt|dd
�Wnt
�y�Yn0|�d�t|�}|�|ji�d	|_
|�|j
d	�|�|jdd	i�|`
|�|d�dS)
Nc@seZdZdd�Zee�ZdS)z6ClassPropertiesAndMethods.test_classmethods.<locals>.CcWs|Sr�r;�r?r;r;r<r��r�z:ClassPropertiesAndMethods.test_classmethods.<locals>.C.fooN�r�r�r�r�rL�goor;r;r;r<r��sr�rec@seZdZdS)z6ClassPropertiesAndMethods.test_classmethods.<locals>.DNrr;r;r;r<rsrcSs||fSr�r;�r��argr;r;r<�fr�z6ClassPropertiesAndMethods.test_classmethods.<locals>.frr��r�z)classmethod shouldn't accept keyword argsr7)rrBrr�rLrr)�__self__rrgr�r�rFr7r�)	r6r�rWrrJrZffrI�cmrr;r<�test_classmethods�sF
z+ClassPropertiesAndMethods.test_classmethodscCsLt�td�}td�}|�}td�D]}|�d�q"|j|�|ddd�dS�N�gettotalrefcountr�rr�)Zdelta)r�
get_attributer�rLr�r0�assertAlmostEqual)r6rr�refs_beforer�r;r;r<�%test_refleaks_in_classmethod___init__-sz?ClassPropertiesAndMethods.test_refleaks_in_classmethod___init__r�cCsZddl}d}ddi}|jj|i|��\}}}|�||j�|�||�|�||�|��j|i|��\}}}|�||j�|�||�|�||�|jjd}||jg|�Ri|��\}}	}
|�||j�|�|	|�|�|
|�Gdd�d|j�}||g|�Ri|��\}}	}
|�||�|�|	|�|�|
|�|�t��}|�Wd�n1�s\0Y|�t|j�d�|�t��}||���Wd�n1�s�0Y|�t|j�d	�|�t��}|t	�Wd�n1�s�0Yd
}
|�t|j�|
�|�t��}|�
dt	�Wd�n1�s:0Y|�t|j�|
�dS)Nrrgr��{�	classmethc@seZdZdS)zAClassPropertiesAndMethods.test_classmethods_in_c.<locals>.SubSpamNrr;r;r;r<�SubSpamIr�r#zGdescriptor 'classmeth' of 'xxsubtype.spamlist' object needs an argumentzfdescriptor 'classmeth' for type 'xxsubtype.spamlist' needs a type, not a 'xxsubtype.spamlist' as arg 2zUdescriptor 'classmeth' requires a subtype of 'xxsubtype.spamlist' but received 'list')r�r�r"rBrFrgr�r��	exceptionr2r)r6r�r?rJr7r��d1Zspam_cmZx2r��d2r#r�expected_errmsgr;r;r<�test_classmethods_in_c6sR&�,�(�,z0ClassPropertiesAndMethods.test_classmethods_in_ccCsGdd�dt�}|�}|�|�d�d�|�|�d�d�|�|�d�|df�Gdd�d|�}|�}|�|�d�d�|�|�d�d�|�|�d�|df�|�|�|d�|df�td�}|�|ji�d|_|�|jd�|�|jddi�|`|�|d�dS)	Nc@seZdZdd�Zee�ZdS)z7ClassPropertiesAndMethods.test_staticmethods.<locals>.CcWs|Sr�r;rr;r;r<r�kr�z;ClassPropertiesAndMethods.test_staticmethods.<locals>.C.fooN)r�r�r�r�rrr;r;r;r<r�jsr�re�rec@seZdZdS)z7ClassPropertiesAndMethods.test_staticmethods.<locals>.DNrr;r;r;r<rqsrr�r7)rrBrr�rrFr7r�)r6r�rWrrJ�smr;r;r<�test_staticmethodshs$z,ClassPropertiesAndMethods.test_staticmethodscCsLt�td�}td�}|�}td�D]}|�d�q"|j|�|ddd�dSr)rrr�rr�r0r)r6rr*rr�r;r;r<�&test_refleaks_in_staticmethod___init__�sz@ClassPropertiesAndMethods.test_refleaks_in_staticmethod___init__cCs�ddl}d}ddi}|jj|i|��\}}}|�|d�|�||�|�||�|��j|i|��\}}}|�|d�|�||�|�||�dS)Nrrgr�r!)r�r�Z
staticmethrB)r6r�r?rJr7r�r%r&r;r;r<�test_staticmethods_in_c�sz1ClassPropertiesAndMethods.test_staticmethods_in_ccsGdd�d����}|���d��df�|�|�d��df�|�|�d�|df�Gdd�d��}|�}|�|�d�|df�|�|�d�|df�|�|�d�|df�|�|�|d�|df�G�fdd�d�}|�|�jj�j�|�t�j������d��dS)	Nc@seZdZdd�Zee�ZdS)z1ClassPropertiesAndMethods.test_classic.<locals>.CcWs|Sr�r;rr;r;r<r��r�z5ClassPropertiesAndMethods.test_classic.<locals>.C.fooNrr;r;r;r<r��sr�rec@seZdZdS)z1ClassPropertiesAndMethods.test_classic.<locals>.DNrr;r;r;r<r�srcseZdZ�jZdS)z1ClassPropertiesAndMethods.test_classic.<locals>.ENr�r;r�r;r<r,�sr,�<bound method )rBrr��__func__r�r�rr
)r6rWrrJr,r;r�r<�test_classic�sz&ClassPropertiesAndMethods.test_classiccCshGdd�dt�}|�}|�|jd�|�|jd�d|_|�|jd�|�|jd�|`|�|d�dS)Nc@sHeZdZGdd�de�Zdd�Zdd�Zdd�Zd	d
�Zeeee�Z	dS)z2ClassPropertiesAndMethods.test_compattr.<locals>.Cc@s0eZdZd
dd�Zddd�Zdd�Zdd	�ZdS)zEClassPropertiesAndMethods.test_compattr.<locals>.C.computed_attributeNcSs||_||_||_dSr�)�_computed_attribute__get�_computed_attribute__set�_computed_attribute__delete)r6r�r0�deleter;r;r<r0�szNClassPropertiesAndMethods.test_compattr.<locals>.C.computed_attribute.__init__cSs
|�|�Sr�)r1)r6r�rDr;r;r<r�szMClassPropertiesAndMethods.test_compattr.<locals>.C.computed_attribute.__get__cSs|�||�Sr�)r2�r6r�r�r;r;r<r��szMClassPropertiesAndMethods.test_compattr.<locals>.C.computed_attribute.__set__cSs
|�|�Sr�)r3�r6r�r;r;r<�
__delete__�szPClassPropertiesAndMethods.test_compattr.<locals>.C.computed_attribute.__delete__)NN)N)r�r�r�r0rr�r7r;r;r;r<�computed_attribute�s

r8cSs
d|_dSr���_C__xrxr;r;r<r0�sz;ClassPropertiesAndMethods.test_compattr.<locals>.C.__init__cSs|j}|d|_|Sr�r9r6r;r;r<Z__get_x�s
z:ClassPropertiesAndMethods.test_compattr.<locals>.C.__get_xcSs
||_dSr�r9r6r;r;r<Z__set_x�sz:ClassPropertiesAndMethods.test_compattr.<locals>.C.__set_xcSs|`dSr�r9rxr;r;r<Z
__delete_x�sz=ClassPropertiesAndMethods.test_compattr.<locals>.C.__delete_xN)
r�r�r�rr8r0Z	_C__get_xZ	_C__set_xZ_C__delete_xr7r;r;r;r<r��sr�rrer��r7)rrBr7r�r�r;r;r<�
test_compattr�sz'ClassPropertiesAndMethods.test_compattrcCshGdd�dt�}|�}|�|jd�|�|j|�Gdd�d|�}|�}|�|jd�|�|j|�dS)Nc@seZdZdd�Zdd�ZdS)z2ClassPropertiesAndMethods.test_newslots.<locals>.CcSst�|�}d|_|Sr�)r2r�r�)r�r6r;r;r<r��s
z:ClassPropertiesAndMethods.test_newslots.<locals>.C.__new__cSs|jd|_dS)Nrf�r�rxr;r;r<r0�sz;ClassPropertiesAndMethods.test_newslots.<locals>.C.__init__N�r�r�r�r�r0r;r;r;r<r��sr�rhc@seZdZdS)z2ClassPropertiesAndMethods.test_newslots.<locals>.DNrr;r;r;r<r�sr)r2rBr�r�)r6r�r?rrRr;r;r<�
test_newslots�sz'ClassPropertiesAndMethods.test_newslotscCsz|�ttj�|�ttjd�|�ttjt�|�ttjt�Gdd�dt�}|�t|�Gdd�dt�}|�t|�dS)Nr�c@seZdZejZdS�z1ClassPropertiesAndMethods.test_bad_new.<locals>.CN)r�r�r�r2r�r;r;r;r<r��sr�c@seZdZejZdSr@)r�r�r�rr�r;r;r;r<r��s)rgr�rr�r2r�r;r;r<�test_bad_new�sz&ClassPropertiesAndMethods.test_bad_newcCs4Gdd�dt�}t�|�|�ttj|d�t�|��|�ttj|�d�Gdd�dt�}t�|�t�|d�t�|d��|�ttj|d�d�Gdd�dt�}t�|�|�ttj|d�t�|d��t�|d�d�Gdd�dt�}t�|�|�ttj|d�t�|d��|�ttj|d�d�dS)Nc@seZdZdS)�4ClassPropertiesAndMethods.test_object_new.<locals>.ANrr;r;r;r<r�srruc@seZdZdd�ZdS)rBcSs
||_dSr�r=�r6r�r;r;r<r0�s�=ClassPropertiesAndMethods.test_object_new.<locals>.A.__init__Nr�r;r;r;r<r�srhc@seZdZdd�ZdS)rBcSs
t�|�Sr��rr��r�r�r;r;r<r��s�<ClassPropertiesAndMethods.test_object_new.<locals>.A.__new__Nrr;r;r;r<r�sc@seZdZdd�Zdd�ZdS)rBcSs
t�|�Sr�rErFr;r;r<r�srGcSs
||_dSr�r=rCr;r;r<r0	srDNr>r;r;r;r<rs)rr�rgr�r0�r6rr;r;r<�test_object_new�s(



z)ClassPropertiesAndMethods.test_object_newcCs�Gdd�dt�}|�t|�Gdd�d|�}t���$t�dt�|d�}Wd�n1s^0Y|�|jd�|�|j	|�|`
|�t|�|`
t���$t�dt�|d�}Wd�n1s�0Y|�|jd�|�|j	|�dS)Nc@seZdZdd�ZdS)z=ClassPropertiesAndMethods.test_restored_object_new.<locals>.Ac_st�dSr���AssertionError)r�r7r8r;r;r<r�szEClassPropertiesAndMethods.test_restored_object_new.<locals>.A.__new__Nrr;r;r;r<rsrc@seZdZejZdd�ZdS)z=ClassPropertiesAndMethods.test_restored_object_new.<locals>.BcSs
||_dSr�r=rCr;r;r<r0szFClassPropertiesAndMethods.test_restored_object_new.<locals>.B.__init__N)r�r�r�rr�r0r;r;r;r<r#sr#�errorrh)rrgrK�warnings�catch_warnings�simplefilter�DeprecationWarningrBr�r�r�)r6rr#rRr;r;r<�test_restored_object_news 
&
&z2ClassPropertiesAndMethods.test_restored_object_newc		CsDGdd�dt�}Gdd�d|�}Gdd�d|�}Gdd�d||�}|�|��|tg�|�|j|tf�|�|��||tg�|�|j||tf�|�|��||tg�|�|j||tf�|�|��||||tg�|�|j||||tf�|�|���d�Gd	d
�d
t�}Gdd�d|||||d
�}|�|jt|||||f�|�|���d�z:Gdd�dt�}Gdd�dt|d
�}t�|�}d|d<Wnt�y�Yn0|�d�z(Gdd�dt�}Gdd�dt|d
�}Wnt�y�Yn0|�d�z(Gdd�dt�}Gdd�dt|d
�}Wnt�y4Yn0|�d�dS)Nc@seZdZdd�ZdS)z0ClassPropertiesAndMethods.test_altmro.<locals>.AcSsdSrr;rxr;r;r<r+r�z2ClassPropertiesAndMethods.test_altmro.<locals>.A.fN�r�r�r�rr;r;r;r<r*src@seZdZdS)z0ClassPropertiesAndMethods.test_altmro.<locals>.BNrr;r;r;r<r#,sr#c@seZdZdd�ZdS)z0ClassPropertiesAndMethods.test_altmro.<locals>.CcSsdSr&r;rxr;r;r<r/r�z2ClassPropertiesAndMethods.test_altmro.<locals>.C.fNrRr;r;r;r<r�.sr�c@seZdZdS)z0ClassPropertiesAndMethods.test_altmro.<locals>.DNrr;r;r;r<r0src@seZdZdd�ZdS)z?ClassPropertiesAndMethods.test_altmro.<locals>.PerverseMetaTypecSst�|�}|��|Sr�)rD�mro�reverse)r��Lr;r;r<rS=s
zCClassPropertiesAndMethods.test_altmro.<locals>.PerverseMetaType.mroN�r�r�r�rSr;r;r;r<�PerverseMetaType<srWc@seZdZdS�z0ClassPropertiesAndMethods.test_altmro.<locals>.XNrr;r;r;r<rWAsrWr�c@seZdZdd�ZdS)�9ClassPropertiesAndMethods.test_altmro.<locals>._metaclasscSs
|ttgSr�)rrrxr;r;r<rSHs�=ClassPropertiesAndMethods.test_altmro.<locals>._metaclass.mroNrVr;r;r;r<r�Gsr�c@seZdZdSrXrr;r;r;r<rWJsrvruzdevious mro() return not caughtc@seZdZdd�ZdS)rYcSsdgSr�r;rxr;r;r<rS[srZNrVr;r;r;r<r�Zsc@seZdZdSrXrr;r;r;r<rW]sz!non-class mro() return not caughtc@seZdZdd�ZdS)rYcSsdSr�r;rxr;r;r<rSfsrZNrVr;r;r;r<r�esc@seZdZdSrXrr;r;r;r<rWhsz$non-sequence mro() return not caught)	rrBrSr�rrDr�r�r�)	r6rr#r�rrWrWr�r7r;r;r<�test_altmro(sJ


z%ClassPropertiesAndMethods.test_altmrocs�Gdd�dt��G�fdd�d��}|�}|�|jd�d|_|�|jd�|`|�|jd�|�|dd	�d
|d<|�|jd�|d=|�|jd�|�|dd
�dtdd
�f�d|dd
�<|�|jtdd
�df�|dd
�=|�|jtdd
��dS)Nc@seZdZdS)z5ClassPropertiesAndMethods.test_overloading.<locals>.BNrr;r;r;r<r#rsr#csDeZdZdd�Z�fdd�Z�fdd�Zdd�Zd	d
�Zdd�Zd
S)z5ClassPropertiesAndMethods.test_overloading.<locals>.CcSs|dkrd|fSt�dS)Nr�rErrir;r;r<rvszAClassPropertiesAndMethods.test_overloading.<locals>.C.__getattr__cs&|dkr||f|_n��|||�SdS�Nr�)rrnro�r#r;r<rn{szAClassPropertiesAndMethods.test_overloading.<locals>.C.__setattr__cs |dkr||_n��||�SdSr\)rprqrir]r;r<rq�szAClassPropertiesAndMethods.test_overloading.<locals>.C.__delattr__cSsd|fS)N�getitemr;r�r;r;r<rU�szAClassPropertiesAndMethods.test_overloading.<locals>.C.__getitem__cSs||f|_dSr�)�setitem)r6r�r�r;r;r<ra�szAClassPropertiesAndMethods.test_overloading.<locals>.C.__setitem__cSs
||_dSr�)�delitemr�r;r;r<�__delitem__�szAClassPropertiesAndMethods.test_overloading.<locals>.C.__delitem__N)	r�r�r�rrnrqrUrarar;r]r;r<r�usr�rsr�)r�r�r�)r^r��)r�rbrr�r^)rrBr�rrpr_r`rXr�r;r]r<�test_overloadingos$
z*ClassPropertiesAndMethods.test_overloadingcs�Gdd�dt���d��|����d�G��fdd�d��}|d�}|�|��d�|�|��d�|�|��d�G�fdd�dt�}|�|�jj�j�|�t�j��d����	d	��dS)
Nc@seZdZdd�Zdd�ZdS)z1ClassPropertiesAndMethods.test_methods.<locals>.CcSs
||_dSr��r7r6r;r;r<r0�sz:ClassPropertiesAndMethods.test_methods.<locals>.C.__init__cSs|jSr�rdrxr;r;r<r��sz5ClassPropertiesAndMethods.test_methods.<locals>.C.fooN)r�r�r�r0r�r;r;r;r<r��sr�recseZdZ�jZ�jZdS)z1ClassPropertiesAndMethods.test_methods.<locals>.DN)r�r�r�r�r�rr;�r��c1r;r<r�srrfcseZdZ�jZdS)z1ClassPropertiesAndMethods.test_methods.<locals>.ENr�r;r�r;r<r,�sr,r.)
rrBr�r�rr/r�r�rr
)r6rr&r,r;rer<�test_methods�sz&ClassPropertiesAndMethods.test_methodsz)testing error message from implementationcCs�tj}d}|�t��}|�Wd�n1s00Y|�|jjd|�d}|�t��}|d�Wd�n1sz0Y|�|jjd|�|�t��}|�d�Wd�n1s�0Y|�|jjd|�dS)Nz*unbound method set.add() needs an argumentrzBdescriptor 'add' for 'set' objects doesn't apply to a 'int' object)r0rrgr�rBr$r7r)r6Zset_addr'rr;r;r<�test_methods_in_c�s$&(z+ClassPropertiesAndMethods.test_methods_in_ccs�dd�}dd�}dd�}dd�}d	d
�}dd�}d
d�}d=dd�}dd�}	dd�}
�fdd�}�fdd�}dd�}
dd�}dt|t�ifdt|t�ifdt|t�||d �fd!tj|t�ifd"|	|t�ifd#||td$�ifd%|
|td&�ifd'||t�d(|
ifd(||
t�d'|ifd)t|t�ifd*t|t�ifd+tj	|t�ifd,tj
|t�ifd,t|t�ifd-tj|t�ifd.t
|t�ifd/t|t�ifg}G��fd0d1�d1t�}G�fd2d3�d3t�}Gd4d5�d5t��G�fd6d7�d7t�}|D�]\}}}�}Gd8d9�d9|�}|��D]\}}t|||��qt|||�||��g�Gd:d9�d9|�}|��D]\}}t|||��qJt||||��||�����d;g|�Gd<d9�d9|�}|��D]\}}t|||��q�t|||�����||���q�dS)>NcSs(|�Wd�n1s0YdSr�r;)�managerr;r;r<�run_context�szIClassPropertiesAndMethods.test_special_method_lookup.<locals>.run_contextcSs|Sr�r;rxr;r;r<�iden�szBClassPropertiesAndMethods.test_special_method_lookup.<locals>.idencSsdS)Nshellor;rxr;r;r<r��szCClassPropertiesAndMethods.test_special_method_lookup.<locals>.hellocSsgSr�r;rxr;r;r<�	empty_seq�szGClassPropertiesAndMethods.test_special_method_lookup.<locals>.empty_seqcSsdSr�r;rxr;r;r<�zero�szBClassPropertiesAndMethods.test_special_method_lookup.<locals>.zerocSsdS)N��?r;rxr;r;r<�complex_num�szIClassPropertiesAndMethods.test_special_method_lookup.<locals>.complex_numcSst�dSr�)�
StopIterationrxr;r;r<r��szBClassPropertiesAndMethods.test_special_method_lookup.<locals>.stopcSsdS)NTr;)r6�thingr;r;r<�return_true�szIClassPropertiesAndMethods.test_special_method_lookup.<locals>.return_truecSs
tt|�Sr�)r�r)�r�r;r;r<�
do_isinstance�szKClassPropertiesAndMethods.test_special_method_lookup.<locals>.do_isinstancecSs
tt|�Sr�)r�r)rsr;r;r<�
do_issubclass�szKClassPropertiesAndMethods.test_special_method_lookup.<locals>.do_issubclasscs*Gdd�d|jt�}��|�dd�dS)Nc@seZdZdS)z^ClassPropertiesAndMethods.test_special_method_lookup.<locals>.do_dict_missing.<locals>.DictSubNrr;r;r;r<�DictSub�srv�hirk)r�rrB)Zcheckerrvrxr;r<�do_dict_missing�szMClassPropertiesAndMethods.test_special_method_lookup.<locals>.do_dict_missingcs��|d�dS)Nrwrk)rB)r�r�rxr;r<�some_number�szIClassPropertiesAndMethods.test_special_method_lookup.<locals>.some_numbercWsdSr�r;�r7r;r;r<�swallow�r�zEClassPropertiesAndMethods.test_special_method_lookup.<locals>.swallowcSsdS�Nr�r;)r6�specr;r;r<�format_impl�szIClassPropertiesAndMethods.test_special_method_lookup.<locals>.format_impl�	__bytes__�__reversed__�__length_hint__)r~�__next__�
__sizeof__�__instancecheck__�__missing__r�__subclasscheck__�rG�	__enter__�__exit__�__complex__�
__format__�	__floor__�	__trunc__�__ceil__�__dir__�	__round__cs(eZdZ�fdd�Z�f�fdd�	ZdS)zEClassPropertiesAndMethods.test_special_method_lookup.<locals>.CheckercSs|�d�|��dS)Nz__getattr__ called with {0})r��format�r6r��testr;r;r<rszQClassPropertiesAndMethods.test_special_method_lookup.<locals>.Checker.__getattr__cs$|�vr|�d�|��t�||�S)Nz __getattribute__ called with {0})r�r�rrkr�)�okr;r<rk
szVClassPropertiesAndMethods.test_special_method_lookup.<locals>.Checker.__getattribute__N�r�r�r�rrkr;)r�r6r;r<�Checker
sr�cs eZdZdd�Z�fdd�ZdS)zJClassPropertiesAndMethods.test_special_method_lookup.<locals>.SpecialDescrcSs
||_dSr�)�impl)r6r�r;r;r<r0szSClassPropertiesAndMethods.test_special_method_lookup.<locals>.SpecialDescr.__init__cs��d�|j�||�Sr�)r|r�r�r6r��owner��recordr;r<rs
zRClassPropertiesAndMethods.test_special_method_lookup.<locals>.SpecialDescr.__get__N)r�r�r�r0rr;r�r;r<�SpecialDescrsr�c@seZdZdS)zIClassPropertiesAndMethods.test_special_method_lookup.<locals>.MyExceptionNrr;r;r;r<�MyExceptionsr�cseZdZ�fdd�ZdS)zFClassPropertiesAndMethods.test_special_method_lookup.<locals>.ErrDescrcs��dSr�r;r��r�r;r<rszNClassPropertiesAndMethods.test_special_method_lookup.<locals>.ErrDescr.__get__N�r�r�r�rr;r�r;r<�ErrDescrsr�c@seZdZdS�z?ClassPropertiesAndMethods.test_special_method_lookup.<locals>.XNrr;r;r;r<rWsrWc@seZdZdSr�rr;r;r;r<rW&srec@seZdZdSr�rr;r;r;r<rW.s)N)r�r0�reversedr2r��	getsizeofr�r��math�floor�truncr)�ceil�dir�roundr�	Exceptionr3rrBrg)r6rjrkr�rlrmror�rrrtrurxryr{r~Zspecialsr�r�r�r9ZrunnerZ	meth_impl�envrWr�r�r;)r�r�r�r6r<�test_special_method_lookup�sx

����

z4ClassPropertiesAndMethods.test_special_method_lookupc
Cs�Gdd�dt�}|�}|�}|�|�|�t|�t|��t|�t|�|�||�|�||k�|�||k�|�||k�|�t|��	d�d�|�t|�t
|��|�d|�td�D]}|�
||�q�|�d|�Gdd�dt�}|�}|�}|�|�|�t|�t|��t|�t|�|�||�|�||�|�||k�|�||k�|�t|��	d	�d�|�t|�t
|��|�d|�td�D]}|�
||��q�|�d|�Gd
d�dt�}|d�}	|d�}
|d�}|�|	�|�|
�|�t|	�td��|�|	|	�|�|	|
�|�|	|	k�|�|	|
�|�|	|
k�|�|	|
k�|�|
|	k�|�|
|	k�|�t|	�d
�|�t
|	�d�|td��}|�d|�td�D]}|�
||��q�|�d|�dS)Nc@seZdZdd�ZdS)z2ClassPropertiesAndMethods.test_specials.<locals>.CcSs$d|krdkrnn|St�dS�Nrr���
IndexErrorr�r;r;r<rU;sz>ClassPropertiesAndMethods.test_specials.<locals>.C.__getitem__Nr�r;r;r;r<r�:sr�zC object at rr�r�c@seZdZdd�ZdS)z2ClassPropertiesAndMethods.test_specials.<locals>.DcSs$d|krdkrnn|St�dSr�r�r�r;r;r<rURsz>ClassPropertiesAndMethods.test_specials.<locals>.D.__getitem__Nr�r;r;r;r<rQsrzD object at c@sleZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�ZdS)z6ClassPropertiesAndMethods.test_specials.<locals>.ProxycSs
||_dSr�rdr6r;r;r<r0isz?ClassPropertiesAndMethods.test_specials.<locals>.Proxy.__init__cSs
|jSr�rdrxr;r;r<r�ksz?ClassPropertiesAndMethods.test_specials.<locals>.Proxy.__bool__cSs
t|j�Sr�)�hashr7rxr;r;r<�__hash__msz?ClassPropertiesAndMethods.test_specials.<locals>.Proxy.__hash__cSs
|j|kSr�rdr�r;r;r<r�osz=ClassPropertiesAndMethods.test_specials.<locals>.Proxy.__eq__cSs
|j|kSr�rdr�r;r;r<�__ne__qsz=ClassPropertiesAndMethods.test_specials.<locals>.Proxy.__ne__cSs
|j|kSr�rdr�r;r;r<�__ge__ssz=ClassPropertiesAndMethods.test_specials.<locals>.Proxy.__ge__cSs
|j|kSr�rdr�r;r;r<�__gt__usz=ClassPropertiesAndMethods.test_specials.<locals>.Proxy.__gt__cSs
|j|kSr�rdr�r;r;r<�__le__wsz=ClassPropertiesAndMethods.test_specials.<locals>.Proxy.__le__cSs
|j|kSr�rdr�r;r;r<�__lt__ysz=ClassPropertiesAndMethods.test_specials.<locals>.Proxy.__lt__cSs
d|jS)NzProxy:%srdrxr;r;r<r�{sz>ClassPropertiesAndMethods.test_specials.<locals>.Proxy.__str__cSs
d|jS)Nz	Proxy(%r)rdrxr;r;r<r�}sz?ClassPropertiesAndMethods.test_specials.<locals>.Proxy.__repr__cSs
||jvSr�rdr�r;r;r<rjszCClassPropertiesAndMethods.test_specials.<locals>.Proxy.__contains__N)r�r�r�r0r�r�r�r�r�r�r�r�r�r�rjr;r;r;r<�Proxyhsr�rezProxy:0zProxy(0))rr�r��idr�rBr�ZassertGreaterEqualr��findr��assertNotInr�re)
r6r�rf�c2r�rr%r&r�Zp0Zp1Zp_1Zp10r;r;r<�
test_specials5sp
z'ClassPropertiesAndMethods.test_specialsc

Csddl}Gdd�dt�}|�}|�|�}|�|�|�~t��|�|�d�~Gdd�dt�}|�}z|�|�Wn4ty�}z|�dt|��WYd}~nd}~00|�	d�Gdd	�d	t�}|�}	|�|	�}|�|�|	�~	t��|�|�d�~dS)
Nrc@seZdZdS)z2ClassPropertiesAndMethods.test_weakrefs.<locals>.CNrr;r;r;r<r��sr�c@seZdZdgZdS)z7ClassPropertiesAndMethods.test_weakrefs.<locals>.NoWeakr�Nr�r;r;r;r<�NoWeak�sr�zweak referencez!weakref.ref(no) should be illegalc@seZdZddgZdS)z5ClassPropertiesAndMethods.test_weakrefs.<locals>.Weakr�r�Nr�r;r;r;r<�Weak�sr�)
�weakrefr�refrBrr�r�rer�r�)
r6r�r�rW�rr��nor�r�Zyesr;r;r<�
test_weakrefs�s0
&

z'ClassPropertiesAndMethods.test_weakrefsc
CsGdd�dt�}|�}|�|d�d|_|�|jd�|�|jd�|`|�|d�|�|d�|j�|d�|�|j�|�d�|j�|�|�|d�|jd}|�	|t
�t|�}|�d|�|�d|�|�d	|�|�d
|�|�|j
d�|�|j|jd�|�|j|jd
�|�|j|jd�dD]v}zt||d�WnPt�y�}z6t|��d�dk�r�|�d|t|�f�WYd}~nd}~00|�d|��q6d|_
|�|j
d�Gdd�dt�}|�}z|D]}	t|	��q�Wnt�yYn0|�d�dS)Nc@s4eZdZdd�Zdd�Zdd�Zeeeedd�Zd	S)
z4ClassPropertiesAndMethods.test_properties.<locals>.CcSs|jSr�r9rxr;r;r<�getx�sz9ClassPropertiesAndMethods.test_properties.<locals>.C.getxcSs
||_dSr�r9r�r;r;r<�setx�sz9ClassPropertiesAndMethods.test_properties.<locals>.C.setxcSs|`dSr�r9rxr;r;r<�delx�sz9ClassPropertiesAndMethods.test_properties.<locals>.C.delx�I'm the x property.��docN)r�r�r�r�r�r�r-r7r;r;r;r<r��sr�r7r�r:r��__doc__�fget�fset�fdelr�r�r�r�)r�r�r��readonlyrzQwhen setting readonly attr %r on a property, got unexpected AttributeError msg %rzIexpected AttributeError from trying to set readonly %r attr on a propertyc@seZdZedd��ZdS)z4ClassPropertiesAndMethods.test_properties.<locals>.DcSsddSr�r;)r�r;r;r<r��r�z=ClassPropertiesAndMethods.test_properties.<locals>.D.<lambda>N)r�r�r�r-rUr;r;r;r<r�srz,expected ZeroDivisionError from bad property)rr�r7rBr:r�rr7rFr�r-r�rer�r�r�r�r�rr�r�r�r��ZeroDivisionError)
r6r�r?�raw�attrsr�r�rrJr�r;r;r<�test_properties�sZ

��
z)ClassPropertiesAndMethods.test_propertiesrfz)Docstrings are omitted with -O2 and abovecsG�fdd�dt�}dS)NcsJeZdZdd�Zdd�Zee�Z��ejd�eed�Z	��e	jd�dS)z?ClassPropertiesAndMethods.test_properties_doc_attrib.<locals>.EcSsdSr�r;rxr;r;r<�getter�szFClassPropertiesAndMethods.test_properties_doc_attrib.<locals>.E.gettercSsdSr�r;)r�r�r;r;r<�setter�szFClassPropertiesAndMethods.test_properties_doc_attrib.<locals>.E.setterz
getter method)r�N)
r�r�r�r�r�r-ZproprBr�Zprop2r;rxr;r<r,�s
r,�r)r6r,r;rxr<�test_properties_doc_attrib�sz4ClassPropertiesAndMethods.test_properties_doc_attribcs8zddl�WntyYn0G�fdd�dt�}dS)NrcseZdZe�j�ZdS)z>ClassPropertiesAndMethods.test_testcapi_no_segfault.<locals>.XN)r�r�r�r-Ztest_with_docstring�pr;��	_testcapir;r<rW	srW)r��ImportErrorr�r6rWr;r�r<�test_testcapi_no_segfault	s
z3ClassPropertiesAndMethods.test_testcapi_no_segfaultcsGdd�dt����}|��jjd�|�|d�d|_|�|d�|�|jd�|�|jd�|`|�|d�|�|d�G�fdd	�d	��}|�}d
|_|�|jd
�|`|`Gdd�dt����}d|_|�|jd�|`G�fd
d�d��}|�}d|_|�|jd�|`dS)Nc@s@eZdZedd�Zejdd��Zejdd��Zejdd��ZdS)z9ClassPropertiesAndMethods.test_properties_plus.<locals>.Cr�r�cSs|jSr���_foorxr;r;r<r�	sz=ClassPropertiesAndMethods.test_properties_plus.<locals>.C.foocSst|�|_dSr��r'r�r�r;r;r<r�	scSs|`dSr�r�rxr;r;r<r�	sN)r�r�r�r-r�r�r��deleterr;r;r;r<r�	s


r�r�r�i���r�r�cseZdZ�jjdd��ZdS)z9ClassPropertiesAndMethods.test_properties_plus.<locals>.DcSs z|`WntyYn0dSr�)r�r�rxr;r;r<r�'	sz=ClassPropertiesAndMethods.test_properties_plus.<locals>.D.fooN)r�r�r�r�r�r;r�r;r<r&	srr�c@sDeZdZedd��Zejdd��Zejdd��Zejddd��ZdS)z9ClassPropertiesAndMethods.test_properties_plus.<locals>.EcSs|jSr�r�rxr;r;r<r�4	sz=ClassPropertiesAndMethods.test_properties_plus.<locals>.E.foocSst�dSr�)�RuntimeErrorr�r;r;r<r�7	scSst|�|_dSr�r�r�r;r;r<r�:	sNcSs|`dSr�r�r�r;r;r<r�=	s)N)r�r�r�r-r�r�r�r;r;r;r<r,3	s


r,cs*eZdZ�jjdd��Zejdd��ZdS)z9ClassPropertiesAndMethods.test_properties_plus.<locals>.FcSs|`dSr�r�rxr;r;r<r�G	sz=ClassPropertiesAndMethods.test_properties_plus.<locals>.F.foocSstd|�|_dSr�)�maxr�r�r;r;r<r�J	sN)r�r�r�r�r�r�r;)r,r;r<rcF	s
rc���r)rrBr�r�r�r�r�)r6rWrrJr�rcrr;)r�r,r<�test_properties_plus	s6z.ClassPropertiesAndMethods.test_properties_plusc	Cs�t�}|�|i�ti�}|�|i�tddd��}|�|ddd��|�|tt|�����|�|tt|�����tddd��}|�|tddd��|�|tfi|���|�|tddidd��|�|tdgdd	��|�|td
dgfi|���|�|tfi|���ddd
ddgdfD]b}zt|�Wn@t�yDYn<t�yp|dk�r^n|�d|�Yn0|�d|��q ztii�Wnt�y�Yn0|�d�Gdd�d�}zt|��Wnt�y�Yn0|�d�dd�|_dd�|_	t|��}|�||j�Gdd�d�}t|dd�|dd�|dd�|dd�g�}|�|ddd��tt
td�tdd ���}|�|td!d"�td�D���d#gd$gfD]6}zt|�Wnt�y�Yn0|�d%|��q�dS)&NrfrR)rer?re)�one�twor�)r�)r�rf)r�)r�r�)r�r�ry�0�rzno TypeError from dict(%r)zno TypeError from dict({}, {})c@seZdZdddd�ZdS)zAClassPropertiesAndMethods.test_dict_constructors.<locals>.Mappingrfrkrn)rerhr?N)r�r�r�rr;r;r;r<�Mapping{	sr�z*no TypeError from dict(incomplete mapping)cSst|j���Sr�)r2rr{rxr;r;r<r��	r�zBClassPropertiesAndMethods.test_dict_constructors.<locals>.<lambda>cSs
|j|Sr�)rr�r;r;r<r��	r�c@seZdZdd�Zdd�ZdS)zJClassPropertiesAndMethods.test_dict_constructors.<locals>.AddressBookEntrycSs||_||_dSr�)�first�last)r6r�r�r;r;r<r0�	szSClassPropertiesAndMethods.test_dict_constructors.<locals>.AddressBookEntry.__init__cSst|j|jg�Sr�)r}r�r�rxr;r;r<r~�	szSClassPropertiesAndMethods.test_dict_constructors.<locals>.AddressBookEntry.__iter__N)r�r�r�r0r~r;r;r;r<�AddressBookEntry�	sr��TimZWarsaw�BarryZPeters)r�r�rkrucSsg|]}||df�qSr)r;r|r;r;r<r~�	r�zDClassPropertiesAndMethods.test_dict_constructors.<locals>.<listcomp>)Ztooshort)Ztoo�longzby 1zno ValueError from dict(%r))rrBr2r3r}r��
ValueErrorr�r{rU�zipr�)r6rJZbadargr�r�Zbadr;r;r<�test_dict_constructorsR	sn






�z0ClassPropertiesAndMethods.test_dict_constructorscs@d}|�t�ddg�~dddddgddd	ddit|jfD]}t|�q:d
d�}Gdd
�d
t�}ddg}|�|t|��|�|�}|�|t|��|�d|_dd�|_|�|t|��|ddg�Gdd�d|�}ddg|}|�|t|��|�|�}	|�|t|	��|�d|	_dd�|	_|�|t|	��|ddg�Gdd�dtt	��}
|
d�}d|_
d|_gd ���fd!d"�t|�D�}|�|d#d$g�Gd%d&�d&|
�}
|
d'�}d|_
d|_|�|jd(�|�
t��t|�Wd�n1�s�0Y|�tt��tt��G�fd)d*�d*t��G�fd+d
�d
t�}t|��dS),Nr��junkr6rfy@g@�2�2�rfcSsdd�|D�S)NcSsg|]}|�d�s|�qS)r)r
)r}r�r;r;r<r~�	r�zKClassPropertiesAndMethods.test_dir.<locals>.interesting.<locals>.<listcomp>r;)�stringsr;r;r<�interesting�	sz7ClassPropertiesAndMethods.test_dir.<locals>.interestingc@seZdZdZdd�ZdS)�-ClassPropertiesAndMethods.test_dir.<locals>.CrecSsdSr�r;rxr;r;r<�Cmethod�	r�z5ClassPropertiesAndMethods.test_dir.<locals>.C.CmethodN)r�r�r��Cdatar�r;r;r;r<r��	sr�r�r�cSsdSr�r;rxr;r;r<r��	r�z4ClassPropertiesAndMethods.test_dir.<locals>.<lambda>�cdata�cmethodc@seZdZdZdd�ZdS)z-ClassPropertiesAndMethods.test_dir.<locals>.ArecSsdSr�r;rxr;r;r<�Amethod�	r�z5ClassPropertiesAndMethods.test_dir.<locals>.A.AmethodN)r�r�r��Adatar�r;r;r;r<r�	srr�r�r�cSsdS)Nrhr;rxr;r;r<r��	r��adata�amethodc@seZdZdS)z-ClassPropertiesAndMethods.test_dir.<locals>.MNrr;r;r;r<�M�	srrLre)r�r��__package__�
__loader__�__spec__csg|]}|�vr|�qSr;r;�r}r7)�default_attributesr;r<r~�	r�z6ClassPropertiesAndMethods.test_dir.<locals>.<listcomp>r?rRc@seZdZdd�Zee�ZdS)z.ClassPropertiesAndMethods.test_dir.<locals>.M2cSsdS)N�Not a dict!r;rxr;r;r<�getdict�	sz6ClassPropertiesAndMethods.test_dir.<locals>.M2.getdictN)r�r�r�r	r-rFr;r;r;r<r�	srZm2rcs<eZdZdd�Zdd�Z�fdd�Zdd�Z�fd	d
�ZdS)z3ClassPropertiesAndMethods.test_dir.<locals>.WrappercSs
||_dSr���
_Wrapper__objr6r;r;r<r0�	sz<ClassPropertiesAndMethods.test_dir.<locals>.Wrapper.__init__cSsdt|j�S)NzWrapper(%s))r�rrxr;r;r<r��	sz<ClassPropertiesAndMethods.test_dir.<locals>.Wrapper.__repr__cs�|j|�Sr�r
r���Wrapperr;r<rU�	sz?ClassPropertiesAndMethods.test_dir.<locals>.Wrapper.__getitem__cSs
t|j�Sr�)r�rrxr;r;r<r>�	sz;ClassPropertiesAndMethods.test_dir.<locals>.Wrapper.__len__cs�t|j|��Sr�)rErrirr;r<r�	sz?ClassPropertiesAndMethods.test_dir.<locals>.Wrapper.__getattr__N)r�r�r�r0r�rUr>rr;rr;r<r
�	s
r
cs eZdZ�fdd�Zee�ZdS)r�cs�t|��Sr�r{rxrr;r<Z
__getclass�	sz8ClassPropertiesAndMethods.test_dir.<locals>.C.__getclassN)r�r�r�Z_C__getclassr-r�r;rr;r<r��	s)rBr�rD�test_dirrr�r�rrr�rRr?rFrgr��Ellipsis)r6r�rr�r�ZcstuffrWrZastuffr?rZ	minstance�namesrZ
m2instancer;)r
rr<r�	sP&


(z"ClassPropertiesAndMethods.test_dircs�Gdd�dt�}|�|��d�d�G�fdd�d|��|����d�d�Gd	d
�d
|�}t|�|_|�|��d�d�G�fd
d�d|���|����d�d�G�fdd�dt��G��fdd�d���|����d�d�Gdd�d��}�|�|_|�|��d�d�zt�d�Wnt�y2Yn0|�d�zt�|��Wnt�ybYn0|�d�zt���d�Wnt�y�Yn0|�d�zt���|��Wnt�y�Yn0|�d �Gd!d"�d"t�}Gd#d$�d$|�}|�}|�|j	d%�|�t||�j	d�Gd&d'�d't�}G�fd(d)�d)|��|���
�|j�|�t��t|dd*�Wd�n1�s�0YdS)+Nc@seZdZdd�ZdS)z0ClassPropertiesAndMethods.test_supers.<locals>.AcSsd|S)NzA(%r)r;�r6r?r;r;r<rI
sz5ClassPropertiesAndMethods.test_supers.<locals>.A.methNr r;r;r;r<r
srrezA(1)cs&eZdZ��fdd�Zdd�Z�ZS)z0ClassPropertiesAndMethods.test_supers.<locals>.Bcst�|�|_dSr�)rr%rx)r#r�r;r<r0
sz9ClassPropertiesAndMethods.test_supers.<locals>.B.__init__cSsd||j�|�S)NzB(%r)r$rr;r;r<rI
sz5ClassPropertiesAndMethods.test_supers.<locals>.B.meth)r�r�r�r0rIrr;r]rr<r#

sr#rfzB(2)A(2)c@seZdZdd�ZdS)z0ClassPropertiesAndMethods.test_supers.<locals>.CcSsd||j�|�S)NzC(%r)r'rr;r;r<rI
sz5ClassPropertiesAndMethods.test_supers.<locals>.C.methNr r;r;r;r<r�
sr�rhzC(3)A(3)cseZdZ��fdd�Z�ZS)z0ClassPropertiesAndMethods.test_supers.<locals>.Dcsd|t�|��|�S)NzD(%r))rrIr)rr�r;r<rI
sz5ClassPropertiesAndMethods.test_supers.<locals>.D.meth)r�r�r�rIrr;�rrr<r
srrkzD(4)C(4)B(4)A(4)cseZdZ��fdd�Z�ZS)z6ClassPropertiesAndMethods.test_supers.<locals>.mysupercst�|�j|�Sr�r�r=)r��mysuperr;r<r0"
sz?ClassPropertiesAndMethods.test_supers.<locals>.mysuper.__init__)r�r�r�r0rr;)rrr<r!
srcseZdZ��fdd�ZdS)z0ClassPropertiesAndMethods.test_supers.<locals>.Ecsd|��|��|�S)NzE(%r))rIr�r,rr;r<rI&
sz5ClassPropertiesAndMethods.test_supers.<locals>.E.methNr r;rr;r<r,%
sr,ruzE(5)D(5)C(5)B(5)A(5)c@seZdZdd�ZdS)z0ClassPropertiesAndMethods.test_supers.<locals>.FcSs |j}d||jjf|�|�S)Nz	F(%r)[%s])�	_F__superr�r�rI)r6r?r�r;r;r<rI,
sz5ClassPropertiesAndMethods.test_supers.<locals>.F.methNr r;r;r;r<rc+
srcrvz!F(6)[mysuper]E(6)D(6)C(6)B(6)A(6)r�zshouldn't allow super(D, 42)zshouldn't allow super(D, C())r�z$shouldn't allow super(D).__get__(12)z%shouldn't allow super(D).__get__(C())c@seZdZdd�Zee�ZdS)z5ClassPropertiesAndMethods.test_supers.<locals>.DDbasecSsdSrr;rxr;r;r<r�U
r�z:ClassPropertiesAndMethods.test_supers.<locals>.DDbase.getxN�r�r�r�r�r-r7r;r;r;r<�DDbaseT
src@seZdZdd�Zee�ZdS)z4ClassPropertiesAndMethods.test_supers.<locals>.DDsubcSsdSr|r;rxr;r;r<r�Y
r�z9ClassPropertiesAndMethods.test_supers.<locals>.DDsub.getxNrr;r;r;r<�DDsubX
srr�c@seZdZedd��ZdS)z3ClassPropertiesAndMethods.test_supers.<locals>.BasecSsdSr\r;rxr;r;r<r�d
r�z<ClassPropertiesAndMethods.test_supers.<locals>.Base.<lambda>N)r�r�r�r-�aPropr;r;r;r<�Basec
srcs"eZdZe��fdd��Z�ZS)z2ClassPropertiesAndMethods.test_supers.<locals>.Subcst�|�jSr�)rr)�klass)�Subr�r;r<r�g
sz7ClassPropertiesAndMethods.test_supers.<locals>.Sub.test)r�r�r�rLr�rr;)rrr<rf
srr)
rrBrIrr(rr�r�rr7r�rrg)r6rr�rcrr�ddrr)r#rr,rrr<�test_supers
sZ





z%ClassPropertiesAndMethods.test_superscsG�fdd�dt��|�t�d�d�d�|�t�d�d�d��d�}|�|d�|�t|�d�|�t|�jt�|�t|�td��|�|
jt�|�|d	?jt�|�|d	>jt�|��d	�d
>jt�|��d	�d
?jt�G�fdd�dt��|�t�d
�d�d�|�td�d��d��d�}|�|d�|�t|�d�|�t|�td��|�t|�jt�|�|
jt�|�|jt�|��d	�jt�|�|d	?jt�|�|d	>jt�|�|d	jt�|�|djt�|�|djt�|�|djt�|�d|jt�|�|d	Bjt�|�|d	Ajt�|�|d@jt�|��d	�d
>jt�|��d	�d
?jt�|�t�d	��jt�Gdd�dt�}|d�}|�|d	jt�|�d	|jt�|d�}|�|ji�|�t|�d�Gdd�dt	�}|�t|d��d�|d�}|�|d�|�t	|�d�|�t	|�jt	�|�t|�td��|�|
jt	�Gdd�dt
�}|dd�}|�t|�d�t
dd�}|�|jt
�|�||�|�t
|�|�|�t
|�jt
�||�}|�t|�d�|�||�|�t
|�|�|�t
|�jt
�|�t|�t|��|�|
jt
�|�|d	jt
�|�|d	|�|�|d	jt
�|�|d	|�|�|djt
�|�|d|�|�|djt
�|�|d|�Gd d!�d!t�}|d"�}|�|d"�|�|��|d#��|�|����|d"��t
d$�D].}|t
|��}|��}	|	��}
|�|
|��q@|d%�}|�t|�d%�|�t|�jt�|�t|�td%��|�|dd�jt�|�|djt�|�|d	jt�|�|d&jt�|d&�}|�t|�d&�|�t|�jt�|�||jt�|�|d	jt�|�|djt�|�|d'jt�|�|dd�jt�Gd(d)�d)t�}|d*�}|�|d*�|�|��|d+��|�|����|d*��t
d,�D]:}|d-�ttt
|����}|��}|��}	|�|	|��q�|d.�}|�t|�d.�|�t|�jt�d/}||�}|�||�|�t|�|�|�t|�jt�|�t|�t|��|�|di|d�|�|di|d�|�|d-jt�|�|d-|�|�d-|jt�|�d-||�|�|d	jt�|�|d	d-�|�|djt�|�|d|�|�|d'jt�|�|d'||�|�|dd�jt�|�|dd�|�|�|d	d	�jt�|�|d	d	�d-�|�|��jt�|�|��|�|�|��jt�|�|��|�|�|��jt�|�|��|�i}
|�|�|
�jt�|�|�|
�|�|�|�d0d0�jt�|�|�d0d0�|�|�|�t|��jt�|�|�t|��|�|�|�t|��jt�|�|�t|��|�|�|�t|��jt�|�|�t|��|�|�|��jt�|�|��|�Gd1d2�d2t�}|d3�}	|�|	d3�|�|	��|d4��|�|	����|d3��d.}||�}	|�t|	�|�|�t|	�jt�|�t|	�t|��|�|	di|d�|�|di|	d�|�|	��jt�|�|	��|�|�|	��jt�|�|	��|�|�|	��jt�|�|	��|�|�|	�d0d0�jt�|�|	�d0d0�|�|�|	�d5d5�jt�|�|	�d5d5�|�|�|	�t|	��jt�|�|	�t|	��|�|�|	�t|	��jt�|�|	�t|	��|�|�|	�t|	��jt�|�|	�t|	��|�|�|	��jt�|�|	��|�|�|	��jt�|�|	��|�|�|	��jt�|�|	��|�|�|	��jt�|�|	��|�|�|	d-jt�|�|	d-|�|�d-|	jt�|�d-|	|�|�|	d	jt�|�|	d	d-�|�|	djt�|�|	d|�|�|	d'jt�|�|	d'||�|�|	dd�jt�|�|	dd�|�|�|	d	d	�jt�|�|	d	d	�d-�Gd6d7�d7t�}|t
d��}|�|tt
d���|�d8�|�|tt
d��d8g�d|d<|�|tt
d9���|� t
d9d:��|�|tt
d:���g|d;d�<|�|tt
d<���|d=d<�=|�t|�d=�|�|tt
d=���|�t|�tt
d=���|�|d	d	�|�|dd�|�|d>d	�|�|dd�|�|dd�tt
d���dS)?Ncs eZdZdd�Z�fdd�ZdS)z@ClassPropertiesAndMethods.test_basic_inheritance.<locals>.hexintcSst|�Sr�)�hexrxr;r;r<r�u
szIClassPropertiesAndMethods.test_basic_inheritance.<locals>.hexint.__repr__cs�t�||��Sr�)r)rPr���hexintr;r<rPw
szHClassPropertiesAndMethods.test_basic_inheritance.<locals>.hexint.__add__N)r�r�r�r�rPr;r r;r<r!t
sr!��	Z0x10i�Z0x3efi90rr�cs.eZdZgZdd�Z��fdd�ZeZ�ZS)zAClassPropertiesAndMethods.test_basic_inheritance.<locals>.octlongcSst|�Sr�)�octrxr;r;r<r��
szIClassPropertiesAndMethods.test_basic_inheritance.<locals>.octlong.__str__cs|�t�|��|��Sr�)r�rrPr�)r��octlongr;r<rP�
szIClassPropertiesAndMethods.test_basic_inheritance.<locals>.octlong.__add__)r�r�r�r�r�rPr�rr;)r%rr<r%�
sr%rhruZ0o10i�Z0o5675rer�c@seZdZdS)zCClassPropertiesAndMethods.test_basic_inheritance.<locals>.longcloneNrr;r;r;r<�	longclone�
sr&c@s$eZdZdgZd	dd�Zdd�ZdS)
zCClassPropertiesAndMethods.test_basic_inheritance.<locals>.precfloatr�r�r�cSst|�|_dSr�)r)r�)r6r�r�r;r;r<r0�
szLClassPropertiesAndMethods.test_basic_inheritance.<locals>.precfloat.__init__cSsd|j|fS)Nr�r�rxr;r;r<r��
szLClassPropertiesAndMethods.test_basic_inheritance.<locals>.precfloat.__repr__N)r�r�)r�r�r�r�r0r�r;r;r;r<�	precfloat�
s
r'g�������?z1.1g��@c@seZdZdd�ZdS)zDClassPropertiesAndMethods.test_basic_inheritance.<locals>.madcomplexcSsd|j|jfS)Nz%.17gj%+.17g�r�r�rxr;r;r<r��
szMClassPropertiesAndMethods.test_basic_inheritance.<locals>.madcomplex.__repr__N)r�r�r�r�r;r;r;r<�
madcomplex�
sr)���rkz4j-3c@seZdZdZdd�ZdS)zBClassPropertiesAndMethods.test_basic_inheritance.<locals>.madtupleNcSs2|jdur|jSt|�}|��|�|�|_|jSr�)�_revr2rTr��r6rUr;r;r<�rev�
s
zFClassPropertiesAndMethods.test_basic_inheritance.<locals>.madtuple.rev�r�r�r�r+r-r;r;r;r<�madtuple�
sr/)
rerfrhrkrurvr"�r#r)
rr#r0r"rvrurkrhrfrei)rerfrhrkrur;rfc@seZdZdZdd�ZdS)zCClassPropertiesAndMethods.test_basic_inheritance.<locals>.madstringNcSs8|jdur|jSt|�}|��|�d�|��|_|jS�Nr��r+r2rTr�rur,r;r;r<r-s
zGClassPropertiesAndMethods.test_basic_inheritance.<locals>.madstring.revr.r;r;r;r<�	madstringsr3�abcdefghijklmnopqrstuvwxyzZzyxwvutsrqponmlkjihgfedcba�r�Z12345zr7c@seZdZdZdd�ZdS)zDClassPropertiesAndMethods.test_basic_inheritance.<locals>.madunicodeNcSs8|jdur|jSt|�}|��|�d�|��|_|jSr1r2r,r;r;r<r-Cs
zHClassPropertiesAndMethods.test_basic_inheritance.<locals>.madunicode.revr.r;r;r;r<�
madunicodeAsr6ZABCDEFZFEDCBAZxyc@seZdZdS)zAClassPropertiesAndMethods.test_basic_inheritance.<locals>.sublistNrr;r;r;r<�sublist|sr7r�rv�����r�r�)!r)rBr�r�r�r�r�r'rFr*r�r�r-r�ru�mapr��strip�lstrip�rstrip�	translate�replace�ljustr��rjust�center�lower�upper�
capitalize�titler2r|r�)r6r?r&r'r)�baser/r�rKr�r�r3r�Zidentitytabr6r7r;)r!r%r<�test_basic_inheritanceq
s�

			

z0ClassPropertiesAndMethods.test_basic_inheritancec	Cs�|�td��tdd�Wd�n1s,0Y|�td��tdd�Wd�n1sb0Y|�td��tdd�Wd�n1s�0Y|�tddd�tdd��|�tdd	�d
�|�tddd
�d�|�td��tt	d�d�Wd�n1�s0Y|�td��t
dd�Wd�n1�sL0Ytttttttt
fD]8}z|dd�Wnt�y�Yn0|�d|��qjdS)Nzkeyword argumentrerdrfr�i�r(i�r��500�abc�strict)r�errorsr�rh)Zsequencer�)Zbogus_keyword_argz4expected TypeError from bogus keyword argument to %r)ZassertRaisesRegexr�r)r*�boolrBr�r�r�r�r2r�)r6�constructorr;r;r<�
test_keywords�s.(((.*��z'ClassPropertiesAndMethods.test_keywordscs�G�fdd�dt��|��d�d�|�d�d��|�t�d��d��d�d�d�d	�d
�di}|�|�d�d�|�|�d�d	�|�|�d
�d�|��d�|�|�|��d��d�dS)Ncs(eZdZdd�Z�fdd�Zdd�ZdS)zFClassPropertiesAndMethods.test_str_subclass_as_dict_key.<locals>.cistrcSs|��|_t|j�|_dSr�)rD�	canonicalr��hashcoder�r;r;r<r0�s
zOClassPropertiesAndMethods.test_str_subclass_as_dict_key.<locals>.cistr.__init__cst|��s�|�}|j|jkSr�)r�rQr���cistrr;r<r��s
zMClassPropertiesAndMethods.test_str_subclass_as_dict_key.<locals>.cistr.__eq__cSs|jSr�)rRrxr;r;r<r��szOClassPropertiesAndMethods.test_str_subclass_as_dict_key.<locals>.cistr.__hash__N)r�r�r�r0r�r�r;rSr;r<rT�srT�ABCr�ZaBcr�rer�rfZtHreerhZtWoZTHrEEZONeZthrEE)r�rBrer�)r6rJr;rSr<�test_str_subclass_as_dict_key�sz7ClassPropertiesAndMethods.test_str_subclass_as_dict_keyc
s�Gdd�d�}|ttfD]�}G�fdd�d|���d�}�d�}�d�}|�|d�|||d�}dD]�}dD]�}d	D]v}	|�td
|	�td|	�d||f�|�td
|	�td|	�d||f�|�td|	�td|	�d||f�qtqlqdqdS)Nc@seZdZdS)zCClassPropertiesAndMethods.test_classic_comparisons.<locals>.classicNrr;r;r;r<�classic�srWcs\eZdZdd�Z�fdd�Z�fdd�Z�fdd�Z�fd	d
�Z�fdd�Z�fd
d�Z	dS)z=ClassPropertiesAndMethods.test_classic_comparisons.<locals>.CcSst|�|_dSr��r)r�r�r;r;r<r0�szFClassPropertiesAndMethods.test_classic_comparisons.<locals>.C.__init__cs8t|��r|j|jkSt|t�s*t|t�r4|j|kStSr��r�r�r)r�r�r�r;r<r�s


zDClassPropertiesAndMethods.test_classic_comparisons.<locals>.C.__eq__cs8t|��r|j|jkSt|t�s*t|t�r4|j|kStSr�rYr�r�r;r<r�s


zDClassPropertiesAndMethods.test_classic_comparisons.<locals>.C.__ne__cs8t|��r|j|jkSt|t�s*t|t�r4|j|kStSr�rYr�r�r;r<r�
s


zDClassPropertiesAndMethods.test_classic_comparisons.<locals>.C.__lt__cs8t|��r|j|jkSt|t�s*t|t�r4|j|kStSr�rYr�r�r;r<r�s


zDClassPropertiesAndMethods.test_classic_comparisons.<locals>.C.__le__cs8t|��r|j|jkSt|t�s*t|t�r4|j|kStSr�rYr�r�r;r<r�s


zDClassPropertiesAndMethods.test_classic_comparisons.<locals>.C.__gt__cs8t|��r|j|jkSt|t�s*t|t�r4|j|kStSr�rYr�r�r;r<r�s


zDClassPropertiesAndMethods.test_classic_comparisons.<locals>.C.__ge__N)
r�r�r�r0r�r�r�r�r�r�r;r�r;r<r��sr�rerfrhrg�rrrrrr�c[x] %s c[y]�x %s y�
x=%d, y=%d�	c[x] %s y�	x %s c[y])r)rrBrC)
r6rWrHrfr��c3rWr7�y�opr;r�r<�test_classic_comparisons�s.(

�

�

�z2ClassPropertiesAndMethods.test_classic_comparisonscsZGdd�dt�}|d�}��|d���d|�Gdd�dt�}|d�}��|d���d|�Gdd	�d	�}|tttfD]�}G��fd
d�d|���d�}�d�}�d
�}	��|d�|||	d�}
dD]�}dD]�}dD]v}
��td|
�td|
�d||f���td|
�td|
�d||f���td|
�td|
�d||f�q�q�q�qzdS)Nc@seZdZdS)z:ClassPropertiesAndMethods.test_rich_comparisons.<locals>.ZNrr;r;r;r<rY:srYrey�?c@seZdZdd�ZdS)z;ClassPropertiesAndMethods.test_rich_comparisons.<locals>.ZZcSs(zt||�dkWStYS0dS)Ng���ư>)r'r�r�r;r;r<r�@szBClassPropertiesAndMethods.test_rich_comparisons.<locals>.ZZ.__eq__Nr�r;r;r;r<�ZZ?srdg�ׇP�?c@seZdZdS)z@ClassPropertiesAndMethods.test_rich_comparisons.<locals>.classicNrr;r;r;r<rWIsrWcsheZdZdd�Z�fdd�Z�fdd�Z�fdd�Z�fd	d
�Z�fdd�Z�fd
d�Z	�fdd�Z
dS)z:ClassPropertiesAndMethods.test_rich_comparisons.<locals>.CcSst|�|_dSr�rXr�r;r;r<r0MszCClassPropertiesAndMethods.test_rich_comparisons.<locals>.C.__init__cs��d�dS)Nzshouldn't call __cmp__)r�)r�r�rxr;r<�__cmp__OszBClassPropertiesAndMethods.test_rich_comparisons.<locals>.C.__cmp__cs8t|��r|j|jkSt|t�s*t|t�r4|j|kStSr�rYr�r�r;r<r�Qs


zAClassPropertiesAndMethods.test_rich_comparisons.<locals>.C.__eq__cs8t|��r|j|jkSt|t�s*t|t�r4|j|kStSr�rYr�r�r;r<r�Ws


zAClassPropertiesAndMethods.test_rich_comparisons.<locals>.C.__ne__cs8t|��r|j|jkSt|t�s*t|t�r4|j|kStSr�rYr�r�r;r<r�]s


zAClassPropertiesAndMethods.test_rich_comparisons.<locals>.C.__lt__cs8t|��r|j|jkSt|t�s*t|t�r4|j|kStSr�rYr�r�r;r<r�cs


zAClassPropertiesAndMethods.test_rich_comparisons.<locals>.C.__le__cs8t|��r|j|jkSt|t�s*t|t�r4|j|kStSr�rYr�r�r;r<r�is


zAClassPropertiesAndMethods.test_rich_comparisons.<locals>.C.__gt__cs8t|��r|j|jkSt|t�s*t|t�r4|j|kStSr�rYr�r�r;r<r�os


zAClassPropertiesAndMethods.test_rich_comparisons.<locals>.C.__ge__N)r�r�r�r0rer�r�r�r�r�r�r;�r�r6r;r<r�Lsr�rfrhrgrZr[r\r]r^r_)r�rBr)rr2rC)r6rYr�rd�zzrWrHrfr�r`rWr7rarbr;rfr<�test_rich_comparisons8s>)

�

�

�z/ClassPropertiesAndMethods.test_rich_comparisonscs4ddlm}�fdd�}||jd�|tjd�dS)Nr)�FileIOcs��|j|�dSr�)rBr�)�descrZwhatrxr;r<�check�sz6ClassPropertiesAndMethods.test_descrdoc.<locals>.checkzTrue if the file is closedz!the real part of a complex number)�_iori�closedr�r�)r6rirkr;rxr<�
test_descrdoc�sz'ClassPropertiesAndMethods.test_descrdoccsvGdd�dt��G�fdd�d�}G�fdd�dt�}|�|jd�|�|�jd�|�|jd	�|�|�jd
�dS)Nc@seZdZdd�ZdS)z?ClassPropertiesAndMethods.test_doc_descriptor.<locals>.DocDescrcSs&|r|jjd}|r|j}d||fS)Nz	 instancezobject=%s; type=%s)r�r�)r6rZotyper;r;r<r�s
zGClassPropertiesAndMethods.test_doc_descriptor.<locals>.DocDescr.__get__Nr�r;r;r;r<�DocDescr�srocseZdZ��ZdS)z?ClassPropertiesAndMethods.test_doc_descriptor.<locals>.OldClassN�r�r�r�r�r;�ror;r<�OldClass�srrcseZdZ��ZdS)z?ClassPropertiesAndMethods.test_doc_descriptor.<locals>.NewClassNrpr;rqr;r<�NewClass�srszobject=None; type=OldClassz'object=OldClass instance; type=OldClasszobject=None; type=NewClassz'object=NewClass instance; type=NewClass)rrBr�)r6rrrsr;rqr<�test_doc_descriptor�sz-ClassPropertiesAndMethods.test_doc_descriptorcsGdd�dt�}Gdd�dt�}Gdd�dt�}Gdd�d||�}||||fD]D}||||fD]2}|�}||_��|j|�||_��|j|�q^qN�fd	d
�}||�t�|t�|�||�d�||�t�|t�t�|t�t�Gdd
�d
t�}	|dt�|dt�t�}
||
td��||
td��~
Gdd�dt�}Gdd�dt�}Gdd�dt�}
Gdd�dt�}Gdd�dt�}Gdd�d|�}Gdd�d|
�}Gdd�d|�}Gd d!�d!|�}Gd"d#�d#|�}Gd$d%�d%|�}||f||
f|
|f||f||ffD]n\}}|�}d|_||_��|j|d&||f���|jd�||_��|j|d&||f���|jd��q||||||||t|	f
D]@}||||||||t|	f
D] }||u�r��q�||�|��q��q�Gd'd(�d(t��G�fd)d*�d*t���fd+d,�t	d-�D�}~dS).Nc@seZdZdS)z3ClassPropertiesAndMethods.test_set_class.<locals>.CNrr;r;r;r<r��r�r�c@seZdZdS)z3ClassPropertiesAndMethods.test_set_class.<locals>.DNrr;r;r;r<r�r�rc@seZdZdS)z3ClassPropertiesAndMethods.test_set_class.<locals>.ENrr;r;r;r<r,�r�r,c@seZdZdS)z3ClassPropertiesAndMethods.test_set_class.<locals>.FNrr;r;r;r<rc�r�rcc	shz
||_WntyYn0��d||f�zt|d�WnttfyTYn0��d|�dS)Nz!shouldn't allow %r.__class__ = %rr�z shouldn't allow del %r.__class__)r�r�r�rpr�)r7r�rxr;r<�cant�s
z6ClassPropertiesAndMethods.test_set_class.<locals>.cantrec@seZdZgZdS)z5ClassPropertiesAndMethods.test_set_class.<locals>.IntNr�r;r;r;r<�Int�r�rvTrfc@seZdZddgZdS)z3ClassPropertiesAndMethods.test_set_class.<locals>.Gr?rRNr�r;r;r;r<r��sr�c@seZdZddgZdS)z3ClassPropertiesAndMethods.test_set_class.<locals>.HrRr?Nr�r;r;r;r<r��sr�c@seZdZddgZdS)z3ClassPropertiesAndMethods.test_set_class.<locals>.Ir?rRNr�r;r;r;r<r�src@seZdZddgZdS)z3ClassPropertiesAndMethods.test_set_class.<locals>.JrWrRNr�r;r;r;r<�J�srwc@seZdZgd�ZdS)z3ClassPropertiesAndMethods.test_set_class.<locals>.K)r?rRrJNr�r;r;r;r<�K�srxc@seZdZdgZdS)z3ClassPropertiesAndMethods.test_set_class.<locals>.Lr�Nr�r;r;r;r<rU�srUc@seZdZdgZdS)z3ClassPropertiesAndMethods.test_set_class.<locals>.Mr�Nr�r;r;r;r<r�src@seZdZdgZdS)z3ClassPropertiesAndMethods.test_set_class.<locals>.Nr�Nr�r;r;r;r<r��sr�c@seZdZdgZdS)z3ClassPropertiesAndMethods.test_set_class.<locals>.PrFNr�r;r;r;r<�P�sryc@seZdZdS)z3ClassPropertiesAndMethods.test_set_class.<locals>.QNrr;r;r;r<�Q�srzc@seZdZddgZdS)z3ClassPropertiesAndMethods.test_set_class.<locals>.RrFr�Nr�r;r;r;r<�R�sr{z0assigning %r as __class__ for %r silently failedc@seZdZdS)z3ClassPropertiesAndMethods.test_set_class.<locals>.ONrr;r;r;r<�O�sr|cseZdZ�fdd�ZdS)z3ClassPropertiesAndMethods.test_set_class.<locals>.Acs
�|_dSr�rrx�r|r;r<r��sz;ClassPropertiesAndMethods.test_set_class.<locals>.A.__del__N�r�r�r�r�r;r}r;r<r�srcsg|]
}���qSr;r;r)rr;r<r~�r�z<ClassPropertiesAndMethods.test_set_class.<locals>.<listcomp>r�)
rr�r�r2r)rNrDr?rBr�)r6r�rr,rcr�Zcls2r7rurv�or�r�rrwrxrUrr�ryrzr{r�r;)rr|r6r<�test_set_class�st


*

�

�
z(ClassPropertiesAndMethods.test_set_classc	s�Gdd�dt�}|�}ddi|_��|jd��fdd���|d��|g��|d�|`Gdd�dt�����fd	d
�}Gdd�dt��}Gd
d�d�t�}Gdd�dt|d�}Gdd�dt|d�}|||fD]B}||�|j}	zd|	d<Wnt�yYq�0��d|�q�Gdd�dtj��}
Gdd�d�tj�}|
|fD] }|d�}
||
�d|
jd<�qFdd�}Gdd�dt	��}Gdd �d �t	�}t	||fD]:}|�}d!di|_��|j
d���||�|t����q�dS)"Nc@seZdZdS)z2ClassPropertiesAndMethods.test_set_dict.<locals>.CNrr;r;r;r<r��r�r�rRrec	s8z
||_Wnttfy Yn0��d||f�dS)Nz shouldn't allow %r.__dict__ = %r)rFr�r�r�)r7rrxr;r<ru
s

z5ClassPropertiesAndMethods.test_set_dict.<locals>.cantc@seZdZdS)z5ClassPropertiesAndMethods.test_set_dict.<locals>.BaseNrr;r;r;r<r

src	s|�|i�z|`Wnttfy(Yn0��d|��jd}z|�|i�WnttfyhYn0��d|�dS)Nzshouldn't allow del %r.__dict__rFz&dict_descr allowed access to %r's dict)rFr�r�r�r�)r7Z
dict_descr�rrur6r;r<�verify_dict_readonly
s

zEClassPropertiesAndMethods.test_set_dict.<locals>.verify_dict_readonlyc@seZdZdS)z6ClassPropertiesAndMethods.test_set_dict.<locals>.Meta1Nrr;r;r;r<�Meta1#
sr�c@seZdZdS)z6ClassPropertiesAndMethods.test_set_dict.<locals>.Meta2Nrr;r;r;r<�Meta2%
sr�c@seZdZdS)z2ClassPropertiesAndMethods.test_set_dict.<locals>.DNrr;r;r;r<r'
srr�c@seZdZdS)z2ClassPropertiesAndMethods.test_set_dict.<locals>.ENrr;r;r;r<r,)
sr,Zeggsr�z%r's __dict__ can be modifiedc@seZdZdS)z8ClassPropertiesAndMethods.test_set_dict.<locals>.Module1Nrr;r;r;r<�Module16
sr�c@seZdZdS)z8ClassPropertiesAndMethods.test_set_dict.<locals>.Module2Nrr;r;r;r<�Module28
sr�c	Ss*z|`Wnttfy YdS0dSdS)NFT)rFr�r�)r�r;r;r<�can_delete_dictC
s
z@ClassPropertiesAndMethods.test_set_dict.<locals>.can_delete_dictc@seZdZdS)z;ClassPropertiesAndMethods.test_set_dict.<locals>.Exception1Nrr;r;r;r<�
Exception1J
sr�c@seZdZdS)z;ClassPropertiesAndMethods.test_set_dict.<locals>.Exception2Nrr;r;r;r<�
Exception2L
sr�r?)rrFrBrRrDr�r�rr�r�r?r�)r6r�r?r�r�r�rr,r�Z
class_dictr�r�r�r�r�r�r�Z
ExceptionTyper�r;r�r<�
test_set_dict�sJ




z'ClassPropertiesAndMethods.test_set_dictcs�G�fdd�dt��|�t�d��d��d�|�t�d�d�d�|�td�d��d�|�t�d��d��d�|�td�d��d�|�t�d�d�d�|�tt�d��d��d���d�Gd	d
�d
t�}dS)Ncs@eZdZdd�Z�fdd�ZeZd
�fdd�	Zd�fdd	�	ZdS)zBClassPropertiesAndMethods.test_binary_operator_override.<locals>.IcSsdt|�S)NzI(%r)�r)rxr;r;r<r�W
szKClassPropertiesAndMethods.test_binary_operator_override.<locals>.I.__repr__cs�t|�t|��Sr�r�r��rr;r<rPY
szJClassPropertiesAndMethods.test_binary_operator_override.<locals>.I.__add__Ncs>|dur�tt|�t|���S�tt|�t|�t|���SdSr��rr)�r6r�r�r�r;r<�__pow__\
szJClassPropertiesAndMethods.test_binary_operator_override.<locals>.I.__pow__cs@|dur �tt|�t|�|��S�tt|�t|�t|���SdSr�r�r�r�r;r<�__rpow__a
szKClassPropertiesAndMethods.test_binary_operator_override.<locals>.I.__rpow__)N)N)r�r�r�r�rPr�r�r�r;r�r;r<rV
s
rrerfzI(3)rhzI(8)ruc@seZdZdd�ZdS)zBClassPropertiesAndMethods.test_binary_operator_override.<locals>.ScSs|��|��kSr�)rDr�r;r;r<r�o
szIClassPropertiesAndMethods.test_binary_operator_override.<locals>.S.__eq__Nr�r;r;r;r<�Sn
sr�)r)rBr�rr�)r6r�r;r�r<�test_binary_operator_overrideT
s$z7ClassPropertiesAndMethods.test_binary_operator_overridec	CszGdd�dt�}Gdd�d|�}Gdd�d|�}Gdd�d||�}|�}t|�}d	d
�|_|�t|�d�dd
�|_|�t|�d
�dd
�|_|�t|�d�dd
�|_|�t|�d�d|_|�tt|�|`|�t|�d�d|_|�tt|�|`|�t|�d
�d|_|�tt|�|`|�t|�d�d|_|�tt|�|`|�t|�|�d|_d|_|�|jd�|�|jd�dd�}||_|�|jd�|�|jd�dd�}||_	|�|j
d�|�|jd�|�|jd�|`|�|jd�|`|�|jd�|�|jd�|`	z
|jWnt�y6Yn0|�d�Gdd�dt�}Gdd�d|�}~t
��dd
�|_dS)Nc@seZdZdS�z>ClassPropertiesAndMethods.test_subclass_propagation.<locals>.ANrr;r;r;r<rt
src@seZdZdS�z>ClassPropertiesAndMethods.test_subclass_propagation.<locals>.BNrr;r;r;r<r#v
sr#c@seZdZdS)z>ClassPropertiesAndMethods.test_subclass_propagation.<locals>.CNrr;r;r;r<r�x
sr�c@seZdZdS)z>ClassPropertiesAndMethods.test_subclass_propagation.<locals>.DNrr;r;r;r<rz
srcSsdSrr;rxr;r;r<r�~
r�zEClassPropertiesAndMethods.test_subclass_propagation.<locals>.<lambda>r�cSsdS)N�:r;rxr;r;r<r��
r�r�cSsdS)N�r;rxr;r;r<r��
r�r�cSsdSr�r;rxr;r;r<r��
r�r�cSs|dkrdSt�||�S)Nr�r�)rrkrir;r;r<rk�
szMClassPropertiesAndMethods.test_subclass_propagation.<locals>.__getattribute__r�cSs|dvrdSt|��dS)N)r�r�r�r�rrir;r;r<r�
szHClassPropertiesAndMethods.test_subclass_propagation.<locals>.__getattr__r�zd.foo should be undefined nowc@seZdZdSr�rr;r;r;r<r�
sc@seZdZdSr�rr;r;r;r<r#�
scWsdSr�r;rr;r;r<r��
r�)rr�r�rBrgr�r�r�rkrr�r�r�rr�ra)	r6rr#r�rrJZ	orig_hashrkrr;r;r<�test_subclass_propagationr
sv





z3ClassPropertiesAndMethods.test_subclass_propagationcCs�ddl}Gdd�dt�}d}||�}|�|�|�|�|��Gdd�dt�}|d�}z|�|�|�d�Wnty~Yn0dS)	Nrc@seZdZdS)zBClassPropertiesAndMethods.test_buffer_inheritance.<locals>.MyBytesNrr;r;r;r<r��
sr�rKc@seZdZdS)z@ClassPropertiesAndMethods.test_buffer_inheritance.<locals>.MyIntNrr;r;r;r<r��
sr�r�z2subclass of int should not have a buffer interface)�binasciir�rB�b2a_hexr)r�r�)r6r�r�rHrLr�r;r;r<�test_buffer_inheritance�
s
z1ClassPropertiesAndMethods.test_buffer_inheritancecs�ddl�ddl}G�fdd�dt�}|d�}|�t|�|�|�tt|��t�|�tt|��t�|�t|�d�|�t|�d�|�t|�d�|�|��d�|�|��d�|�	�}t
||d�t
t|�|d�|�|��d	�|��dS)
Nrcs eZdZ�fdd�Zdd�ZdS)zGClassPropertiesAndMethods.test_str_of_str_subclass.<locals>.octetstringcs��|�d���d�S)N�ascii)r��encode�decoderx�r�r;r<r��
szOClassPropertiesAndMethods.test_str_of_str_subclass.<locals>.octetstring.__str__cSs|dS)Nz reprr;rxr;r;r<r��
szPClassPropertiesAndMethods.test_str_of_str_subclass.<locals>.octetstring.__repr__N)r�r�r�r�r�r;r�r;r<�octetstring�
sr�r�AZ41zA repr)�filez41
41
)
r��ior�rBrDr��ordr�r��StringIO�printr��close)r6r�r�r�capturer;r�r<�test_str_of_str_subclass�
s"z2ClassPropertiesAndMethods.test_str_of_str_subclasscCsDdd�}|�|jdd�d�t�}tj|dddd�|�|d	�dS)
NcSs|Sr�r;rr;r;r<r�
r�z;ClassPropertiesAndMethods.test_keyword_arguments.<locals>.fr�ruabc½€�latin1r@)�encodingrMsabc�?)rBr�	bytearrayr0)r6rZbar;r;r<�test_keyword_arguments�
s�z0ClassPropertiesAndMethods.test_keyword_argumentscCsFGdd�dt�}|�|_z|��Wnty6Yn0|�d�dS)Nc@seZdZdS)z8ClassPropertiesAndMethods.test_recursive_call.<locals>.ANrr;r;r;r<r�
srz7Recursion limit should have been reached for __call__())rr�RecursionErrorr�rHr;r;r<�test_recursive_call�
sz-ClassPropertiesAndMethods.test_recursive_callcs�g�G�fdd�dt�}|�}|��g�~t��|��dg�Gdd�dt�}|�}z
|d=WntytYn0|�d�dS)NcseZdZ�fdd�ZdS)z5ClassPropertiesAndMethods.test_delete_hook.<locals>.Ccs��d�dSr�r]rx�rmr;r<r�sz=ClassPropertiesAndMethods.test_delete_hook.<locals>.C.__del__Nr~r;r�r;r<r�sr�rec@seZdZdS)z5ClassPropertiesAndMethods.test_delete_hook.<locals>.DNrr;r;r;r<rr�rrz$invalid del() didn't raise TypeError)rrBrr�r�r�)r6r�rWrrJr;r�r<�test_delete_hooksz*ClassPropertiesAndMethods.test_delete_hookcCs�Gdd�dt�}|�}zt|�Wnty4Yn0|�d�Gdd�dt�}|�}zt|�WntytYn0|�d�dS)Nc@seZdZdS)z?ClassPropertiesAndMethods.test_hash_inheritance.<locals>.mydictNrr;r;r;r<�mydictsr�z#hash() of dict subclass should failc@seZdZdS)z?ClassPropertiesAndMethods.test_hash_inheritance.<locals>.mylistNrr;r;r;r<�mylist'sr�z#hash() of list subclass should fail)rr�r�r�r2)r6r�rJr�r;r;r<�test_hash_inheritances
z/ClassPropertiesAndMethods.test_hash_inheritancecCs�zddWntyYn0|�d�zd�d�WntyJYn0|�d�zd�dg�WntyxYn0|�d�zd�d�Wnty�Yn0|�d	�zd
dWnty�Yn0|�d�zdiWnty�Yn0|�d
�zddWnt�y$Yn0|�d�zddWnt�yPYn0|�d�zddWnt�y|Yn0|�d�zddWnt�y�Yn0|�d�|�d��d�|�d��d�|�ddd�|�ddd�dS)Nr?ruz'' + 5 doesn't raise TypeErrorr�z%''.split('') doesn't raise ValueErrorrz$''.join([0]) doesn't raise TypeError�5z'''.rindex('5') doesn't raise ValueErrorz%(n)sz&'%(n)s' % None doesn't raise TypeErrorz%(nz&'%(n' % {} '' doesn't raise ValueErrorz%*sr�z''%*s' % ('abc') doesn't raise TypeErrorz%*.*s)r�ruz,'%*.*s' % ('abc', 5) doesn't raise TypeErrorz%s�rerfz%'%s' % (1, 2) doesn't raise TypeError�%z#'%' % None doesn't raise ValueErrorZ534253reZ534253xz%c�)r�r��splitr�ru�rindexrB�isdigitrxr;r;r<�test_str_operations1sD









z-ClassPropertiesAndMethods.test_str_operationscCs2Gdd�d�}|�}|�}||_||_t|�}dS)Nc@seZdZdS)z?ClassPropertiesAndMethods.test_deepcopy_recursive.<locals>.NodeNrr;r;r;r<r�asr�)rRr?r)r6r�r?rRr�r;r;r<�test_deepcopy_recursive_sz1ClassPropertiesAndMethods.test_deepcopy_recursivecCsjddlm}|�|�}t|�|�|d�|�|d�|�|d�|�|j�d|_|�|jddi�dS)Nr)r�r��__file__r�re)	rr�r�r�r�r�rFr�rB)r6rrLr;r;r<�test_uninitialized_modulesis
z4ClassPropertiesAndMethods.test_uninitialized_modulescsNG�fdd�dt�}Gdd�d|��|�|d�gd��|��d�gd���d�}|�|jd�|d�}|�|��|�|jd��d�}|�|��|�|jd�Gdd�dt�}|�|dd	�|dd	f�Gd
d�d|��|��dd	��dd	f�Gdd�dt�}|�|dd	�||dd	f�Gdd�d|��|��dd	���dd	f�dS)
NcseZdZ�fdd�ZdS)�3ClassPropertiesAndMethods.test_funny_new.<locals>.Ccs4t|t�rgd�St|t�r&t���St�|�SdS)Nrg)r�r�r)rr�rrr;r<r�xs�;ClassPropertiesAndMethods.test_funny_new.<locals>.C.__new__Nrr;rr;r<r�wsr�c@seZdZdd�ZdS)�3ClassPropertiesAndMethods.test_funny_new.<locals>.DcSs
||_dSr�r=�r6rr;r;r<r0}sz<ClassPropertiesAndMethods.test_funny_new.<locals>.D.__init__Nr�r;r;r;r<r|srr�rgrec@seZdZedd��ZdS)r�cWs|Sr�r;rzr;r;r<r��sr�N)r�r�r�rr�r;r;r;r<r��srfc@seZdZdS�r�Nrr;r;r;r<r�sc@seZdZedd��ZdS)r�cWs|Sr�r;rzr;r;r<r��sr�N)r�r�r�rLr�r;r;r;r<r��sc@seZdZdSr�rr;r;r;r<r�s)rrBr�r�)r6r�rJr;rr<�test_funny_newus(z(ClassPropertiesAndMethods.test_funny_newcCs�Gdd�dt�}|�}|}|d9}|�||df�|}|d9}|�||df�|}|d9}|�||df�|}|d9}|�||df�|}|d9}|�||df�|}|d9}|�||df�dS)Nc@seZdZdd�ZdS)z2ClassPropertiesAndMethods.test_imul_bug.<locals>.CcSs||fSr�r;r�r;r;r<ro�sz;ClassPropertiesAndMethods.test_imul_bug.<locals>.C.__imul__N)r�r�r�ror;r;r;r<r��sr�r�rfrhlr��rrB)r6r�r7rar;r;r<�
test_imul_bug�s(z'ClassPropertiesAndMethods.test_imul_bugcs�ddl}G�fdd�dt�}|d�}|�d���|jd���|��d�|�|�}��|jd���|��d�|�|�}��|jd���|��d�dS)Nrcs<eZdZddd�Zd
dd�Zdd�Zdd	�Z�fd
d�ZdS)z7ClassPropertiesAndMethods.test_copy_setstate.<locals>.CNcSs||_||_dSr�)r��_C__foorCr;r;r<r0�sz@ClassPropertiesAndMethods.test_copy_setstate.<locals>.C.__init__cSs
||_dSr�r=rCr;r;r<�setfoo�sz>ClassPropertiesAndMethods.test_copy_setstate.<locals>.C.setfoocSs|jSr�)r�rxr;r;r<�getfoo�sz>ClassPropertiesAndMethods.test_copy_setstate.<locals>.C.getfoocSs|jgSr�r=rxr;r;r<�__getstate__�szDClassPropertiesAndMethods.test_copy_setstate.<locals>.C.__getstate__cs$��t|�d�|d|_|_dSr�)rBr�r�r�)r��lstrxr;r<�__setstate__�szDClassPropertiesAndMethods.test_copy_setstate.<locals>.C.__setstate__)N)N)r�r�r�r0r�r�r�r�r;rxr;r<r��s


r�r�r�)r�rr�rBr�r�r)r6r�r�r?rRr;rxr<�test_copy_setstate�s



z,ClassPropertiesAndMethods.test_copy_setstatecCs�|�ddd�d�|�dtd�d�|�t�dtd��d�Gdd�dt�}|�|d�dd�d�|�|d�td�d�|�|d��td��d�|�ddd�d�|�dtd�d�|�t�dtd��d�Gd	d
�d
t�}|�|d�dd�d�|�|d�td�d�|�|d��td��d�|�gd�dd�ddg�|�gd�td�ddg�|�t�gd�td��ddg�Gdd
�d
t�}|�|gd��dd�ddg�|�|gd��td�ddg�|�|gd���td��ddg�|gd��}ddg|tdd�<|�|gd��ddg|tddd�<|�|gd��|�tdd�ddg�|�|gd��|�tddd�ddg�|�|gd��dS)Nr�rkZhellc@seZdZdd�ZdS)z0ClassPropertiesAndMethods.test_slices.<locals>.ScSst�||�Sr�)r�rUr6r;r;r<rU�sz<ClassPropertiesAndMethods.test_slices.<locals>.S.__getitem__Nr�r;r;r;r<r��sr�rgrfr�c@seZdZdd�ZdS)z0ClassPropertiesAndMethods.test_slices.<locals>.TcSst�||�Sr�)r�rUr6r;r;r<rU�sz<ClassPropertiesAndMethods.test_slices.<locals>.T.__getitem__Nr�r;r;r;r<r?�sr?rec@seZdZdd�ZdS)z0ClassPropertiesAndMethods.test_slices.<locals>.LcSst�||�Sr�)r2rUr6r;r;r<rU�sz<ClassPropertiesAndMethods.test_slices.<locals>.L.__getitem__Nr�r;r;r;r<rU�srUrh)rerhrfr)rhrerf)rhrfre)rfrhre)rBrXr�rUr�r2ra)r6r�r?rUr?r;r;r<�test_slices�s<   "z%ClassPropertiesAndMethods.test_slicescsDG�fdd�dt����}d|_~t��|�t�j�d��`dS)NcseZdZgZ�fdd�ZdS)z>ClassPropertiesAndMethods.test_subtype_resurrection.<locals>.Ccs�j�|�dSr�)�	containerr|rxr�r;r<r�szFClassPropertiesAndMethods.test_subtype_resurrection.<locals>.C.__del__N)r�r�r�r�r�r;r�r;r<r�sr�r�re)rr�rr�rBr�r�r�)r6rWr;r�r<�test_subtype_resurrection�sz3ClassPropertiesAndMethods.test_subtype_resurrectioncCs0Gdd�dt�}d}td�D]}||�}q~dS)Nc@seZdZdgZdd�ZdS)z9ClassPropertiesAndMethods.test_slots_trash.<locals>.trashr7cSs
||_dSr�rdr6r;r;r<r0szBClassPropertiesAndMethods.test_slots_trash.<locals>.trash.__init__N)r�r�r�r�r0r;r;r;r<�trashsr�iP�)rr�)r6r�rr�r;r;r<�test_slots_trashs

z*ClassPropertiesAndMethods.test_slots_trashcCsnGdd�dt�}Gdd�dt�}Gdd�d||�}t��rJ|�|j|j�|�|d�|�|d�d	|�_dS)
Nc@seZdZdZdS)zDClassPropertiesAndMethods.test_slots_multiple_inheritance.<locals>.Ar;Nr�r;r;r;r<r$src@seZdZdS)zDClassPropertiesAndMethods.test_slots_multiple_inheritance.<locals>.BNrr;r;r;r<r#&sr#c@seZdZdZdS)zDClassPropertiesAndMethods.test_slots_multiple_inheritance.<locals>.Cr;Nr�r;r;r;r<r�(sr�rFr�rf)rrr�rB�
__basicsize__r�r7)r6rr#r�r;r;r<�test_slots_multiple_inheritance"sz9ClassPropertiesAndMethods.test_slots_multiple_inheritancecCsZGdd�dt�}|�}|�|dd�|�|dd�|�d|d�|�d|d�dS)Nc@seZdZdd�Zdd�ZdS)z.ClassPropertiesAndMethods.test_rmul.<locals>.CcSsdS)Nrr;r�r;r;r<rq4sz6ClassPropertiesAndMethods.test_rmul.<locals>.C.__mul__cSsdS)N�rmulr;r�r;r;r<rs6sz7ClassPropertiesAndMethods.test_rmul.<locals>.C.__rmul__N)r�r�r�rqrsr;r;r;r<r�3sr�rfrg������@r�r�r�r;r;r<�	test_rmul0sz#ClassPropertiesAndMethods.test_rmulcCs"Gdd�dt�}|�}|dC}dS)Nc@seZdZdd�ZdS)z.ClassPropertiesAndMethods.test_ipow.<locals>.CcSsdSr�r;r�r;r;r<�__ipow__Bsz7ClassPropertiesAndMethods.test_ipow.<locals>.C.__ipow__N)r�r�r�r�r;r;r;r<r�Asr�rfr�r�r;r;r<�	test_ipow>sz#ClassPropertiesAndMethods.test_ipowc
s�Gdd�dt�}G�fdd�dt��Gdd�d|�}Gdd�d|�}|�}|�}|f|_�f|_|�|��d	�|�|��d	�|�|jd
�|�|jd
�|����|g�z|`Wnttfy�Yn0|�d�z
d|_Wn>t�y }z$t	|�d
k�r|�d�WYd}~nd}~00|�d�z|f|_Wnt�yLYn0|�d�z||f|_Wnt�yzYn0|�d�z|f|_Wnt�y�Yn0|�d�dS)Nc@seZdZdS)z7ClassPropertiesAndMethods.test_mutable_bases.<locals>.CNrr;r;r;r<r�Ksr�cs&eZdZ��fdd�Zdd�Z�ZS)z8ClassPropertiesAndMethods.test_mutable_bases.<locals>.C2cs |dkrdSt�|��|�SdS)Nr?rf)rrk�r6r�)rRr�r;r<rkNszIClassPropertiesAndMethods.test_mutable_bases.<locals>.C2.__getattribute__cSsdSr�r;rxr;r;r<rISsz=ClassPropertiesAndMethods.test_mutable_bases.<locals>.C2.meth)r�r�r�rkrIrr;�rRrr<rRMsrRc@seZdZdS)z7ClassPropertiesAndMethods.test_mutable_bases.<locals>.DNrr;r;r;r<rUsrc@seZdZdS)z7ClassPropertiesAndMethods.test_mutable_bases.<locals>.ENrr;r;r;r<r,Wsr,rerfz&shouldn't be able to delete .__bases__r;z/a new-style class can't have only classic basesz'wrong error message for .__bases__ = ()z)shouldn't be able to set .__bases__ to ()z.shouldn't be able to create inheritance cyclesz#didn't detect repeated base classes)
rrGrBrIr?r�r�r�r�r�)r6r�rr,rJr�r�r;r�r<�test_mutable_basesGsN

 


z,ClassPropertiesAndMethods.test_mutable_basescCs�dd�tj��D�}|D],}t�|d�|tur|�t|j�d|�qGdd�dt�}Gdd�dt�}Gd	d
�d
|�}zt	f|_Wnt
y�Yn0|�d�zt	ft_Wnt
y�Yn0|�d�z|tf|_Wnt
y�Yn0|�d
�dS)NcSsg|]}t|t�r|�qSr;)r�rD)r}�tpr;r;r<r~�s
�z@ClassPropertiesAndMethods.test_builtin_bases.<locals>.<listcomp>rGrec@seZdZdS)z7ClassPropertiesAndMethods.test_builtin_bases.<locals>.LNrr;r;r;r<rU�srUc@seZdZdS)z7ClassPropertiesAndMethods.test_builtin_bases.<locals>.CNrr;r;r;r<r��sr�c@seZdZdS)z7ClassPropertiesAndMethods.test_builtin_bases.<locals>.DNrr;r;r;r<r�srz/shouldn't turn list subclass into dict subclassz-shouldn't be able to assign to list.__bases__z#best_base calculation found wanting)�builtinsrF�valuesrrkrBr�rGr2rr�r�)r6Z
builtin_typesr�rUr�rr;r;r<�test_builtin_bases�s.

z,ClassPropertiesAndMethods.test_builtin_basescCs�|�t��$Gdd�dtd��}Wd�n1s40Y|�t��&Gdd�dttd��}Wd�n1st0Y|�t��&Gdd�dtd�t�}Wd�n1s�0YGdd�dt�}|�t��&Gdd�d|td��}Wd�n1�s0Y|�t��&Gdd�dtd�|�}Wd�n1�sH0YGd	d�dt�}|�t��td�f|_Wd�n1�s�0Y|�t��ttd�f|_Wd�n1�s�0Y|�t��td�tf|_Wd�n1�s0Y|�t��|td�f|_Wd�n1�s>0Y|�t��td�|f|_Wd�n1�sx0YdS)
Nc@seZdZdS�z>ClassPropertiesAndMethods.test_unsubclassable_types.<locals>.XNrr;r;r;r<rW�srWc@seZdZdSr�rr;r;r;r<rW�sc@seZdZdSr�rr;r;r;r<rW�sc@seZdZdS)z>ClassPropertiesAndMethods.test_unsubclassable_types.<locals>.ONrr;r;r;r<r|�sr|c@seZdZdSr�rr;r;r;r<rW�sc@seZdZdSr�rr;r;r;r<rW�sc@seZdZdSr�rr;r;r;r<rW�s)rgr�rDrrG)r6rWr|r;r;r<�test_unsubclassable_types�s,24466,...z3ClassPropertiesAndMethods.test_unsubclassable_typesc
s�G�fdd�dt��Gdd�dt�}Gdd�dt�}Gdd�dt�}Gd	d
�d
|�}Gdd�d|�}Gd
d�d|�d�}Gdd�d||d�}|j}|j}	z|f|_Wn.ty�|�|j|�|�|j|	�Yn0|�d�dS)Ncs&eZdZ��fdd�Zdd�Z�ZS)zOClassPropertiesAndMethods.test_mutable_bases_with_failing_mro.<locals>.WorkOncecsd|_t�|���|||�Sr�)�flagrr�)r6r9rrF)�WorkOncer�r;r<r��szWClassPropertiesAndMethods.test_mutable_bases_with_failing_mro.<locals>.WorkOnce.__new__cSs0|jdkrtd��n|jd7_t�|�SdS)NrZbozore)r�r�rDrSrxr;r;r<rS�s

zSClassPropertiesAndMethods.test_mutable_bases_with_failing_mro.<locals>.WorkOnce.mro)r�r�r�r�rSrr;�r�rr<r��sr�c@seZdZdd�ZdS)zQClassPropertiesAndMethods.test_mutable_bases_with_failing_mro.<locals>.WorkAlwayscSs
t�|�Sr�)rDrSrxr;r;r<rS�szUClassPropertiesAndMethods.test_mutable_bases_with_failing_mro.<locals>.WorkAlways.mroNrVr;r;r;r<�
WorkAlways�sr�c@seZdZdS)zHClassPropertiesAndMethods.test_mutable_bases_with_failing_mro.<locals>.CNrr;r;r;r<r��sr�c@seZdZdS)zIClassPropertiesAndMethods.test_mutable_bases_with_failing_mro.<locals>.C2Nrr;r;r;r<rR�srRc@seZdZdS)zHClassPropertiesAndMethods.test_mutable_bases_with_failing_mro.<locals>.DNrr;r;r;r<r�src@seZdZdS)zHClassPropertiesAndMethods.test_mutable_bases_with_failing_mro.<locals>.ENrr;r;r;r<r,�sr,c@seZdZdS)zHClassPropertiesAndMethods.test_mutable_bases_with_failing_mro.<locals>.FNrr;r;r;r<rc�srcr�c@seZdZdS)zHClassPropertiesAndMethods.test_mutable_bases_with_failing_mro.<locals>.GNrr;r;r;r<r��sr�zexception not propagated)rDrr�rGr�rBr�)
r6r�r�rRrr,rcr�ZE_mro_beforeZD_mro_beforer;r�r<�#test_mutable_bases_with_failing_mro�s z=ClassPropertiesAndMethods.test_mutable_bases_with_failing_mrocCs�Gdd�dt�}Gdd�dt�}Gdd�d||�}Gdd�d||�}Gd	d
�d
||�}z||f|_WntyvYn0|�d�dS)Nc@seZdZdS)zJClassPropertiesAndMethods.test_mutable_bases_catch_mro_conflict.<locals>.ANrr;r;r;r<rsrc@seZdZdS)zJClassPropertiesAndMethods.test_mutable_bases_catch_mro_conflict.<locals>.BNrr;r;r;r<r#sr#c@seZdZdS)zJClassPropertiesAndMethods.test_mutable_bases_catch_mro_conflict.<locals>.CNrr;r;r;r<r�sr�c@seZdZdS)zJClassPropertiesAndMethods.test_mutable_bases_catch_mro_conflict.<locals>.DNrr;r;r;r<rsrc@seZdZdS)zJClassPropertiesAndMethods.test_mutable_bases_catch_mro_conflict.<locals>.ENrr;r;r;r<r,sr,zdidn't catch MRO conflict)rrGr�r�)r6rr#r�rr,r;r;r<�%test_mutable_bases_catch_mro_conflictsz?ClassPropertiesAndMethods.test_mutable_bases_catch_mro_conflictcCsVGdd�dt�}|j}d|_|�|j|jf|df�d|_|�|j|jf|df�dS)Nc@seZdZdS)z7ClassPropertiesAndMethods.test_mutable_names.<locals>.CNrr;r;r;r<r� sr�rzD.E)rr�r�rB)r6r�r�r;r;r<�test_mutable_namessz,ClassPropertiesAndMethods.test_mutable_namescs6G�fdd�dt�}Gdd�d��|d��_d�_dS)NcseZdZ�fdd�ZdS)z<ClassPropertiesAndMethods.test_evil_type_name.<locals>.Nastycs
d�_dS)Nr�)r�rxr�r;r<r�1szDClassPropertiesAndMethods.test_evil_type_name.<locals>.Nasty.__del__Nr~r;r�r;r<�Nasty0sr�c@seZdZdS)z8ClassPropertiesAndMethods.test_evil_type_name.<locals>.CNrr;r;r;r<r�4sr�r�Znormal)r�r�)r6r�r;r�r<�test_evil_type_name,s
z-ClassPropertiesAndMethods.test_evil_type_namecCsGdd�dt�}|�|d�dd�|�d|d�d�Gdd�dt�}|�|�dd�|�d|�d	�Gd
d�d|�}|�|�|�d�|�|�|�d
�Gdd�d|�}|�|j|j�|�|�dd�|�d|�d	�|�|�|�d�|�|�|�d�dS)Nc@seZdZdd�Zdd�ZdS)z;ClassPropertiesAndMethods.test_subclass_right_op.<locals>.BcSsdS)N�B.__floordiv__r;r�r;r;r<�__floordiv__CszHClassPropertiesAndMethods.test_subclass_right_op.<locals>.B.__floordiv__cSsdS)N�B.__rfloordiv__r;r�r;r;r<�
__rfloordiv__EszIClassPropertiesAndMethods.test_subclass_right_op.<locals>.B.__rfloordiv__N�r�r�r�r�r�r;r;r;r<r#Bsr#rer�r�c@seZdZdd�Zdd�ZdS)z;ClassPropertiesAndMethods.test_subclass_right_op.<locals>.CcSsdS)N�C.__floordiv__r;r�r;r;r<r�NszHClassPropertiesAndMethods.test_subclass_right_op.<locals>.C.__floordiv__cSsdS)N�C.__rfloordiv__r;r�r;r;r<r�PszIClassPropertiesAndMethods.test_subclass_right_op.<locals>.C.__rfloordiv__Nr�r;r;r;r<r�Msr�r�r�c@seZdZdd�Zdd�ZdS)z;ClassPropertiesAndMethods.test_subclass_right_op.<locals>.DcSsdS)N�D.__floordiv__r;r�r;r;r<r�YszHClassPropertiesAndMethods.test_subclass_right_op.<locals>.D.__floordiv__cSsdS)N�D.__rfloordiv__r;r�r;r;r<r�[szIClassPropertiesAndMethods.test_subclass_right_op.<locals>.D.__rfloordiv__Nr�r;r;r;r<rXsrr�r�c@seZdZdS)z;ClassPropertiesAndMethods.test_subclass_right_op.<locals>.ENrr;r;r;r<r,csr,)r)rBrr�)r6r#r�rr,r;r;r<�test_subclass_right_op:sz0ClassPropertiesAndMethods.test_subclass_right_opz)testing an internal kind of method objectcCs,gd�}dddd�}|�t�|�|�|�i�|�|�tjd}|�|�dt�|�|�|�|�i�|�|�z|�dd�Wnty�Yn0|�d�z|�d�Wnty�Yn0|�d�z|�dd�Wnty�Yn0|�d�z|�dt�Wnt�yYn0|�d�dS)Nrg�fromkeysz0shouldn't have allowed descr.__get__(None, None)r�z(shouldn't have allowed descr.__get__(42)z.shouldn't have allowed descr.__get__(None, 42)z/shouldn't have allowed descr.__get__(None, int))rBrr�rFrr�r�r))r6rrHrjr;r;r<�test_meth_class_getms6



z-ClassPropertiesAndMethods.test_meth_class_getcCs�Gdd�dt�}Gdd�d�}|�}||�}|�||�|�||�Gdd�d|�}|�}||�}|�||�|�||�Gdd�dt�}|�}||�}|�||�|�||�Gdd�d|�}|�}||�}|�||�|�||�dS)	Nc@seZdZdd�Zdd�ZdS)z<ClassPropertiesAndMethods.test_isinst_isclass.<locals>.ProxycSs
||_dSr���_Proxy__objr6r;r;r<r0�szEClassPropertiesAndMethods.test_isinst_isclass.<locals>.Proxy.__init__cSs&|�d�rt�||�St|j|�SdS�NZ_Proxy__�r
rrkrEr�rir;r;r<rk�s
zMClassPropertiesAndMethods.test_isinst_isclass.<locals>.Proxy.__getattribute__N�r�r�r�r0rkr;r;r;r<r��sr�c@seZdZdS�z8ClassPropertiesAndMethods.test_isinst_isclass.<locals>.CNrr;r;r;r<r��sr�c@seZdZdS�z8ClassPropertiesAndMethods.test_isinst_isclass.<locals>.DNrr;r;r;r<r�src@seZdZdSr�rr;r;r;r<r��sc@seZdZdSr�rr;r;r;r<r�s)rr�)r6r�r�r?�parr;r;r<�test_isinst_isclass�s*	z-ClassPropertiesAndMethods.test_isinst_isclasscs\Gdd�dt�}Gdd�dt�}G�fdd�d|����}||�}|��jd|�d�dS)	Nc@seZdZdd�Zdd�ZdS)z9ClassPropertiesAndMethods.test_proxy_super.<locals>.ProxycSs
||_dSr�r�r6r;r;r<r0�szBClassPropertiesAndMethods.test_proxy_super.<locals>.Proxy.__init__cSs&|�d�rt�||�St|j|�SdSr�r�rir;r;r<rk�s
zJClassPropertiesAndMethods.test_proxy_super.<locals>.Proxy.__getattribute__Nr�r;r;r;r<r��sr�c@seZdZdd�ZdS)z5ClassPropertiesAndMethods.test_proxy_super.<locals>.BcSsdS)NzB.fr;rxr;r;r<r�sz7ClassPropertiesAndMethods.test_proxy_super.<locals>.B.fNrRr;r;r;r<r#�sr#cseZdZ��fdd�Z�ZS)z5ClassPropertiesAndMethods.test_proxy_super.<locals>.Ccst�|���dS)Nz->C.f)rrrx)r�r�r;r<r�sz7ClassPropertiesAndMethods.test_proxy_super.<locals>.C.f)r�r�r�rrr;r�rr<r��sr�rzB.f->C.f)rrBrF)r6r�r#r�r�r;r�r<�test_proxy_super�s	z*ClassPropertiesAndMethods.test_proxy_supercCsbzt�tdd�Wnty$Yn0|�d�zt�td�WntyRYn0|�d�dS)Nr�r�z"Carlo Verre __setattr__ succeeded!rDz"Carlo Verre __delattr__ succeeded!)rrnr�r�r�rqrxr;r;r<�test_carloverre�s
z)ClassPropertiesAndMethods.test_carloverrecCsjGdd�dt�}Gdd�d�}Gdd�d||�}|dtfi�}z
d|_Wntyd|�d	�Yn0dS)
Nc@seZdZdd�ZdS)zHClassPropertiesAndMethods.test_carloverre_multi_inherit_valid.<locals>.AcSst�|||�dSr�)rDrn�r�r�r�r;r;r<rn�szTClassPropertiesAndMethods.test_carloverre_multi_inherit_valid.<locals>.A.__setattr__N�r�r�r�rnr;r;r;r<r�src@seZdZdS)zHClassPropertiesAndMethods.test_carloverre_multi_inherit_valid.<locals>.BNrr;r;r;r<r#�sr#c@seZdZdS)zHClassPropertiesAndMethods.test_carloverre_multi_inherit_valid.<locals>.CNrr;r;r;r<r��sr�rTz1setattr through direct base types should be legal�rDrr�r�r��r6rr#r�r�r;r;r<�#test_carloverre_multi_inherit_valid�s
z=ClassPropertiesAndMethods.test_carloverre_multi_inherit_validcCsjGdd�dt�}Gdd�d�}Gdd�d||�}|dtfi�}z
d|_WntyZYn0|�d	�dS)
Nc@seZdZdd�ZdS)zJClassPropertiesAndMethods.test_carloverre_multi_inherit_invalid.<locals>.AcSst�|||�dSr�)rrnrr;r;r<rn�szVClassPropertiesAndMethods.test_carloverre_multi_inherit_invalid.<locals>.A.__setattr__Nrr;r;r;r<r�src@seZdZdS)zJClassPropertiesAndMethods.test_carloverre_multi_inherit_invalid.<locals>.BNrr;r;r;r<r#�sr#c@seZdZdS)zJClassPropertiesAndMethods.test_carloverre_multi_inherit_invalid.<locals>.CNrr;r;r;r<r��sr�rTz6setattr through indirect base types should be rejectedrrr;r;r<�%test_carloverre_multi_inherit_invalid�s
z?ClassPropertiesAndMethods.test_carloverre_multi_inherit_invalidcs@ddl�G�fdd�d�}Gdd�dt�}|�}||�|_~dS)Nrcs eZdZ�fdd�Zdd�ZdS)zAClassPropertiesAndMethods.test_weakref_segfault.<locals>.Provokercs��|�|_dSr��r�)r6Z	referrent�r�r;r<r0szJClassPropertiesAndMethods.test_weakref_segfault.<locals>.Provoker.__init__cSs|��}dSr�rr6r;r;r<r�szIClassPropertiesAndMethods.test_weakref_segfault.<locals>.Provoker.__del__N)r�r�r�r0r�r;r	r;r<�Provokersr
c@seZdZdS)z=ClassPropertiesAndMethods.test_weakref_segfault.<locals>.OopsNrr;r;r;r<�Oopssr)r�rZwhatever)r6r
rrr;r	r<�test_weakref_segfault
s
z/ClassPropertiesAndMethods.test_weakref_segfaultcCs$dd�}td�D]
}|j}qd}dS)NcSsdSr�r;r;r;r;r<r�r�zAClassPropertiesAndMethods.test_wrapper_segfault.<locals>.<lambda>i@B)r�r)r6rr�r;r;r<�test_wrapper_segfaultsz/ClassPropertiesAndMethods.test_wrapper_segfaultcCs^tj}Gdd�d�}|�t_z4ztd�Wnty<Yn0|�d�W|t_n|t_0dS)Nc@seZdZdd�ZdS)z>ClassPropertiesAndMethods.test_file_fault.<locals>.StdoutGuardcSstjt_td|��dS)Nz!Premature access to sys.stdout.%s)r��
__stdout__�stdoutr�r�r;r;r<r(szJClassPropertiesAndMethods.test_file_fault.<locals>.StdoutGuard.__getattr__N�r�r�r�rr;r;r;r<�StdoutGuard'srzOops!zDidn't raise RuntimeError)r�rr�r�r�)r6Ztest_stdoutrr;r;r<�test_file_fault$sz)ClassPropertiesAndMethods.test_file_faultcspG�fdd�dt�}Gdd�dt��G�fdd�dt����}d|j|�<|�|jd�t��|�|d	�dS)
Ncs eZdZdd�Z�fdd�ZdS)zHClassPropertiesAndMethods.test_vicious_descriptor_nonsense.<locals>.EvilcSstd�S)Nr��r�rxr;r;r<r�=szQClassPropertiesAndMethods.test_vicious_descriptor_nonsense.<locals>.Evil.__hash__cs z�`WntyYn0dSr�)r�r�r�r�r;r<r�?s
zOClassPropertiesAndMethods.test_vicious_descriptor_nonsense.<locals>.Evil.__eq__N�r�r�r�r�r�r;r�r;r<�Evil<src@seZdZddd�ZdS)zIClassPropertiesAndMethods.test_vicious_descriptor_nonsense.<locals>.DescrNcSsdSr�r;)r6�obrDr;r;r<rHszQClassPropertiesAndMethods.test_vicious_descriptor_nonsense.<locals>.Descr.__get__)Nr�r;r;r;r<�DescrGsrcseZdZ��ZdS)zEClassPropertiesAndMethods.test_vicious_descriptor_nonsense.<locals>.CN)r�r�r�r�r;�rr;r<r�Ksr�rrer�)rrFrBr�rr�r�)r6rrWr;)r�rr<� test_vicious_descriptor_nonsense5sz:ClassPropertiesAndMethods.test_vicious_descriptor_nonsensecCs<Gdd�dt�}z
|�Wnty,Yn0|�d�dS)Nc@seZdZdd�ZdS)z0ClassPropertiesAndMethods.test_init.<locals>.FoocSsdS)Nr�r;rxr;r;r<r0Ysz9ClassPropertiesAndMethods.test_init.<locals>.Foo.__init__Nr�r;r;r;r<�FooXsrz'did not test __init__() for None return)rr�r�)r6rr;r;r<�	test_initVs
z#ClassPropertiesAndMethods.test_initcCs�|�t��||kWd�n1s(0Y|�t��||kWd�n1sZ0Y|�t��||kWd�n1s�0Y|�t��||kWd�n1s�0YdSr��rgr��r6r?rRr;r;r<�assertNotOrderablebs&&&z,ClassPropertiesAndMethods.assertNotOrderablecCs�g}|�|j|jk�|�|j|jk�|�|jgjk�|�|jgjk�|�|j|jk�|�|j|jk�|�|j|j�|�|jjd�|�|jj|�|�|jj	t
�|�|jjt
jj�t|j�dS)NrP)
r�rPr�rqrrBr�r�r�__objclass__r2r�r��r6r�r;r;r<�test_method_wrapperlsz-ClassPropertiesAndMethods.test_method_wrappercCs�g}|�|j|jk�|�|j|jk�|�|jgjk�|�|jgjk�|�|j|jk�|�|j|jk�|�|j|j�|�|jjd�|�|jj|�|�|jj	t
jj	�t|j�dS)Nr|)r�r|r��poprrBr�r�rr�r2r�r r;r;r<�test_builtin_function_or_method~sz9ClassPropertiesAndMethods.test_builtin_function_or_methodcCs�|�tjtjk�|�tjtjk�|�tjtjk�|�tjtjk�|�tjtj�|�tjjd�|�tjj	t�|�tj
tj
k�|�tj
tj
k�|�tj
tjk�|�tj
tjk�|�tj
tj
�|�tj
jd�|�tj
j	t�dS)NrPr|)r�r2rPr�rqrrBr�r�rr|r"rxr;r;r<�!test_special_unbound_method_types�sz;ClassPropertiesAndMethods.test_special_unbound_method_typescs�ddl�dd�}��fdd�}tjd}tj}dD]�\}}}d|d	d�}td
d||i�}	|	�}
|||
|
�|||
|�|||
|�|r2|||
|
�|||
|�|||
|�d|d	d�}td
d||i�}|�}
|||
|
�|||
|�|||
|�q2dS)NrcSstSr�r�r�r;r;r<�
specialmethod�szEClassPropertiesAndMethods.test_not_implemented.<locals>.specialmethodcs>zt|||�d��Wnty(Yn0��d|f�dS)N)r7ra�operatorzno TypeError from %r)r]r�r�)r:r7ra�r&r6r;r<rk�s
z=ClassPropertiesAndMethods.test_not_implemented.<locals>.checkre))rPzx + yzx += y)�__sub__zx - yzx -= y)rqzx * yzx *= y)�
__matmul__zx @ yzx @= y)�__truediv__zx / yzx /= y)r�zx // yzx //= y)�__mod__zx % yzx %= y)�
__divmod__zdivmod(x, y)N)r�zx ** yzx **= y)�
__lshift__zx << yzx <<= y)�
__rshift__zx >> yzx >>= y)�__and__zx & yzx &= y)�__or__zx | yzx |= y)�__xor__zx ^ yzx ^= yZ__rrfrr;Z__ir�)r&r�r�rD)r6r%rkZN1ZN2r9r:ZiexprZrnamerr?Zinamer�rWr;r'r<�test_not_implemented�s,
z.ClassPropertiesAndMethods.test_not_implementedcCs4Gdd�dt�}|�}d|dd�<|�|jd�dS)Nc@seZdZdd�ZdS)z6ClassPropertiesAndMethods.test_assign_slice.<locals>.CcSs
||_dSr��r�)r6�idxr�r;r;r<ra�szBClassPropertiesAndMethods.test_assign_slice.<locals>.C.__setitem__N)r�r�r�rar;r;r;r<r��sr�rhrerf)rrBr�)r6r�rWr;r;r<�test_assign_slice�sz+ClassPropertiesAndMethods.test_assign_slicecs�Gdd�dt�}|d��G�fdd�dt�}|�}|�|j��d|_|�|jd�Gdd�dt�}Gd	d�d|d
�}d|_|d�|_|�|jd�dS)Nc@seZdZdd�Zdd�ZdS)z<ClassPropertiesAndMethods.test_set_and_no_get.<locals>.DescrcSs
||_dSr��r9rir;r;r<r0�szEClassPropertiesAndMethods.test_set_and_no_get.<locals>.Descr.__init__cSs||j|j<dSr�)rFr9r5r;r;r<r��szDClassPropertiesAndMethods.test_set_and_no_get.<locals>.Descr.__set__N)r�r�r�r0r�r;r;r;r<r�srr?cseZdZ�ZdS�z8ClassPropertiesAndMethods.test_set_and_no_get.<locals>.XNr�r;�rjr;r<rW�srWr�c@seZdZdS)z;ClassPropertiesAndMethods.test_set_and_no_get.<locals>.MetaNrr;r;r;r<r��sr�c@seZdZdSr7rr;r;r;r<rW�sr�)rr�r?rBrD)r6rrWr7r�r;r8r<�test_set_and_no_get�s
z-ClassPropertiesAndMethods.test_set_and_no_getcs�Gdd�dt�}|��G�fdd�dt�}G�fdd�dt�}G�fdd�dt�}|�tt|�d	�|��jd
�|�tt|�d	�|��jd�|�tt|�d	�|��jd�G�fd
d�dt��|�tt��d	�dS)Nc@seZdZdZddd�ZdS)z@ClassPropertiesAndMethods.test_getattr_hooks.<locals>.DescriptorrNcs�fdd�}|S)Ncs�jd7_t|��dSr�)r<r�r6rxr;r<r�szXClassPropertiesAndMethods.test_getattr_hooks.<locals>.Descriptor.__get__.<locals>.getterr;)r6r�Zobjtyper�r;rxr<rszHClassPropertiesAndMethods.test_getattr_hooks.<locals>.Descriptor.__get__)N)r�r�r�r<rr;r;r;r<�
Descriptorsr:cseZdZ�ZdS)z7ClassPropertiesAndMethods.test_getattr_hooks.<locals>.AN)r�r�r�rkr;r8r;r<rsrcseZdZ�ZdS)z7ClassPropertiesAndMethods.test_getattr_hooks.<locals>.BNrr;r8r;r<r#sr#cseZdZ�Z�ZdS)z7ClassPropertiesAndMethods.test_getattr_hooks.<locals>.CN)r�r�r�rkrr;r8r;r<r�sr�r�rerfrkcs eZdZdd�Z�fdd�ZdS)zFClassPropertiesAndMethods.test_getattr_hooks.<locals>.EvilGetattributecSst|��dSr�rrir;r;r<rszRClassPropertiesAndMethods.test_getattr_hooks.<locals>.EvilGetattribute.__getattr__cs&�`td�D]}t��qt|��dS�Nru)rr�r�Zcollectr�)r6r9r���EvilGetattributer;r<rk!s
zWClassPropertiesAndMethods.test_getattr_hooks.<locals>.EvilGetattribute.__getattribute__Nr�r;r<r;r<r=sr=)rrgr�rErBr<)r6r:rr#r�r;)r=rjr<�test_getattr_hookss
z,ClassPropertiesAndMethods.test_getattr_hookscCs|�ttjtt�dSr�)rgr�rDrkr2rxr;r;r<�test_type___getattribute__)sz4ClassPropertiesAndMethods.test_type___getattribute__cCsr|�tttd�Gdd�dt�}|�tt|d�Gdd�dt�}|�t��|`Wd�n1sd0YdS)N�__abstractmethods__c@seZdZdS)z<ClassPropertiesAndMethods.test_abstractmethods.<locals>.metaNrr;r;r;r<�meta/srAc@seZdZdS)z9ClassPropertiesAndMethods.test_abstractmethods.<locals>.XNrr;r;r;r<rW2srW)rgr�rErDrr@)r6rArWr;r;r<�test_abstractmethods,sz.ClassPropertiesAndMethods.test_abstractmethodscCs�Gdd�d�}|�}|�|t�|�t��t�|�Wd�n1sJ0Y|�t��t�|d�Wd�n1s�0YdS)Nc@seZdZeZdS)z:ClassPropertiesAndMethods.test_proxy_call.<locals>.FakeStrN)r�r�r�r�r�r;r;r;r<�FakeStr8srCr�)r�r�rgr�r�rP)r6rCZfake_strr;r;r<�test_proxy_call7s(z)ClassPropertiesAndMethods.test_proxy_callcCs<Gdd�d�}|j|_|�}|�tt|�|�tt|�dS)Nc@seZdZdS)z7ClassPropertiesAndMethods.test_repr_as_str.<locals>.FooNrr;r;r;r<rJsr)r�r�rgr�r�r�)r6rr�r;r;r<�test_repr_as_strGs
z*ClassPropertiesAndMethods.test_repr_as_strcCs>Gdd�dt�}|�}d|_|�|dd�|�||�dS)Nc@seZdZejZejZdS)z>ClassPropertiesAndMethods.test_mixing_slot_wrappers.<locals>.XN)r�r�r�rrarnr��__neg__r;r;r;r<rWRsrWr�ra)rrarB)r6rWr7r;r;r<�test_mixing_slot_wrappersQs
z3ClassPropertiesAndMethods.test_mixing_slot_wrapperscCs~Gdd�dt�}|�}|�t��||kWd�n1s>0Y|�t��||Wd�n1sp0YdS)Nc@seZdZejZejZdS)zBClassPropertiesAndMethods.test_wrong_class_slot_wrapper.<locals>.AN)r�r�r�r�r�rPr;r;r;r<r]sr)r)rgr�)r6rr?r;r;r<�test_wrong_class_slot_wrapperZs&z7ClassPropertiesAndMethods.test_wrong_class_slot_wrappercCsR|�t��}Gdd�d�}Wd�n1s.0Yt|j�}|�d|�dS)Nc@seZdZdgZdZdS)zEClassPropertiesAndMethods.test_slot_shadows_class_variable.<locals>.Xr�N)r�r�r�r�r�r;r;r;r<rWhsrWz0'foo' in __slots__ conflicts with class variable)rgr�r�r$rB)r6rrWrLr;r;r<� test_slot_shadows_class_variablefs,
z:ClassPropertiesAndMethods.test_slot_shadows_class_variablecCs�Gdd�d�}d|_|�|jd�|�t��&}tt�jd�td�Wd�n1sX0Y|�dt	|j
��|�t��$}t|�jd�|�Wd�n1s�0Y|�dt	|j
��|�|jd�dS)Nc@seZdZdS)z1ClassPropertiesAndMethods.test_set_doc.<locals>.XNrr;r;r;r<rWosrWZbananar�Zblahzcan't set list.__doc__zcan't delete X.__doc__)r�rBrgr�rDr2rFr�rer�r$r7)r6rWrr;r;r<�test_set_docns42z&ClassPropertiesAndMethods.test_set_doccCs4tjtjtjtjg}gd�}t||�D]\}}|�t	|�j
|d�q&|D]$}|jjd|j
}|�|j|�qJ|�tjjd�|�tjjd�|�tjjd�|�tjjd�Gdd	�d	�}|�
t��|`Wd�n1s�0Y|�
tt	jd
jtd�Gdd
�d
�a|�tjd
�|�tjjd�dS)N)r�memberZgetset�wrapperZ_descriptor�.z	str.lowerzcomplex.realz
float.realzint.__add__c@seZdZdS)z2ClassPropertiesAndMethods.test_qualname.<locals>.XNrr;r;r;r<rW�srWr�ZOinkc@seZdZGdd�d�ZdS)rXc@seZdZdS)�Y.InsideNrr;r;r;r<�Inside�srON)r�r�r�rOr;r;r;r<rX�srXrN)r�rDr�r�r*r)rPr�rBrDr�rr�rgr�rFr�rXrO)r6ZdescriptorsrrJ�n�qualnamerWr;r;r<�
test_qualname{s("�z'ClassPropertiesAndMethods.test_qualnamecCs^ddi}tdd|�}|�|jd�|�d|j�|�|ddi�ddi}|�ttdd|�dS)Nr�z	some.namerr;re)rDrBr�r�rFrgr�)r6rFr�r;r;r<�test_qualname_dict�sz,ClassPropertiesAndMethods.test_qualname_dictcCs^Gdd�dt�}|�}d|_t�|�}~t��|�|��t��D]}|�	t
|�|�qDdS)Nc@seZdZdd�ZdS)z<ClassPropertiesAndMethods.test_cycle_through_dict.<locals>.XcSst�|�||_dSr�)rr0rFrxr;r;r<r0�s
zEClassPropertiesAndMethods.test_cycle_through_dict.<locals>.X.__init__Nr�r;r;r;r<rW�srWr�)rr�r�r�rr��assertIsNoner�r��assertIsNotrD)r6rWr7�wrrr;r;r<�test_cycle_through_dict�s
z1ClassPropertiesAndMethods.test_cycle_through_dictcCs�Gdd�d�}|�t|d�|jt|dd�Gdd�d�}Gdd�d�}Gd	d
�d
||�}|||fD]>}|d�|ddd�|�t|ddd�|jt|dddd
�qddS)Nc@seZdZdS)z[ClassPropertiesAndMethods.test_object_new_and_init_with_parameters.<locals>.OverrideNeitherNrr;r;r;r<�OverrideNeither�srXrerc@seZdZddd�ZdS)zWClassPropertiesAndMethods.test_object_new_and_init_with_parameters.<locals>.OverrideNewrc_stj|g|�Ri|��Sr�rE)r�r�r�r7r�r;r;r<r��sz_ClassPropertiesAndMethods.test_object_new_and_init_with_parameters.<locals>.OverrideNew.__new__N)rrr;r;r;r<�OverrideNew�srYc@seZdZddd�ZdS)zXClassPropertiesAndMethods.test_object_new_and_init_with_parameters.<locals>.OverrideInitrc_stj|g|�Ri|��Sr�)rr0)r6r�r�r7r8r;r;r<r0�szaClassPropertiesAndMethods.test_object_new_and_init_with_parameters.<locals>.OverrideInit.__init__N)rr�r;r;r;r<�OverrideInit�srZc@seZdZdS)zXClassPropertiesAndMethods.test_object_new_and_init_with_parameters.<locals>.OverrideBothNrr;r;r;r<�OverrideBoth�sr[rfrhr=r)r6rXrYrZr[Zcaser;r;r<�(test_object_new_and_init_with_parameters�szBClassPropertiesAndMethods.test_object_new_and_init_with_parameterscCs>Gdd�d�}Gdd�d|�}|�d|j�|�d|j�dS)Nc@seZdZdS)z\ClassPropertiesAndMethods.test_subclassing_does_not_duplicate_dict_descriptors.<locals>.BaseNrr;r;r;r<r�src@seZdZdS)z[ClassPropertiesAndMethods.test_subclassing_does_not_duplicate_dict_descriptors.<locals>.SubNrr;r;r;r<r�srrF)rerFr�)r6rrr;r;r<�4test_subclassing_does_not_duplicate_dict_descriptors�szNClassPropertiesAndMethods.test_subclassing_does_not_duplicate_dict_descriptorscsRGdd�d�}|�t|�j�d�Gdd�d�}Gdd�d|�}Gdd	�d	|�}|�}|�}|�}t||�}|�t|j�d
�|�t|j�d�|�t|j�d�|�t|j�d
�Gdd�d�}|�}	|�t|	j�d�|�t|j�d�Gdd�d�}
|
�}t�}t�||�}
|�t|
�d�d|_|�t|
�d�d|_|�t|
�d�dS)Nc@seZdZdd�ZdS)�=ClassPropertiesAndMethods.test_bound_method_repr.<locals>.FoocSsdSr�r;rxr;r;r<r�s�DClassPropertiesAndMethods.test_bound_method_repr.<locals>.Foo.methodN�r�r�r�rr;r;r;r<r�srz4<bound method .*Foo\.method of <.*Foo object at .*>>c@seZdZdd�ZdS)z>ClassPropertiesAndMethods.test_bound_method_repr.<locals>.BasecSsdSr�r;rxr;r;r<r�szEClassPropertiesAndMethods.test_bound_method_repr.<locals>.Base.methodNr`r;r;r;r<r�src@seZdZdS)zBClassPropertiesAndMethods.test_bound_method_repr.<locals>.Derived1Nrr;r;r;r<�Derived1�srac@seZdZdd�ZdS)zBClassPropertiesAndMethods.test_bound_method_repr.<locals>.Derived2cSsdSr�r;rxr;r;r<r�szIClassPropertiesAndMethods.test_bound_method_repr.<locals>.Derived2.methodNr`r;r;r;r<�Derived2�srbz6<bound method .*Base\.method of <.*Base object at .*>>z:<bound method .*Base\.method of <.*Derived1 object at .*>>z><bound method .*Derived2\.method of <.*Derived2 object at .*>>z:<bound method .*Base\.method of <.*Derived2 object at .*>>c@seZdZedd��ZdS)r^cSsdSr�r;r�r;r;r<r�sr_N)r�r�r�rLrr;r;r;r<r�sz/<bound method .*Foo\.method of <class '.*Foo'>>c@seZdZdd�ZdS)zDClassPropertiesAndMethods.test_bound_method_repr.<locals>.MyCallablecSsdSr�r;r�r;r;r<r�szMClassPropertiesAndMethods.test_bound_method_repr.<locals>.MyCallable.__call__N)r�r�r�rr;r;r;r<�
MyCallable�srcz*<bound method \? of <object object at .*>>r9z,<bound method name of <object object at .*>>rQz0<bound method qualname of <object object at .*>>)	ZassertRegexr�rrrr�
MethodTyper�r�)r6rrrarbrHZderived1Zderived2Zsuper_d2r�rcrU�instancerrr;r<�test_bound_method_repr�s\�
������
�
�
�z0ClassPropertiesAndMethods.test_bound_method_reprNzneed the _testcapi modulecs*Gdd�d��G�fdd�d�}|jdS)Nc@seZdZejZdS)z6ClassPropertiesAndMethods.test_bpo25750.<locals>.DescrN)r�r�r�r�Zbad_getrr;r;r;r<rsrcseZdZ��Zdd�ZdS)z2ClassPropertiesAndMethods.test_bpo25750.<locals>.XcSsd|_dd�td�D�|_dS)NcSsg|]}d|�qSr�r;r|r;r;r<r~r�zNClassPropertiesAndMethods.test_bpo25750.<locals>.X.__new__.<locals>.<listcomp>i')rjr�r�r�r;r;r<r�sz:ClassPropertiesAndMethods.test_bpo25750.<locals>.X.__new__N)r�r�r�rjr�r;rr;r<rWsrWr8r�r;rr<�
test_bpo25750sz'ClassPropertiesAndMethods.test_bpo25750)�r�r�r�r�r�r�r�rhr�r�r�r�r�r�r�r�r�r�r�r�r�r	rrrZ
refcount_testr r�r(r+r,r-r0r<r?r.ZexpectedFailurerArIrQr[rcrgrhr�r�r�r��skipIfr��flags�optimizer��cpython_onlyr�r�r�rrrIrPrVrcrhrnrtr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrr
rrrrr!r#r$r2r5r9r>r?rBrDrErGrHrIrJrRrSrWr\r]rfr�rgrr;r;rr<r��s4X*)%
%=K&(F<2

1

"
"
G1
ib?�



CS\pN @OYYM	
.
',	A( 63
+'!
4
'
	
 
7r�c@s�eZdZdd�Ze�eed�o$e��d�dd��Z	e�eed�oFe��d�dd��Z
e�eed�ohe��d�d	d
��Zdd�Zd
d�Z
dS)�DictProxyTestscCsGdd�dt�}||_dS)Nc@seZdZdd�ZdS)zDictProxyTests.setUp.<locals>.CcSsdSr�r;rxr;r;r<rIsz$DictProxyTests.setUp.<locals>.C.methNr r;r;r;r<r�sr�)rr�r�r;r;r<�setUpszDictProxyTests.setUp�gettracez#trace function introduces __local__cCs<|jj��}|�|t�t|�}|��|�|gd��dS)N�rFr�r�r�rI)r�rFr{�assertNotIsInstancer2�sortrB�r6rr{r;r;r<�test_iter_keyss
zDictProxyTests.test_iter_keyscCs4|jj��}|�|t�t|�}|�t|�d�dSr;)r�rFr�rpr2rBr�)r6rr�r;r;r<�test_iter_values*szDictProxyTests.test_iter_valuescCsB|jj��}|�|t�dd�|D�}|��|�|gd��dS)NcSsg|]}|d�qSr�r;)r}�itemr;r;r<r~9r�z2DictProxyTests.test_iter_items.<locals>.<listcomp>ro)r�rFr3rpr2rqrBrrr;r;r<�test_iter_items3s
zDictProxyTests.test_iter_itemscCsNGdd�dt�}Gdd�dt�}Gdd�d|d�}|�t|j�t|j��dS)Nc@seZdZdS)z7DictProxyTests.test_dict_type_with_metaclass.<locals>.BNrr;r;r;r<r#@sr#c@seZdZdS)z7DictProxyTests.test_dict_type_with_metaclass.<locals>.MNrr;r;r;r<rBsrc@seZdZdS)z7DictProxyTests.test_dict_type_with_metaclass.<locals>.CNrr;r;r;r<r�Dsr�r�)rrDrBrF)r6r#rr�r;r;r<�test_dict_type_with_metaclass>sz,DictProxyTests.test_dict_type_with_metaclasscCs^t|jj�}|�|�d�|�|�|�d�|�|jj��D]\}}|�d�||�|�q<dS)Nz
mappingproxy(�)z
{!r}: {!r})	r�r�rFr�r
�endswithr3rer�)r6r�r�r�r;r;r<�	test_reprIs
zDictProxyTests.test_reprN)r�r�r�rmr.rhr�r�rnrsrtrvrwrzr;r;r;r<rls�
	�
�
	rlc@seZdZdd�ZdS)�AAAPTypesLongInitTestcCs>Gdd�dt�}ztd|�d�WnYn0t�t�dS)Nc@seZdZdd�ZdS)z>AAAPTypesLongInitTest.test_pytype_long_ready.<locals>.UserLongcWsdSr�r;r=r;r;r<r�aszFAAAPTypesLongInitTest.test_pytype_long_ready.<locals>.UserLong.__pow__N)r�r�r�r�r;r;r;r<�UserLong`sr|r)rrrDrSr�)r6r|r;r;r<�test_pytype_long_readyYsz,AAAPTypesLongInitTest.test_pytype_long_readyN)r�r�r�r}r;r;r;r<r{Tsr{c@seZdZdd�ZdS)�	MiscTestscsjG��fdd�dt�}Gdd�dt�}Gdd�dt��td|f|�di��|��jd	�|��jd
�dS)Ncs"eZdZdd�Z��fdd�ZdS)z7MiscTests.test_type_lookup_mro_reference.<locals>.MyKeycSstd�S)N�mykeyrrxr;r;r<r�ssz@MiscTests.test_type_lookup_mro_reference.<locals>.MyKey.__hash__cs�f�_dSr�r�r���Base2rWr;r<r�vsz>MiscTests.test_type_lookup_mro_reference.<locals>.MyKey.__eq__Nrr;r�r;r<�MyKeyrsr�c@seZdZdZdZdS)z6MiscTests.test_type_lookup_mro_reference.<locals>.Base�	from BaseN�r�r�r�r�mykey2r;r;r;r<rysrc@seZdZdZdZdS)z7MiscTests.test_type_lookup_mro_reference.<locals>.Base2�
from Base2Nr�r;r;r;r<r�}sr�rWrur�r�)rrDrBrr�)r6r�rr;r�r<�test_type_lookup_mro_referencensz(MiscTests.test_type_lookup_mro_referenceN)r�r�r�r�r;r;r;r<r~msr~c@sfeZdZdidddfdd�Zdd�Zdd�Zdd	d
�Zedd��Zd
d�Z	dd�Z
dd�Zdd�ZdS)�
PicklingTestsr;Nc
CsB|dkr�|�|�}|rD|�|dtj�|�|dt|�||f�n,|�|dtj�|�|dt|�f|�|�|d|�|dur�|�t|d�|�n|�|d�|dur�|�	t
|d�|�n|�|d�ndt|�j}	tjt|�|	|	t
ur�dn|	|�ff}|du�r||f7}|�|�|�|�|�|��|�dS)Nrfrrerhrk)�
__reduce_ex__rB�copyreg�
__newobj_ex__rD�
__newobj__�assertListEqualr2rT�assertDictEqualr�__base__�_reconstructorr�
__reduce__)
r6�protor�r7r8r��	listitems�	dictitemsZreduce_valueZ	base_typer;r;r<�
_check_reduce�s2

��

zPicklingTests._check_reducec
s�ttjd�}d�ddd��ddi�G�fdd	�d	�}|�}|D]}|�||��q@���D]\}}t|||�q\|D]}|j||��d
�qvGdd�d�}|�}|D]@}|d
kr�|�t��|�|�Wd�q�1s�0Yq�G��fdd�d�}|�}|D] }|d
k�r|�||����qG�fdd�d�}	G�fdd�d�}
Gdd�d�}Gdd�d�}|D]d}|	|
||fD]P}
|
�}|d
k�r||�tt	f��|�|�Wd�n1�s�0Y�q|�qlG�fdd�d�}|�}|D]}|�||���q�Gdd�d�}|�}|D]F}|d
k�r|�t
��|�|�Wd�n1�sV0Y�qG�fdd�d�}|�}|D]}|j||�d
��q�Gdd�d�}|�}|D]}|j||d d
��q�Gd!d"�d"�}|�}|D]z}|�t
��|�|�Wd�n1�s0Y|d
k�r�|�t
��|��Wd�n1�sN0Y�q�G�fd#d$�d$�}|�}|D]�}|d
k�r�|j||d�fd
�nj|�t��|�|�Wd�n1�s�0Y|�t��|��Wd�n1�s�0Y�qxGd%d&�d&t�}|d'd(i�}|D]}|j||t|�d)��q*Gd*d+�d+t
�}|d,g�}|D]}|j||t
|�d-��qddS).Nre)i����r�i7���i���)ZbaconZfish�cheeseio���cseZdZ�fdd�ZdS)z%PicklingTests.test_reduce.<locals>.C1cs�Sr�r;rxrzr;r<�__getnewargs__�sz4PicklingTests.test_reduce.<locals>.C1.__getnewargs__N�r�r�r�r�r;rzr;r<r��sr�r�c@seZdZdd�ZdS)z%PicklingTests.test_reduce.<locals>.C2cSsdS�Nzbad argsr;rxr;r;r<r��sz4PicklingTests.test_reduce.<locals>.C2.__getnewargs__Nr�r;r;r;r<rR�srRrfcseZdZ��fdd�ZdS)z%PicklingTests.test_reduce.<locals>.C3cs��fSr�r;rxr@r;r<�__getnewargs_ex__�sz7PicklingTests.test_reduce.<locals>.C3.__getnewargs_ex__N�r�r�r�r�r;r@r;r<r��sr�cseZdZ�fdd�ZdS)z%PicklingTests.test_reduce.<locals>.C4cs�dfS)Nzbad dictr;rxrzr;r<r��sz7PicklingTests.test_reduce.<locals>.C4.__getnewargs_ex__Nr�r;rzr;r<r��sr�cseZdZ�fdd�ZdS)z%PicklingTests.test_reduce.<locals>.C5csd�fS)Nz	bad tupler;rx�r8r;r<r��sz7PicklingTests.test_reduce.<locals>.C5.__getnewargs_ex__Nr�r;r�r;r<�C5�sr�c@seZdZdd�ZdS)z%PicklingTests.test_reduce.<locals>.C6cSsdS)Nr;r;rxr;r;r<r��sz7PicklingTests.test_reduce.<locals>.C6.__getnewargs_ex__Nr�r;r;r;r<�C6�sr�c@seZdZdd�ZdS)z%PicklingTests.test_reduce.<locals>.C7cSsdSr�r;rxr;r;r<r��sz7PicklingTests.test_reduce.<locals>.C7.__getnewargs_ex__Nr�r;r;r;r<�C7�sr�cseZdZ�fdd�ZdS)z%PicklingTests.test_reduce.<locals>.C9cs�ifSr�r;rxrzr;r<r��sz7PicklingTests.test_reduce.<locals>.C9.__getnewargs_ex__Nr�r;rzr;r<�C9�sr�c@seZdZdd�ZdS)z&PicklingTests.test_reduce.<locals>.C10cSst�dSr�r�rxr;r;r<r��sz8PicklingTests.test_reduce.<locals>.C10.__getnewargs_ex__Nr�r;r;r;r<�C10�sr�cseZdZ�fdd�ZdS)z&PicklingTests.test_reduce.<locals>.C11cs�Sr�r;rxr�r;r<r��sz3PicklingTests.test_reduce.<locals>.C11.__getstate__N�r�r�r�r�r;r�r;r<�C11�sr�c@seZdZdd�ZdS)z&PicklingTests.test_reduce.<locals>.C12cSsdS)N�not dictr;rxr;r;r<r��sz3PicklingTests.test_reduce.<locals>.C12.__getstate__Nr�r;r;r;r<�C12�sr�r�c@seZdZdd�ZdS)z&PicklingTests.test_reduce.<locals>.C13cSst�dSr�r�rxr;r;r<r��sz3PicklingTests.test_reduce.<locals>.C13.__getstate__Nr�r;r;r;r<�C13�sr�cs eZdZe��Z�fdd�ZdS)z&PicklingTests.test_reduce.<locals>.C14cs"���D]\}}t|||�qdSr��r3rror�r;r<r0	sz/PicklingTests.test_reduce.<locals>.C14.__init__N)r�r�r�r�r�r0r;r�r;r<�C14sr�c@seZdZdS)z&PicklingTests.test_reduce.<locals>.C15Nrr;r;r;r<�C15sr�Zquebeci����)r�c@seZdZdS)z&PicklingTests.test_reduce.<locals>.C16Nrr;r;r;r<�C16sr�Zyukon)r�)r��pickle�HIGHEST_PROTOCOLr�r3rrgr�r�r�r�r�rr2)r6�	protocolsr�r�r�r9r�rRr�r�r�r�r�r�r�r�r�r�r�r�r�r�r;)r7r8r�r<�test_reduce�s�
*

2
.*
,
*,
zPicklingTests.test_reducecCsLttjd�}Gdd�d�}|D]&}|dkr0ind}|j||�|d�q dS)Nrec@seZdZdd�Zdd�ZdS)z7PicklingTests.test_special_method_lookup.<locals>.PickycSsiSr�r;rxr;r;r<r�&szDPicklingTests.test_special_method_lookup.<locals>.Picky.__getstate__cSs|dvrt|��dS)N)r�r�rJr�r;r;r<r)szCPicklingTests.test_special_method_lookup.<locals>.Picky.__getattr__N)r�r�r�r�rr;r;r;r<�Picky%sr�rfr�)r�r�r�r�)r6r�r��protocolr�r;r;r<r�#s
z(PicklingTests.test_special_method_lookupcCs|durd�||�}t|�jtjur,td��|j|||d�|jt|�t|�|d�t|d�r�|j|j	|j	|d�|j|j	|j	|d�t|d�r�|j
|j|j|d�|jD]@}|jt||�t||�|d�|jt
||d�t
||d�|d�q�|jt|�t|�|d�dS)Nz{!r} is not a copy of {!r}zCobject passed to _assert_is_copy must override the __repr__ method.)r�rFr�)r�rDr�rr�rUr�r�r�rFr�r�rBrEr�)r6r��objcopyr��slotr;r;r<�_assert_is_copy1s&


��zPicklingTests._assert_is_copycsDGdd�d���fdd�t�ttjd�tjtjhtjtjh�D�S)Nc@s$eZdZdd�Zdd�Zdd�ZdS)z<PicklingTests._generate_pickle_copiers.<locals>.PickleCopiercSs||_||_||_dSr�)r��dumps�loads)r6r�r�r�r;r;r<r0QszEPicklingTests._generate_pickle_copiers.<locals>.PickleCopier.__init__cSs|�|�||j��Sr�)r�r�r�r6r;r;r<r�UszAPicklingTests._generate_pickle_copiers.<locals>.PickleCopier.copycSs$d�|j|jj|jj|jj|jj�S)Nz0PickleCopier(proto={}, dumps={}.{}, loads={}.{}))r�r�r�r�r�r�rxr;r;r<r�Ws
�zEPicklingTests._generate_pickle_copiers.<locals>.PickleCopier.__repr__N)r�r�r�r0r�r�r;r;r;r<�PickleCopierOsr�c3s|]}�|�VqdSr�r;)r}r7�r�r;r<�	<genexpr>_r�z9PicklingTests._generate_pickle_copiers.<locals>.<genexpr>re)	�	itertools�productr�r�r�r��_dumpsr��_loadsr;r;r�r<�_generate_pickle_copiersKs


��z&PicklingTests._generate_pickle_copiersc	Cs�Gdd�d�a|�t��t�t�d�Wd�n1s<0YGdd�dt�a|�t��t�t�d�Wd�n1s�0YGdd�d�aGdd�dt�aGdd	�d	t�a|��D]�}|j|d
���t�}|�	|�}|�
||�d|_|�	|�}|�
||�t�}d|_d|_|�	|�}|�
||�t�}d|_d
|_|�	|�}|�
||�Wd�q�1�st0Yq�dS)Nc@seZdZdgZdS)r�r?Nr�r;r;r;r<r�jsr�rc@seZdZdS�rNrr;r;r;r<rpsrc@s*eZdZdgZdd�Zdd�Zdd�ZdS)	r�r?c
Ss^t|di���}t|�jD]>}|j�dd�D]*}zt||�||<Wq,tyTYq,0q,q|S)NrFr�r;)rEr�rDr�rFr�r�)r6r�r�r�r;r;r<r�xs
zC.__getstate__cSs"|��D]\}}t|||�qdSr�r�)r6r�r�r�r;r;r<r��szC.__setstate__cSsdt|�j|��fS)Nz%s()<%r>)rDr�r�rxr;r;r<r��sz
C.__repr__N)r�r�r�r�r�r�r�r;r;r;r<r�us	c@seZdZdSr�rr;r;r;r<r�sc@seZdZdgZdS)r,rRNr�r;r;r;r<r,�sr,)�
pickle_copierr�r�r�)
r�rgr�r�r�rr,r��subTestr�r�r?rR)r6r�r7rar;r;r<�test_pickle_slotsds6,,



zPicklingTests.test_pickle_slotsc
	Cs�Gdd�d�aGdd�dt�aGdd�dt�aGdd�dt�aGd	d
�d
t�atttttf}|��}t�	||�D]�\}}|j
||d��vt|di�}||ji|��}|j
}|�|�}|�||�|d
kr�|js�|j��|�|�}	|�||	�Wd�qp1�s0Yqp|D]�}|j
|d��ft|di�}||ji|��}t|�}|�||�|j�s||j��t|�}	|�||	�Wd�n1�s�0Y�qdS)Ncs,eZdZdZdZ�fdd�Zdd�Z�ZS)r�r�Tcst���||_||_dSr�)rr0r?rRrrr;r<r0�s
zC1.__init__cSsd|j|jfS)Nz
C1(%r, %r)rQrxr;r;r<r��szC1.__repr__)r�r�r��ARGS�NEED_DICT_COPYINGr0r�rr;r;rr<r��sr�csDeZdZdZdZ�fdd�Z�fdd�Zedd��Zd	d
�Z	�Z
S)rRr�Fcst��|�}||_||_|Sr��rr�r?rR)r�r?rRr6rr;r<r��sz
C2.__new__cst���|�d�dS�Nr�)rr0r|r=rr;r<r0�s
zC2.__init__cSs|jSr��r�r�r;r;r<r��szC2.__getnewargs__cSsd|j|jt|�fS)NzC2(%r, %r)<%r>�r?rRr2rxr;r;r<r��szC2.__repr__)r�r�r�r�r�r�r0rLr�r�rr;r;rr<rR�s
rRc@s8eZdZdZdZdd�Zedd��Zdd�Zd	d
�Z	dS)r�r�FcSs||_||_|�d�dSr�)r?rRr|rr;r;r<r0�szC3.__init__cSs|jSr�r�r�r;r;r<r��szC3.__getstate__cSs|\}}||_||_dSr�rQ)r6r�r?rRr;r;r<r��szC3.__setstate__cSsd|j|jt|�fS)NzC3(%r, %r)<%r>r�rxr;r;r<r��szC3.__repr__N)
r�r�r�r�r�r0rLr�r�r�r;r;r;r<r��s
r�cs8eZdZdZdZ�fdd�Zedd��Zdd�Z�Z	S)	r�)r�r�reFcst��||�}||_||_|Sr�r��r�r?rRr�r6rr;r<r��sz
C4.__new__cSs|jSr�r�r�r;r;r<r��szC4.__getnewargs__cSsd|j|jt|�fS)NzC4(%r, %r)<%r>�r?rRr)rxr;r;r<r��szC4.__repr__)
r�r�r�r�r�r�rLr�r�rr;r;rr<r��s
r�csFeZdZdZddiZdZdd��fdd�
Zed	d
��Zdd�Z	�Z
S)
r�r�r�rhFrr3cst��||�}||_||_|Sr�r�r�rr;r<r��sz
C5.__new__cSs|j|jfSr�)r��KWARGSr�r;r;r<r��szC5.__getnewargs_ex__cSsd|j|jt|�fS)NzC5(%r, %r)<%r>r�rxr;r;r<r��szC5.__repr__)r�r�r�r�r�r�r�rLr�r�rr;r;rr<r��s
r�)r�r�r�rfr�)r�r2rRr�r)r�r�r�r�r�r�rEr�r�r�r�r�rFrfr)
r6Ztest_classesZpickle_copiersr�r�r8r�r�r�Zobjcopy2r;r;r<�test_reduce_copying�s8


.
z!PicklingTests.test_reduce_copyingcs^Gdd�dt��G��fdd�d��ddl}|j�fdddifddf}|����d�|�dS)	Nc@seZdZdS)z(PicklingTests.test_issue24097.<locals>.SNrr;r;r;r<r�%sr�cs$eZdZ�d�gZ��fdd�ZdS)z(PicklingTests.test_issue24097.<locals>.Ar�cs(|dkr �d�g�jdd�<dSt�dS)Nr�r�)�
__slotnames__r�r��rr�r;r<r)sz4PicklingTests.test_issue24097.<locals>.A.__getattr__N)r�r�r�r�rr;r�r;r<r's
rrr�r�rf)r�r�r�rBr�)r6r�r�r;r�r<�test_issue24097#s
	zPicklingTests.test_issue24097cCs�t���|�t��t��d�Wd�n1s60Yt��d�|�t��t���Wd�n1sv0Y|�t��t��d�Wd�n1s�0YdSr�)rr�rgr�r�rxr;r;r<�test_object_reduce4s
*(z PicklingTests.test_object_reduce)N)
r�r�r�r�r�r�r�rr�r�r�r�r�r;r;r;r<r��s�
{

C|r�c@seZdZejdd��ZdS)�SharedKeyTestscCs6Gdd�d�}Gdd�d|�}|�|�}}|�t�t|��t�t|���|�t�t|��t�ddi��td�\|_|_|_|_	|_
|_|�t�t|��t�t|���|�}|�t�t|��t�t|���|�t�t|��t�ddi��td�\|_|_
|_	|_
|_|_|�t�t|��t�ddi��dS)Nc@seZdZdS)z)SharedKeyTests.test_subclasses.<locals>.ANrr;r;r;r<rGsrc@seZdZdS)z)SharedKeyTests.test_subclasses.<locals>.BNrr;r;r;r<r#Isr#r?rerv)rBr�r��varsZ
assertLessr�r7rar��wr�r�r�rKr�r�)r6rr#r?rRr�r;r;r<�test_subclassesDs       zSharedKeyTests.test_subclassesN)r�r�r�rrkr�r;r;r;r<r�Bsr�c@seZdZdd�Zdd�ZdS)�DebugHelperMetacCs&|�d�dur||d<t�||||�S)Nr�)r�rDr�)rEr9rr�r;r;r<r�^szDebugHelperMeta.__new__cCs
t|j�Sr�)r�r�r�r;r;r<r�bszDebugHelperMeta.__repr__N)r�r�r�r�r�r;r;r;r<r�Zsr�c@sdeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dS)�MroTestcCsd|_d|_dS)NrF)�step�readyrxr;r;r<rmmsz
MroTest.setUpcCs |j|k}|r|jd7_|Sr�)r�)r6�limit�retr;r;r<�
step_untilqs
zMroTest.step_untilcs*G�fdd�dt�}Gdd�d|d�}dS)NcseZdZ�fdd�ZdS)z4MroTest.test_incomplete_set_bases_on_self.<locals>.Mcs"��d�r|jd7_t�|�S)Nrer;)r�rGrDrSr�rxr;r<rS|s
z8MroTest.test_incomplete_set_bases_on_self.<locals>.M.mroNrVr;rxr;r<r{src@seZdZdS)z4MroTest.test_incomplete_set_bases_on_self.<locals>.ANrr;r;r;r<r�srr��r��r6rrr;rxr<�!test_incomplete_set_bases_on_selfwsz)MroTest.test_incomplete_set_bases_on_selfcsJG��fdd�dt�}Gdd�d|d��Gdd�d��}|jd7_dS)	NcseZdZ��fdd�ZdS)z/MroTest.test_reent_set_bases_on_base.<locals>.Mcs6|jdur,|jdkr,��d�r,�jd7_t�|�S)Nr#r�r;)r�r�r�rGrDrSr��rr6r;r<rS�s
z3MroTest.test_reent_set_bases_on_base.<locals>.M.mroNrVr;r�r;r<r�src@seZdZdS)z/MroTest.test_reent_set_bases_on_base.<locals>.ANrr;r;r;r<r�srr�c@seZdZdS)z/MroTest.test_reent_set_bases_on_base.<locals>.BNrr;r;r;r<r#�sr#r;)r�rG)r6rr#r;r�r<�test_reent_set_bases_on_base�s	z$MroTest.test_reent_set_bases_on_basecsJG�fdd�dt�}Gdd�d|d�}Gdd�d|�}Gdd	�d	|�}dS)
NcseZdZ�fdd�ZdS)z6MroTest.test_reent_set_bases_on_direct_base.<locals>.Mcs4|jd}|tur*��d�r*|jd7_t�|�S)Nrrur;)rGrr�rDrS)r�rHrxr;r<rS�s


z:MroTest.test_reent_set_bases_on_direct_base.<locals>.M.mroNrVr;rxr;r<r�src@seZdZdS)z6MroTest.test_reent_set_bases_on_direct_base.<locals>.ANrr;r;r;r<r�srr�c@seZdZdS)z6MroTest.test_reent_set_bases_on_direct_base.<locals>.BNrr;r;r;r<r#�sr#c@seZdZdS)z6MroTest.test_reent_set_bases_on_direct_base.<locals>.CNrr;r;r;r<r��sr�r�)r6rrr#r�r;rxr<�#test_reent_set_bases_on_direct_base�s	z+MroTest.test_reent_set_bases_on_direct_basecs�G���fdd�dt�}Gdd�d|d�}Gdd�d|��Gdd	�d	|��d
�_��t���jd7_Wd�n1s~0YdS)NcseZdZ���fdd�ZdS)z5MroTest.test_reent_set_bases_tp_base_cycle.<locals>.Mcs4�jr*|jdkr�f�_|jdkr*�f�_t�|�S)N�B1�B2�r�r�rGrDrSr��r�r�r6r;r<rS�s

z9MroTest.test_reent_set_bases_tp_base_cycle.<locals>.M.mroNrVr;r�r;r<r�src@seZdZdS)z5MroTest.test_reent_set_bases_tp_base_cycle.<locals>.ANrr;r;r;r<r�srr�c@seZdZdS)z6MroTest.test_reent_set_bases_tp_base_cycle.<locals>.B1Nrr;r;r;r<r��sr�c@seZdZdS)z6MroTest.test_reent_set_bases_tp_base_cycle.<locals>.B2Nrr;r;r;r<r��sr�Tr;)r�r�rgr�rGr�r;r�r<�"test_reent_set_bases_tp_base_cycle�s	z*MroTest.test_reent_set_bases_tp_base_cyclecs�G���fdd�dt�}Gdd�d|d�}Gdd�d|�}Gdd	�d	|��Gd
d�d|��d�_|f�_�f|_���j�f�������g���|��g���|j�f������|g�dS)
NcseZdZ���fdd�ZdS)z;MroTest.test_tp_subclasses_cycle_in_update_slots.<locals>.Mcs(�jr|jdkrd�_�f�_t�|�S�Nr�Fr�r��r�r�r6r;r<rS�sz?MroTest.test_tp_subclasses_cycle_in_update_slots.<locals>.M.mroNrVr;r�r;r<r�src@seZdZdS)z;MroTest.test_tp_subclasses_cycle_in_update_slots.<locals>.ANrr;r;r;r<r�srr�c@seZdZdS)z<MroTest.test_tp_subclasses_cycle_in_update_slots.<locals>.B1Nrr;r;r;r<r��sr�c@seZdZdS)z<MroTest.test_tp_subclasses_cycle_in_update_slots.<locals>.B2Nrr;r;r;r<r��sr�c@seZdZdS)z;MroTest.test_tp_subclasses_cycle_in_update_slots.<locals>.CNrr;r;r;r<r��sr�T)r�r�rGrBr��r6rrr�r;r�r<�(test_tp_subclasses_cycle_in_update_slots�s	z0MroTest.test_tp_subclasses_cycle_in_update_slotscs�Gdd�dt��G����fdd�dt�}Gdd�d|d�}Gdd	�d	|�}Gd
d�d|��Gdd
�d
|��d�_�����|f�_Wd�n1s�0Y�f|_���j�f����jtt�	����dS)Nc@seZdZdS)z=MroTest.test_tp_subclasses_cycle_error_return_path.<locals>.ENrr;r;r;r<r,�sr,cseZdZ����fdd�ZdS)z=MroTest.test_tp_subclasses_cycle_error_return_path.<locals>.Mcs:�jr0|jdkr0�j�fkr$d�_n�f�_��t�|�Sr�r�r��r�r�r,r6r;r<rS�szAMroTest.test_tp_subclasses_cycle_error_return_path.<locals>.M.mroNrVr;r�r;r<r�src@seZdZdS)z=MroTest.test_tp_subclasses_cycle_error_return_path.<locals>.ANrr;r;r;r<rsrr�c@seZdZdS)z>MroTest.test_tp_subclasses_cycle_error_return_path.<locals>.B1Nrr;r;r;r<r�sr�c@seZdZdS)z>MroTest.test_tp_subclasses_cycle_error_return_path.<locals>.B2Nrr;r;r;r<r�
sr�c@seZdZdS)z=MroTest.test_tp_subclasses_cycle_error_return_path.<locals>.CNrr;r;r;r<r�sr�T)
r�r�r�rgrGrBr�r�rDrSr�r;r�r<�*test_tp_subclasses_cycle_error_return_path�s
&z2MroTest.test_tp_subclasses_cycle_error_return_pathcs*G�fdd�dt�}Gdd�d|d�}dS)NcseZdZ�fdd�ZdS)z)MroTest.test_incomplete_extend.<locals>.McsX|jdurN|jdkrN��t�� Gdd�d|�}Wd�n1sD0Yt�|�S)NrWc@seZdZdS)z8MroTest.test_incomplete_extend.<locals>.M.mro.<locals>.XNrr;r;r;r<rW!s)r�r�rgr�rDrS)r�rWrxr;r<rSs.z-MroTest.test_incomplete_extend.<locals>.M.mroNrVr;rxr;r<rsrc@seZdZdS)z)MroTest.test_incomplete_extend.<locals>.ANrr;r;r;r<r&srr�r�r�r;rxr<�test_incomplete_extends	zMroTest.test_incomplete_extendcs*G�fdd�dt�}Gdd�d|d�}dS)NcseZdZ��fdd�Z�ZS)z(MroTest.test_incomplete_super.<locals>.McsJ|jdur@��t��t||�jWd�n1s60Yt�|�Sr�)r�rgr�rZxxxrDrSr�r�r;r<rS/s
*z,MroTest.test_incomplete_super.<locals>.M.mro)r�r�r�rSrr;rxrr<r.src@seZdZdS)z(MroTest.test_incomplete_super.<locals>.ANrr;r;r;r<r6srr�r�r�r;rxr<�test_incomplete_super)szMroTest.test_incomplete_supercsdGdd�d��G��fdd�dt��|�t��"Gdd�d�d�}Wd�n1sV0YdS)Nc@seZdZdS)z/MroTest.test_disappearing_custom_mro.<locals>.BNrr;r;r;r<r#>sr#cseZdZ��fdd�ZdS)z/MroTest.test_disappearing_custom_mro.<locals>.Mcs
�`�fSr�)rSr��r#rr;r<rSBsz3MroTest.test_disappearing_custom_mro.<locals>.M.mroNrVr;r�r;r<rAsrc@seZdZdS)z/MroTest.test_disappearing_custom_mro.<locals>.ANrr;r;r;r<rGsrr�)r�rgr�rHr;r�r<�test_disappearing_custom_mro9sz$MroTest.test_disappearing_custom_mroN)r�r�r�rmr�r�r�r�r�r�r�r�r�r�r;r;r;r<r�fs$$"r��__main__) r�r�r�r�r�r�rvrxr�rr.rMr�r�rr�rr�r�r/rr�rlr{r~r�r�rDr�r�r��mainr;r;r;r<�<module>s�
x-<=f


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