Your IP : 216.73.216.196


Current Path : /opt/alt/python36/lib64/python3.6/test/__pycache__/
Upload File :
Current File : //opt/alt/python36/lib64/python3.6/test/__pycache__/test_descr.cpython-36.opt-2.pyc

3

��2ad��@s,ddlZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlmZddl
mZGdd�dej�ZGdd�dej�ZGdd	�d	ej�ZGd
d�dej�ZGdd
�d
ej�ZGdd�dej�ZGdd�dej�ZGdd�de�ZGdd�dej�Zdd�Zedk�r(e�dS)�N)�deepcopy)�supportc@s�eZdZdd�Zd.dd�Zd/d	d
�Zd0d
d�Zd1dd�Zd2dd�Zd3dd�Z	dd�Z
dd�Zgfdd�Zd d!�Z
d"d#�Zd$d%�Zd&d'�Zejd(�d)d*��Zejd(�d+d,��Zd-S)4�
OperatorsTestcOs�tjj|f|�|�ddddddddd	d
ddd
dddddddd�|_x>t|jj��D],\}}|j�rn|d}nd|}||j|<qTWddddddd�|_x>t|jj��D],\}}|j�r�|d}nd|}||j|<q�WdS)N�+�-�*�@�/z//�divmodz**z<<z>>�&�^�|�cmp�<z<=z==z!=�>z>=)�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�r7�//opt/alt/python36/lib64/python3.6/test_descr.pyr,sJ



zOperatorsTest.__init__�len(a)�__len__c	Cs�d|i}|jt||�|�t|�}t||�}x||jkrD|jd}q.W|jt|d|�|j|�|j||�|�t||�}|j|�|�dS)N�ar�im_func)�assertEqual�eval�type�getattr�__dict__�	__bases__)	r2r;�resr6�meth�d�t�m�bmr7r7r8�	unop_testCs

zOperatorsTest.unop_test�a+b�__add__c
Cs�||d�}|jt||�|�t|�}t||�}x||jkrF|jd}q0W|jt|d|�|j|�|j|||�|�t||�}	|j|	|�|�dS)N)r;�brr<)r=r>r?r@rArB)
r2r;rLrCr6rDrErFrGrHr7r7r8�
binop_testSs


zOperatorsTest.binop_test�a[b:c]�__getitem__cCs�|||d�}|jt||�|�t|�}t||�}	x||jkrH|jd}q2W|jt|	d|	�|j|�|j|	|t||��|�t||�}
|j|
t||��|�dS)N)r;rL�crr<)r=r>r?r@rArB�slice)r2r;rLrPrCr6rDrErFrGrHr7r7r8�sliceop_testbs

zOperatorsTest.sliceop_test�a+=b�__iadd__c
Cs�t|�|d�}t||�|j|d|�t|�}t||�}x||jkrR|jd}q<W|jt|d|�|j|�t|�|d<||d|�|j|d|�t|�|d<t|d|�}	|	|�|j|d|�dS)N)r;rLr;rr<)r�execr=r?r@rArB)
r2r;rLrC�stmtrDrErFrGrHr7r7r8�
setop_testps

zOperatorsTest.setop_test�a[b]=c�__setitem__cCs�t|�||d�}t||�|j|d|�t|�}t||�}	x||jkrT|jd}q>W|jt|	d|	�|j|�t|�|d<|	|d||�|j|d|�t|�|d<t|d|�}
|
||�|j|d|�dS)N)r;rLrPr;rr<)rrUr=r?r@rArB)r2r;rLrPrCrVrDrErFrGrHr7r7r8�set2op_test�s


zOperatorsTest.set2op_test�a[b:c]=dcCs�t|�|||d�}t||�|j|d|�t|�}	x||	jkrL|	jd}	q6Wt|	|�}
|jt|
d|
�|	j|�t|�|d<|
|dt||�|�|j|d|�t|�|d<t|d|�}|t||�|�|j|d|�dS)N)r;rLrPrEr;rr<)rrUr=r?rArBr@rQ)r2r;rLrPrErCrVrDZ
dictionaryrFrGrHr7r7r8�setsliceop_test�s

zOperatorsTest.setsliceop_testc	Cs`|jdgdgddgdd�|jdddgdddd�|jdddgdd	dd�|jdddgddd
d�|jdddgd	dddgdd�|jdgdgddgd
d�|jddgdddddddgdd�|jdddgddd�|jddgdddddddgdd�|jddgdddddddgdd�|jddgddddgdd�|jddddgddddgddddgdd�dS)N��za+brK�zb in a�__contains__�rza[b]rOza[b:c]za+=brTza*=b�__imul__zlen(a)r:za*b�__mul__zb*a�__rmul__za[b]=crY��za[b:c]=d)rMrRrWrIrZr\)r2r7r7r8�
test_lists�s"""$zOperatorsTest.test_listscCsh|jddd�dddd�|jddd�dddd�|jddd�dddd	�ddd�}g}xt|j��D]}|j|�qdWg}xt|�D]}|j|�q�W|j||�g}x|j�D]}|j|�q�W|j||�g}xtj|�D]}|j|�q�W|j||�ddd�}|j|dd
d�|jt	t
|�i�|�|jt	|j�i�|�|jddd�dddddd
�dd�dS)Nr^ra)r]r_r]zb in ar`rza[b]rOzlen(a)r:r_)r]r^r_za[b]=crY)
rMr.�keys�append�iterr=�__iter__�dictrIr>�repr�__repr__rZ)r2rE�l1�i�lr7r7r8�
test_dicts�s2

zOperatorsTest.test_dictscCs�||d�}xL|jj�D]>\}}||krd|}t||�rt||�}|j|||||�qWxNt|jj��D]<\}}||krhd|}t||�rht||�}|j||||�qhWdS)N)r;rLz__%s__)r-r/�hasattrr>rMr.r1rI)r2r;rL�skiprlr5r6rCr7r7r8�number_operators�s




zOperatorsTest.number_operatorscCs~|jdd�|jdj�d�|jdj�d�Gdd�dt�}|j|d�d�y|�dWntk
rnYnX|jd	�dS)
N�dr_r]rc@seZdZdd�ZdS)z"OperatorsTest.test_ints.<locals>.CcSstS)N)�NotImplemented)r2�otherr7r7r8rK�sz*OperatorsTest.test_ints.<locals>.C.__add__N)�__name__�
__module__�__qualname__rKr7r7r7r8�C�sr|re�z+NotImplemented should have caused TypeError)rur=�__bool__r%�	TypeError�fail)r2r|r7r7r8�	test_ints�szOperatorsTest.test_intscCs|jdd�dS)NgY@g@)ru)r2r7r7r8�test_floats�szOperatorsTest.test_floatscCs�|jddddddddd	d
dg	d�Gd
d�dt�}|ddd�}|jt|�d�|j|jd�||dd�}|jt|�d�|j|jd�|d�}|jt|�d�|j|jd�dS)NyY@y@rrr!r"r%r&rr
�mod)rtc@s&eZdZdgZdd�Zdd�ZeZdS)z,OperatorsTest.test_complexes.<locals>.Number�precc_s"tj|f|��}|jdd�|_|S)Nr��)�complex�__new__�getr�)�clsr3�kwds�resultr7r7r8r�sz4OperatorsTest.test_complexes.<locals>.Number.__new__cSsJ|j}|jdkrd||jfS|jdkr6d||jfSd||j||jfS)Ngz%.*gz%.*gjz(%.*g+%.*gj))r��imag�real)r2r�r7r7r8rns

z5OperatorsTest.test_complexes.<locals>.Number.__repr__N)ryrzr{�	__slots__r�rn�__str__r7r7r7r8�Numbersr�g��Q�	@rf)r�z3.14r^z3.1gPm@z234.5r�)rur�r=rmr�)r2r�r;r7r7r8�test_complexes�szOperatorsTest.test_complexescCs2|jtjdd�tdd��|jtjdd�d�dS)Ny@g@g@r]g@g�)r=r��__radd__r&�__rsub__)r2r7r7r8�test_explicit_reverse_methods sz+OperatorsTest.test_explicit_reverse_methodsz"the module 'xxsubtype' is internalc
CsXddl}ddl}d"dd�}||j|j<|j|dg�|dg�|ddg�dd�|j|dddg�ddd	d
�|j|dddg�ddd	d
�|j|dddg�dddd
�|j|dddg�dd|ddg�dd
�|j|dg�|dg�|ddg�dd�|j|ddg�d|ddddddg�dd�|j|dddg�ddd�|j|ddg�d|ddddddg�dd�|j|ddg�d|ddddddg�dd�|j|ddg�dd|ddg�dd�|j	|ddddg�dd|ddg�|ddddg�dd�Gdd�d|j�}|�}|j
|g�|j
|j�d�|jd �|j
|d g�|j
|j
�d�|jd!�|j
|j
�d!�dS)#NrcSsddl}|j|�S)Nr)�	xxsubtype�spamlist)rq�memo�spamr7r7r8r�*sz/OperatorsTest.test_spam_lists.<locals>.spamlistr]r^za+brKr_zb in ar`raza[b]rOza[b:c]za+=brTza*=brbzlen(a)r:za*brczb*ardza[b]=crYrerfza[b:c]=dc@seZdZdd�ZdS)z(OperatorsTest.test_spam_lists.<locals>.CcSsdS)Nr]r7)r2r7r7r8�fooGsz,OperatorsTest.test_spam_lists.<locals>.C.fooN)ryrzr{r�r7r7r7r8r|Fsr|rv�*)N)�copyr��_deepcopy_dispatchr�rMrRrWrIrZr\r=r�ri�getstate�setstate)r2r�r�r�r|r;r7r7r8�test_spam_lists%s@
   $$$ 

zOperatorsTest.test_spam_listsc	Cs$ddl}ddl}ddd�}||j|j<|j|ddd��dddd	�|j|ddd��dddd	�|j|ddd��ddd
d�|ddd��}g}xt|j��D]}|j|�q�Wg}xt|�D]}|j|�q�W|j	||�g}x|j
�D]}|j|�q�W|j	||�g}x&t|i��j
|�D]}|j|��qW|j	||�ddd�}||�}	|j|	ddd
�|j|	t
|�dd�|j|ddd��dd|dddd��dd�Gdd�d|j�}
|
�}|j	t|j��g�|j	|j�d�d|d<|j	t|j��dg�|j	|j�d�|jd�|j	|j�d�dS)NrcSs6ddl}|j�}x t|j��D]\}}|||<qW|S)Nr)r��spamdictr.r/)rEr�r��sd�k�vr7r7r8r�Us
z/OperatorsTest.test_spam_dicts.<locals>.spamdictr^ra)r]r_r]zb in ar`za[b]rOzlen(a)r:zrepr(a)rnr_)r]r^r_za[b]=crYc@seZdZdd�ZdS)z(OperatorsTest.test_spam_dicts.<locals>.CcSsdS)Nr]r7)r2r7r7r8r�ysz,OperatorsTest.test_spam_dicts.<locals>.C.fooN)ryrzr{r�r7r7r7r8r|xsr|�barr�rv)N)r�r�)r�r�r�r�rMr.rhrirjr=rkr?rIrmrZr/r�r�r�)r2r�r�r�rErorprqZ	straightdZspamdr|r;r7r7r8�test_spam_dictsQsJ

"
zOperatorsTest.test_spam_dictsN)r9r:)rJrK)rNrO)rSrT)rXrY)r[rY)ryrzr{r,rIrMrRrWrZr\rgrrrur�r�r�r�r�impl_detailr�r�r7r7r7r8rs 0





!,rcs�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&�Z�fd'd(�Zejd)d*��Zejd+�d,d-��Zd.d/�Zejd0d1��Zejd+�d2d3��Zd4d5�Zd6d7�Z d8d9�Z!e"j#d:d;��Z$d<d=�Z%e"j#d>d?��Z&d@dA�Z'dBdC�Z(dDdE�Z)dFdG�Z*dHdI�Z+dJdK�Z,dLdM�Z-e"j.e/j0j1dNkdO�dPdQ��Z2ej3dRdS��Z4dTdU�Z5dVdW�Z6dXdY�Z7�fdZd[�Z8d\d]�Z9d^d_�Z:d`da�Z;dbdc�Z<ddde�Z=dfdg�Z>dhdi�Z?djdk�Z@dldm�ZAdndo�ZBdpdq�ZCdrds�ZDdtdu�ZEdvdw�ZFdxdy�ZGdzd{�ZHd|d}�ZId~d�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]ejd��d�d���Z^d�d��Z_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�dƄZmd�dȄZnd�dʄZod�d̄Zpd�d΄Zqd�dЄZrd�d҄Zsd�dԄZtd�dքZud�d؄Zvd�dڄZw�fd�d܄Zx�ZyS)��ClassPropertiesAndMethodscCs|jt||�d||f�dS)Nz%r has no attribute %r)�
assertTruers)r2�objr5r7r7r8�
assertHasAttr�sz'ClassPropertiesAndMethods.assertHasAttrcCs|jt||�d||f�dS)Nz%r has unexpected attribute %r)�assertFalsers)r2r�r5r7r7r8�assertNotHasAttr�sz*ClassPropertiesAndMethods.assertNotHasAttrc	s��jttt���jit�t�}�j|i��j|jt��j|t�G�fdd�dt�}�jt|t��|d�}�j|jd�|ddd�}�j|ddko�|dd�|�}�j|jd��j|j�d�|j	d	��j|jd	��j|j�d	�|j	d
��j|jd
��j|j�d
��j|dd	�d|d<�j|dd�d
}x@t
|�D]4}|�||<x"t
|�D]}|||||<�qlW�qTWx>t
|�D]2}x*t
|�D]}�j|||||��q�W�q�WdS)Ncs@eZdZd
Z�fdd�Zdd�Z�fdd�Zdd	�Zd
d�ZdS)z6ClassPropertiesAndMethods.test_python_dicts.<locals>.Cr]csH|r�jt|�d�|d|_|rDx t|j��D]\}}|||<q0WdS)Nr]r)r=�len�stater.r/)�
self_localr;�kwr�r�)r2r7r8r,�s
z?ClassPropertiesAndMethods.test_python_dicts.<locals>.C.__init__cSs|j|d�S)Nr)r�)r2�keyr7r7r8rO�szBClassPropertiesAndMethods.test_python_dicts.<locals>.C.__getitem__cs"�j|td��tj|||�dS)Nr)�assertIsInstancer?rlrY)r�r��value)r2r7r8rY�szBClassPropertiesAndMethods.test_python_dicts.<locals>.C.__setitem__cSs
||_dS)N)r�)r2r�r7r7r8r��sz?ClassPropertiesAndMethods.test_python_dicts.<locals>.C.setstatecSs|jS)N)r�)r2r7r7r8r��sz?ClassPropertiesAndMethods.test_python_dicts.<locals>.C.getstateN���)	ryrzr{r�r,rOrYr�r�r7)r2r7r8r|�sr|r�r]r^)r�r�r�r�r�
r���2r�r�)r��
issubclassrlr�r=�assertIs�	__class__r�r�r��range)	r2rEr|�a1�a2r;�Nrp�jr7)r2r8�test_python_dicts�s@


z+ClassPropertiesAndMethods.test_python_dictscCsnGdd�dt�}|�}|jdddg�|j|dd�|j|dd�|j|dd�|j|dd	�d
�dS)Nc@seZdZdd�ZdS)z6ClassPropertiesAndMethods.test_python_lists.<locals>.CcSs&t|t�r|j|jfStj||�dS)Nrv)�
isinstancerQ�start�stopr.rO)r2rpr7r7r8rO�s
zBClassPropertiesAndMethods.test_python_lists.<locals>.C.__getitem__N)ryrzr{rOr7r7r7r8r|�sr|rr]r^rv�e�f��)rvr�)r.�extendr=)r2r|r;r7r7r8�test_python_lists�sz+ClassPropertiesAndMethods.test_python_listsc"sBGdd�dtd�}|�}|j|j�d�|jd�|j|j�d�Gdd�dt�}Gdd	�d	|d�}|j|j�|�|�}|j|j|�Gd
d�dt�}Gdd�d|d�}|j|jd
�|�}|j|jd
�Gdd�dt��G�fdd�dt�}Gdd�d|d�}|j|jd�|j|j	f�|j
d|j�|�}|j|j�d�G�fdd�dt��Gdd�d�d�}	Gdd�d|	�}
Gdd�d|	�}Gdd	�d	||
�}|j|�j
�d�Gdd�d|
|�}|j|�j
�d �G�fd!d"�d"t��Gd#d�d�d�}	|	�}|j|d$�d%|_|j|jd%�|j|jdY�Gd&d'�d'���}Gd(d�d|d�}	Gd)d�d|	�}
Gd*d�d|	�}Gd+d	�d	||
�}|j|�jd�G�fd,d-�d-t��Gd.d�d�d�}|j�jd
�|�}|jt|�|�|j�jd
�Gd/d�dt�}|�}y
|�Wntk
�rYnX|jd0�Gd1d�dt�}	Gd2d�dt�}
Gd3d�dt|	d�}Gd4d	�d	|
|�}|j|	t|��g�G�fd5d6�d6t�}
G�fd7d8�d8|
�}Gd9d�d|
d�}	|jd6g���j�Gd:d�d|d�}
|jd8d6g���j�Gd;d�d|	|
�}|jd8d6g���j�|j
d<|j�Gd=d>�d>|
|	�}|jd8d6g���j�|j
d<|j�Gd?d	�d	|td�}|jd8d6g���j�|j
d<|j�Gd@d�d||
d�}|jd8d6g���j�|j
d<|j�t���fdAdB�}GdCdD�dD|d�}GdEdF�dFt|d�}GdGdH�dH||d�}|j�|�|j�|�|j�|�g�G��fdIdJ�dJ�}G��fdKdL�dL|�}GdMd�d|d�}	|j|t|	��|jdJg���j�|jdJg���j�GdNd�d|d�}
|j|t|
��|jdLdJg���j�|jdLdJg���j�GdOd�d|	|
�}|j|t|��|jdLdJg���j�|jdLdJg���j�GdPd>�d>|
|	�}|j|t|��|jdLdJg���j�|jdLdJg���j�|jt��GdQd	�d	|td�}WdQRXGdRd�d||d�}|j|t|��|jdLdJg���j�|jdLdJg���j�GdSdT�dTt�|�}|j|t|��|jdLdJg���j�|jdLdJg���j�GdUdV�dV|t��}|j|t|��|jdLdJg���j�|jdLdJg���j�|jt��GdWdD�dD|t��}WdQRX|jt��GdXdD�dDt�|�}WdQRXdS)ZNc@s$eZdZdd�Zdd�Zdd�ZdS)z3ClassPropertiesAndMethods.test_metaclass.<locals>.CcSs
d|_dS)Nr)�	_C__state)r2r7r7r8r,�sz<ClassPropertiesAndMethods.test_metaclass.<locals>.C.__init__cSs|jS)N)r�)r2r7r7r8r��sz<ClassPropertiesAndMethods.test_metaclass.<locals>.C.getstatecSs
||_dS)N)r�)r2r�r7r7r8r��sz<ClassPropertiesAndMethods.test_metaclass.<locals>.C.setstateN)ryrzr{r,r�r�r7r7r7r8r|�sr|)�	metaclassrr�c@seZdZdd�ZdS)z<ClassPropertiesAndMethods.test_metaclass.<locals>._metaclasscSs|S)Nr7)r�r7r7r8�myself�szCClassPropertiesAndMethods.test_metaclass.<locals>._metaclass.myselfN)ryrzr{r�r7r7r7r8�
_metaclass�sr�c@seZdZdS)z3ClassPropertiesAndMethods.test_metaclass.<locals>.DN)ryrzr{r7r7r7r8�D�sr�c@seZdZdd�ZdS)z4ClassPropertiesAndMethods.test_metaclass.<locals>.M1cSsd|d<tj||||�S)Nr]�__spam__)r?r�)r�r5�basesrlr7r7r8r��sz<ClassPropertiesAndMethods.test_metaclass.<locals>.M1.__new__N)ryrzr{r�r7r7r7r8�M1�sr�c@seZdZdS)z3ClassPropertiesAndMethods.test_metaclass.<locals>.CN)ryrzr{r7r7r7r8r|�sr]c@seZdZdS)z;ClassPropertiesAndMethods.test_metaclass.<locals>._instanceN)ryrzr{r7r7r7r8�	_instance�sr�cs$eZdZedd��Z�fdd�ZdS)z4ClassPropertiesAndMethods.test_metaclass.<locals>.M2cSs tj|�}||_||_||_|S)N)�objectr�r5r�rl)r�r5r�rlr2r7r7r8r��s

z<ClassPropertiesAndMethods.test_metaclass.<locals>.M2.__new__cs@��}x4|jD]*}|jd�rqt|||j|j||��qW|S)N�__)rl�
startswith�setattr�__get__)r2�itr�)r�r7r8�__call__�s
z=ClassPropertiesAndMethods.test_metaclass.<locals>.M2.__call__N)ryrzr{�staticmethodr�r�r7)r�r7r8�M2�sr�c@seZdZdd�ZdS)z3ClassPropertiesAndMethods.test_metaclass.<locals>.CcSsdS)Nr�r7)r2r7r7r8r�sz8ClassPropertiesAndMethods.test_metaclass.<locals>.C.spamN)ryrzr{r�r7r7r7r8r|�sr�r�cseZdZ��fdd�Z�ZS)z;ClassPropertiesAndMethods.test_metaclass.<locals>.autosupercs^t�|�j||||�}x |dd�dkr6|dd�}qW|rFd|}nd}t||t|��|S)Nr]�_z
_%s__superZ__super)�superr�r�)r�r5r�rlr�)r��	autosuperr7r8r�
s

zCClassPropertiesAndMethods.test_metaclass.<locals>.autosuper.__new__)ryrzr{r��
__classcell__r7)r�)r�r8r�
sr�c@seZdZdd�ZdS)z3ClassPropertiesAndMethods.test_metaclass.<locals>.AcSsdS)N�Ar7)r2r7r7r8rDsz8ClassPropertiesAndMethods.test_metaclass.<locals>.A.methN)ryrzr{rDr7r7r7r8r�sr�c@seZdZdd�ZdS)z3ClassPropertiesAndMethods.test_metaclass.<locals>.BcSsd|jj�S)N�B)�	_B__superrD)r2r7r7r8rDsz8ClassPropertiesAndMethods.test_metaclass.<locals>.B.methN)ryrzr{rDr7r7r7r8r�sr�c@seZdZdd�ZdS)z3ClassPropertiesAndMethods.test_metaclass.<locals>.CcSsd|jj�S)Nr|)�	_C__superrD)r2r7r7r8rD sz8ClassPropertiesAndMethods.test_metaclass.<locals>.C.methN)ryrzr{rDr7r7r7r8r|sc@seZdZdd�ZdS)z3ClassPropertiesAndMethods.test_metaclass.<locals>.DcSsd|jj�S)Nr�)�	_D__superrD)r2r7r7r8rD#sz8ClassPropertiesAndMethods.test_metaclass.<locals>.D.methN)ryrzr{rDr7r7r7r8r�"sZDCBAc@seZdZdd�ZdS)z3ClassPropertiesAndMethods.test_metaclass.<locals>.EcSsd|jj�S)N�E)Z	_E__superrD)r2r7r7r8rD'sz8ClassPropertiesAndMethods.test_metaclass.<locals>.E.methN)ryrzr{rDr7r7r7r8r�&sr�ZEBCAcseZdZ��fdd�Z�ZS)z>ClassPropertiesAndMethods.test_metaclass.<locals>.autopropertyc	s�i}x�|j�D]v\}}|jd�rN|dd�}|j|d�\}}|}||f||<q|jd�r|dd�}|j|d�\}}|}||f||<qWx&|j�D]\}\}}t||�||<q�Wt�|�j||||�S)NZ_get_reZ_set_)NN)NN)r/r�r��propertyr�r�)	r�r5r�rl�hitsr��valr��set)r��autopropertyr7r8r�.s 

zFClassPropertiesAndMethods.test_metaclass.<locals>.autoproperty.__new__)ryrzr{r�r�r7)r�)r�r8r�+sr�c@seZdZdd�Zdd�ZdS)z3ClassPropertiesAndMethods.test_metaclass.<locals>.AcSs|jS)N)�_A__x)r2r7r7r8�_get_x@sz:ClassPropertiesAndMethods.test_metaclass.<locals>.A._get_xcSs||_dS)N)r�)r2�xr7r7r8�_set_xBsz:ClassPropertiesAndMethods.test_metaclass.<locals>.A._set_xN)ryrzr{r�r�r7r7r7r8r�?sr�r�c@seZdZdS)z@ClassPropertiesAndMethods.test_metaclass.<locals>.multimetaclassN)ryrzr{r7r7r7r8�multimetaclassJsr�c@seZdZdd�ZdS)z3ClassPropertiesAndMethods.test_metaclass.<locals>.AcSsdS)Nr�r7)r2r7r7r8r�Nsz:ClassPropertiesAndMethods.test_metaclass.<locals>.A._get_xN)ryrzr{r�r7r7r7r8r�Msc@seZdZdd�ZdS)z3ClassPropertiesAndMethods.test_metaclass.<locals>.BcSsd|jj�S)Nr�)r�r�)r2r7r7r8r�Qsz:ClassPropertiesAndMethods.test_metaclass.<locals>.B._get_xN)ryrzr{r�r7r7r7r8r�Psc@seZdZdd�ZdS)z3ClassPropertiesAndMethods.test_metaclass.<locals>.CcSsd|jj�S)Nr|)r�r�)r2r7r7r8r�Tsz:ClassPropertiesAndMethods.test_metaclass.<locals>.C._get_xN)ryrzr{r�r7r7r7r8r|Ssc@seZdZdd�ZdS)z3ClassPropertiesAndMethods.test_metaclass.<locals>.DcSsd|jj�S)Nr�)r�r�)r2r7r7r8r�Wsz:ClassPropertiesAndMethods.test_metaclass.<locals>.D._get_xN)ryrzr{r�r7r7r7r8r�VscseZdZdZ�fdd�ZdS)z3ClassPropertiesAndMethods.test_metaclass.<locals>.Trcs�jd7_dS)Nr])�counter)r2r3)�Tr7r8r,^sz<ClassPropertiesAndMethods.test_metaclass.<locals>.T.__init__N)ryrzr{r�r,r7)r�r7r8r�\sr�c@seZdZdS)z3ClassPropertiesAndMethods.test_metaclass.<locals>.CN)ryrzr{r7r7r7r8r|`sc@seZdZdS)z3ClassPropertiesAndMethods.test_metaclass.<locals>.CN)ryrzr{r7r7r7r8r|gsz5calling object w/o call method should raise TypeErrorc@seZdZdd�ZdS)z3ClassPropertiesAndMethods.test_metaclass.<locals>.Ac_stj||�S)N)r?r�)r3r4r7r7r8r�psz;ClassPropertiesAndMethods.test_metaclass.<locals>.A.__new__N)ryrzr{r�r7r7r7r8r�osc@seZdZdS)z3ClassPropertiesAndMethods.test_metaclass.<locals>.BN)ryrzr{r7r7r7r8r�ssc@seZdZdS)z3ClassPropertiesAndMethods.test_metaclass.<locals>.CN)ryrzr{r7r7r7r8r|vsc@seZdZdS)z3ClassPropertiesAndMethods.test_metaclass.<locals>.DN)ryrzr{r7r7r7r8r�zscs.eZdZe��fdd��Zedd��Z�ZS)z7ClassPropertiesAndMethods.test_metaclass.<locals>.AMetacs�jd�t�j||||�S)N�AMeta)rir�r�)�mclsr5r��ns)r��	new_callsr7r8r��s
z?ClassPropertiesAndMethods.test_metaclass.<locals>.AMeta.__new__cSsiS)Nr7)r�r5r�r7r7r8�__prepare__�szCClassPropertiesAndMethods.test_metaclass.<locals>.AMeta.__prepare__)ryrzr{r�r��classmethodr�r�r7)r�)r�r8r��sr�cs2eZdZe��fdd��Ze�fdd��Z�ZS)z7ClassPropertiesAndMethods.test_metaclass.<locals>.BMetacs�jd�t�j||||�S)N�BMeta)rir�r�)r�r5r�r�)r�r�r7r8r��s
z?ClassPropertiesAndMethods.test_metaclass.<locals>.BMeta.__new__cst�j||�}d|d<|S)NT�BMeta_was_here)r�r�)r�r5r�r�)r�r7r8r��szCClassPropertiesAndMethods.test_metaclass.<locals>.BMeta.__prepare__)ryrzr{r�r�r�r�r�r7)r�)r�r8r��sr�c@seZdZdS)z3ClassPropertiesAndMethods.test_metaclass.<locals>.AN)ryrzr{r7r7r7r8r��sc@seZdZdS)z3ClassPropertiesAndMethods.test_metaclass.<locals>.BN)ryrzr{r7r7r7r8r��sc@seZdZdS)z3ClassPropertiesAndMethods.test_metaclass.<locals>.CN)ryrzr{r7r7r7r8r|�sr�c@seZdZdS)z4ClassPropertiesAndMethods.test_metaclass.<locals>.C2N)ryrzr{r7r7r7r8�C2�sr�c@seZdZdS)z3ClassPropertiesAndMethods.test_metaclass.<locals>.DN)ryrzr{r7r7r7r8r��sc@seZdZdS)z3ClassPropertiesAndMethods.test_metaclass.<locals>.EN)ryrzr{r7r7r7r8r��scs�S)Nr7)r3r4)�markerr7r8�func�sz6ClassPropertiesAndMethods.test_metaclass.<locals>.funcc@seZdZdS)z3ClassPropertiesAndMethods.test_metaclass.<locals>.XN)ryrzr{r7r7r7r8�X�sr�c@seZdZdS)z3ClassPropertiesAndMethods.test_metaclass.<locals>.YN)ryrzr{r7r7r7r8�Y�sr�c@seZdZdS)z3ClassPropertiesAndMethods.test_metaclass.<locals>.ZN)ryrzr{r7r7r7r8�Z�sr�cs.eZdZ��fdd�Ze�fdd��Z�ZS)z:ClassPropertiesAndMethods.test_metaclass.<locals>.ANotMetacs�jd�t�j|�S)N�ANotMeta)rir�r�)r�r3r4)r�r�r7r8r��s
zBClassPropertiesAndMethods.test_metaclass.<locals>.ANotMeta.__new__cs�jd�iS)Nr�)ri)r�r5r�)�
prepare_callsr7r8r��s
zFClassPropertiesAndMethods.test_metaclass.<locals>.ANotMeta.__prepare__)ryrzr{r�r�r�r�r7)r�r)r�r8r��sr�cs0eZdZ��fdd�Ze��fdd��Z�ZS)z:ClassPropertiesAndMethods.test_metaclass.<locals>.BNotMetacs�jd�t�j|�S)N�BNotMeta)rir�r�)r�r3r4)r�r�r7r8r��s
zBClassPropertiesAndMethods.test_metaclass.<locals>.BNotMeta.__new__cs�jd�t�j||�S)Nr)rir�r�)r�r5r�)r�rr7r8r��s
zFClassPropertiesAndMethods.test_metaclass.<locals>.BNotMeta.__prepare__)ryrzr{r�r�r�r�r7)r�r)r�r8r�src@seZdZdS)z3ClassPropertiesAndMethods.test_metaclass.<locals>.AN)ryrzr{r7r7r7r8r��sc@seZdZdS)z3ClassPropertiesAndMethods.test_metaclass.<locals>.BN)ryrzr{r7r7r7r8r��sc@seZdZdS)z3ClassPropertiesAndMethods.test_metaclass.<locals>.CN)ryrzr{r7r7r7r8r|�sc@seZdZdS)z4ClassPropertiesAndMethods.test_metaclass.<locals>.C2N)ryrzr{r7r7r7r8r��sc@seZdZdS)z3ClassPropertiesAndMethods.test_metaclass.<locals>.DN)ryrzr{r7r7r7r8r�sc@seZdZdS)z3ClassPropertiesAndMethods.test_metaclass.<locals>.EN)ryrzr{r7r7r7r8r�sc@seZdZdS)z3ClassPropertiesAndMethods.test_metaclass.<locals>.FN)ryrzr{r7r7r7r8�Fsrc@seZdZdS)z4ClassPropertiesAndMethods.test_metaclass.<locals>.F2N)ryrzr{r7r7r7r8�F2src@seZdZdS)z3ClassPropertiesAndMethods.test_metaclass.<locals>.XN)ryrzr{r7r7r7r8r�sc@seZdZdS)z3ClassPropertiesAndMethods.test_metaclass.<locals>.XN)ryrzr{r7r7r7r8r�"si�)r?r=r�r�r�r�r�r�r5r��assertInrlr�rDr�r�r�r�rr�r��clearrA�assertRaisesr%)r2r|r;r�r�rEr�rPr�r�r�r�r�r�r�r�r�r�r�r�r�rrrr7)r�r�r�r�r�r�rr8�test_metaclass�s$


		z(ClassPropertiesAndMethods.test_metaclasscs�g�tt��G��fdd�d��}|d�}d|_|j}|`|j�dd
dg�yGd	d
�d
tjt�}Wntk
rxYnX|jd�dS)NcsBeZdZ�fdd�Z��fdd�Z��fdd�Z��fdd�Zd	S)
z<ClassPropertiesAndMethods.test_module_subclasses.<locals>.MMcs�j||�dS)N)r,)r2r5)�MTr7r8r,*szEClassPropertiesAndMethods.test_module_subclasses.<locals>.MM.__init__cs�jd|f��j||�S)Nr@)ri�__getattribute__)r2r5)r�logr7r8r	,szMClassPropertiesAndMethods.test_module_subclasses.<locals>.MM.__getattribute__cs"�jd||f��j|||�dS)Nr�)ri�__setattr__)r2r5r�)rr
r7r8r/szHClassPropertiesAndMethods.test_module_subclasses.<locals>.MM.__setattr__cs�jd|f��j||�dS)N�delattr)ri�__delattr__)r2r5)rr
r7r8r
2szHClassPropertiesAndMethods.test_module_subclasses.<locals>.MM.__delattr__N)ryrzr{r,r	rr
r7)rr
r7r8�MM)srr;r�r�r�r@rc@seZdZdS)z@ClassPropertiesAndMethods.test_module_subclasses.<locals>.ModuleN)ryrzr{r7r7r7r8�Module?srz?inheriting from ModuleType and str at the same time should fail)r�r�r�)r@r�)rr�)	r?�sysr�r=�types�
ModuleType�strrr�)r2rr;r�rr7)rr
r8�test_module_subclasses%sz0ClassPropertiesAndMethods.test_module_subclassescsLGdd�dt����}|j|j�d�|jd�|j|j�d�G�fdd�dt��}|�}|jt|j��g�d|d<|jt|j��dg�|j|dd�|j|j�d�|jd�|j|j�d�|j|j|t�tf�Gd	d
�d
t�}Gdd�d|t�}|j|�j	�d
�|jt
|��d
�|j|�j	�d�|jt
|��d�dS)Nc@s$eZdZdd�Zdd�Zdd�ZdS)z>ClassPropertiesAndMethods.test_multiple_inheritance.<locals>.CcSs
d|_dS)Nr)r�)r2r7r7r8r,JszGClassPropertiesAndMethods.test_multiple_inheritance.<locals>.C.__init__cSs|jS)N)r�)r2r7r7r8r�LszGClassPropertiesAndMethods.test_multiple_inheritance.<locals>.C.getstatecSs
||_dS)N)r�)r2r�r7r7r8r�NszGClassPropertiesAndMethods.test_multiple_inheritance.<locals>.C.setstateN)ryrzr{r,r�r�r7r7r7r8r|Isr|rr�cseZdZ�fdd�ZdS)z>ClassPropertiesAndMethods.test_multiple_inheritance.<locals>.Dcsti�j|��j|�dS)N)r?r,)r2)r|r7r8r,UszGClassPropertiesAndMethods.test_multiple_inheritance.<locals>.D.__init__N)ryrzr{r,r7)r|r7r8r�Tsr��world�helloc@seZdZdd�Zdd�ZdS)zAClassPropertiesAndMethods.test_multiple_inheritance.<locals>.NodecSst|j��S)N)r%r�)r2r7r7r8�__int__dszIClassPropertiesAndMethods.test_multiple_inheritance.<locals>.Node.__int__cSsdS)NZ23r7)r2r7r7r8r�fszEClassPropertiesAndMethods.test_multiple_inheritance.<locals>.Node.fooN)ryrzr{rr�r7r7r7r8�Nodecsrc@seZdZdd�ZdS)zAClassPropertiesAndMethods.test_multiple_inheritance.<locals>.FragcSsdS)NZ42r7)r2r7r7r8r�iszEClassPropertiesAndMethods.test_multiple_inheritance.<locals>.Frag.fooN)ryrzr{r�r7r7r7r8�Fraghsr�r�)rr)r�r=r�r�rlr.rhr/�__mro__rr%)r2r;r�rErrr7)r|r8�test_multiple_inheritanceGs*

z3ClassPropertiesAndMethods.test_multiple_inheritancecCs�Gdd�dt�}|j|�j�d�Gdd�d|�}|j|�j�d�|j|�j�d�Gdd�d|�}|j|�j�d�|j|�j�d�Gdd�d||�}|j|�j�d�|j|�j�d�|j|j||||tf�Gd	d
�d
||�}|j|�j�d�|j|�j�d�|j|j||||tf�yGdd�d||�}Wntk
�rRYnX|jd
�yGdd�d||�}Wntk
�r�YnX|jd�dS)Nc@seZdZdd�ZdS)z=ClassPropertiesAndMethods.test_diamond_inheritance.<locals>.AcSsdS)Nr�r7)r2r7r7r8r�sszBClassPropertiesAndMethods.test_diamond_inheritance.<locals>.A.spamN)ryrzr{r�r7r7r7r8r�rsr�c@seZdZdd�Zdd�ZdS)z=ClassPropertiesAndMethods.test_diamond_inheritance.<locals>.BcSsdS)Nr�r7)r2r7r7r8�boovszAClassPropertiesAndMethods.test_diamond_inheritance.<locals>.B.boocSsdS)Nr�r7)r2r7r7r8r�wszBClassPropertiesAndMethods.test_diamond_inheritance.<locals>.B.spamN)ryrzr{rr�r7r7r7r8r�usr�c@seZdZdd�ZdS)z=ClassPropertiesAndMethods.test_diamond_inheritance.<locals>.CcSsdS)Nr|r7)r2r7r7r8r{szAClassPropertiesAndMethods.test_diamond_inheritance.<locals>.C.booN)ryrzr{rr7r7r7r8r|zsr|c@seZdZdS)z=ClassPropertiesAndMethods.test_diamond_inheritance.<locals>.DN)ryrzr{r7r7r7r8r�~sr�c@seZdZdS)z=ClassPropertiesAndMethods.test_diamond_inheritance.<locals>.EN)ryrzr{r7r7r7r8r��sr�c@seZdZdS)z=ClassPropertiesAndMethods.test_diamond_inheritance.<locals>.FN)ryrzr{r7r7r7r8r�srz#expected MRO order disagreement (F)c@seZdZdS)z=ClassPropertiesAndMethods.test_diamond_inheritance.<locals>.GN)ryrzr{r7r7r7r8�G�srz#expected MRO order disagreement (G))r�r=r�rrrr�)r2r�r�r|r�r�rrr7r7r8�test_diamond_inheritanceps4
z2ClassPropertiesAndMethods.test_diamond_inheritancec	Cs�Gdd�dt�}Gdd�dt�}Gdd�dt�}Gdd�d|�}Gd	d
�d
|�}Gdd�d||||�}|j|j||||||tf�dS)
Nc@seZdZdS)z<ClassPropertiesAndMethods.test_ex5_from_c3_switch.<locals>.AN)ryrzr{r7r7r7r8r��sr�c@seZdZdS)z<ClassPropertiesAndMethods.test_ex5_from_c3_switch.<locals>.BN)ryrzr{r7r7r7r8r��sr�c@seZdZdS)z<ClassPropertiesAndMethods.test_ex5_from_c3_switch.<locals>.CN)ryrzr{r7r7r7r8r|�sr|c@seZdZdS)z<ClassPropertiesAndMethods.test_ex5_from_c3_switch.<locals>.XN)ryrzr{r7r7r7r8r��sr�c@seZdZdS)z<ClassPropertiesAndMethods.test_ex5_from_c3_switch.<locals>.YN)ryrzr{r7r7r7r8r��sr�c@seZdZdS)z<ClassPropertiesAndMethods.test_ex5_from_c3_switch.<locals>.ZN)ryrzr{r7r7r7r8r��sr�)r�r=r)r2r�r�r|r�r�r�r7r7r8�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|j|||||tf�|j|j||||tf�|j|j||||||||tf	�dS)Nc@seZdZdS)z9ClassPropertiesAndMethods.test_monotonicity.<locals>.BoatN)ryrzr{r7r7r7r8�Boat�sr!c@seZdZdS)z<ClassPropertiesAndMethods.test_monotonicity.<locals>.DayBoatN)ryrzr{r7r7r7r8�DayBoat�sr"c@seZdZdS)z>ClassPropertiesAndMethods.test_monotonicity.<locals>.WheelBoatN)ryrzr{r7r7r7r8�	WheelBoat�sr#c@seZdZdS)z?ClassPropertiesAndMethods.test_monotonicity.<locals>.EngineLessN)ryrzr{r7r7r7r8�
EngineLess�sr$c@seZdZdS)zCClassPropertiesAndMethods.test_monotonicity.<locals>.SmallMultihullN)ryrzr{r7r7r7r8�SmallMultihull�sr%c@seZdZdS)zCClassPropertiesAndMethods.test_monotonicity.<locals>.PedalWheelBoatN)ryrzr{r7r7r7r8�PedalWheelBoat�sr&c@seZdZdS)zCClassPropertiesAndMethods.test_monotonicity.<locals>.SmallCatamaranN)ryrzr{r7r7r7r8�SmallCatamaran�sr'c@seZdZdS)z;ClassPropertiesAndMethods.test_monotonicity.<locals>.PedaloN)ryrzr{r7r7r7r8�Pedalo�sr()r�r=r)	r2r!r"r#r$r%r&r'r(r7r7r8�test_monotonicity�sz+ClassPropertiesAndMethods.test_monotonicityc	Cs�Gdd�dt�}Gdd�dt�}Gdd�dt�}Gdd�d||�}Gd	d
�d
||�}Gdd�d||�}|j|j||||||tf�dS)
Nc@seZdZdS)zAClassPropertiesAndMethods.test_consistency_with_epg.<locals>.PaneN)ryrzr{r7r7r7r8�Pane�sr*c@seZdZdS)zKClassPropertiesAndMethods.test_consistency_with_epg.<locals>.ScrollingMixinN)ryrzr{r7r7r7r8�ScrollingMixin�sr+c@seZdZdS)zIClassPropertiesAndMethods.test_consistency_with_epg.<locals>.EditingMixinN)ryrzr{r7r7r7r8�EditingMixin�sr,c@seZdZdS)zKClassPropertiesAndMethods.test_consistency_with_epg.<locals>.ScrollablePaneN)ryrzr{r7r7r7r8�ScrollablePane�sr-c@seZdZdS)zIClassPropertiesAndMethods.test_consistency_with_epg.<locals>.EditablePaneN)ryrzr{r7r7r7r8�EditablePane�sr.c@seZdZdS)zSClassPropertiesAndMethods.test_consistency_with_epg.<locals>.EditableScrollablePaneN)ryrzr{r7r7r7r8�EditableScrollablePane�sr/)r�r=r)r2r*r+r,r-r.r/r7r7r8�test_consistency_with_epg�sz3ClassPropertiesAndMethods.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 csny||�WnN|k
rZ}z2tj�rJt|�j|�sJ�jdt|�|f�WYdd}~XnX�jd|�dS)NzMessage %r, expected %rzExpected %s)r�check_impl_detailrr�r�)�exc�expected�callabler3�msg)r2r7r8�raises�s"z?ClassPropertiesAndMethods.test_mro_disagreement.<locals>.raisesc@seZdZdS)z:ClassPropertiesAndMethods.test_mro_disagreement.<locals>.AN)ryrzr{r7r7r7r8r��sr�c@seZdZdS)z:ClassPropertiesAndMethods.test_mro_disagreement.<locals>.BN)ryrzr{r7r7r7r8r��sr�c@seZdZdS)z:ClassPropertiesAndMethods.test_mro_disagreement.<locals>.CN)ryrzr{r7r7r7r8r|�sr|zduplicate base class Ar�c@seZdZdS)zCClassPropertiesAndMethods.test_mro_disagreement.<locals>.GridLayoutN)ryrzr{r7r7r7r8�
GridLayout�sr7c@seZdZdS)zGClassPropertiesAndMethods.test_mro_disagreement.<locals>.HorizontalGridN)ryrzr{r7r7r7r8�HorizontalGrid�sr8c@seZdZdS)zEClassPropertiesAndMethods.test_mro_disagreement.<locals>.VerticalGridN)ryrzr{r7r7r7r8�VerticalGrid�sr9c@seZdZdS)z?ClassPropertiesAndMethods.test_mro_disagreement.<locals>.HVGridN)ryrzr{r7r7r7r8�HVGrid�sr:c@seZdZdS)z?ClassPropertiesAndMethods.test_mro_disagreement.<locals>.VHGridN)ryrzr{r7r7r7r8�VHGrid�sr;ZConfusedGrid)r�rr?)r2Zmro_err_msgr6r�r�r|r7r8r9r:r;r7)r2r8�test_mro_disagreement�s$z/ClassPropertiesAndMethods.test_mro_disagreementcCs�t�}|j|jt�|jt|�t�t�}|j||�|j|d�y
d|_Wnttfk
rdYnX|j	d�|jt�d�Gdd�dt�}|�}|j|j
i�d|_|j|jd�|j|j
ddi�dS)Nr�r�z1object() should not allow setting a foo attributerAc@seZdZdS)z:ClassPropertiesAndMethods.test_object_class.<locals>.CdictN)ryrzr{r7r7r7r8�Cdict�sr=r])r�r=r�r?�assertNotEqualr�r��AttributeErrorrr�rA)r2r;rLr=r�r7r7r8�test_object_class�s$

z+ClassPropertiesAndMethods.test_object_classc
3Cs�Gdd�dtj�}tjd�}|j|jtjk�|jt|d��||_|j|j|k�|jt|d��tj|_|j|jtjk�|jt|d��Gdd�dt�}|jt��|d_WdQRXGdd	�d	t	�}|jt��|d
_WdQRXGdd�dt
�}|jt��|d_WdQRXGdd�dt�}|jt��|d_WdQRXGdd�dt�}|jt��|d_WdQRXGdd�dt
�}|jt��|f_WdQRXGdd�dt�}	|jt��|	t�_WdQRXdS)Nc@seZdZdZdS)zjClassPropertiesAndMethods.test_object_class_assignment_between_heaptypes_and_nonheaptypes.<locals>.SubTyper]N)ryrzr{r;r7r7r7r8�SubTypesrArGr;c@seZdZfZdS)zhClassPropertiesAndMethods.test_object_class_assignment_between_heaptypes_and_nonheaptypes.<locals>.MyIntN)ryrzr{r�r7r7r7r8�MyIntsrBr]c@seZdZfZdS)zjClassPropertiesAndMethods.test_object_class_assignment_between_heaptypes_and_nonheaptypes.<locals>.MyFloatN)ryrzr{r�r7r7r7r8�MyFloatsrCg�?c@seZdZfZdS)zlClassPropertiesAndMethods.test_object_class_assignment_between_heaptypes_and_nonheaptypes.<locals>.MyComplexN)ryrzr{r�r7r7r7r8�	MyComplex$srDy@c@seZdZfZdS)zhClassPropertiesAndMethods.test_object_class_assignment_between_heaptypes_and_nonheaptypes.<locals>.MyStrN)ryrzr{r�r7r7r7r8�MyStr)srEc@seZdZfZdS)zjClassPropertiesAndMethods.test_object_class_assignment_between_heaptypes_and_nonheaptypes.<locals>.MyBytesN)ryrzr{r�r7r7r7r8�MyBytes.srF�ac@seZdZfZdS)zjClassPropertiesAndMethods.test_object_class_assignment_between_heaptypes_and_nonheaptypes.<locals>.MyTupleN)ryrzr{r�r7r7r7r8�MyTuple3srHc@seZdZfZdS)znClassPropertiesAndMethods.test_object_class_assignment_between_heaptypes_and_nonheaptypes.<locals>.MyFrozenSetN)ryrzr{r�r7r7r7r8�MyFrozenSet8srIy�?@)rrr�r�r�rsr%rrr&r�r�bytes�tuple�	frozenset)
r2rArGrBrCrDrErFrHrIr7r7r8�?test_object_class_assignment_between_heaptypes_and_nonheaptypess>
zYClassPropertiesAndMethods.test_object_class_assignment_between_heaptypes_and_nonheaptypescHs�Gdd�dt�}|�}�j|d��j|d�Gdd�dt�}|�}�j|d��j|d�d|_�j|jd�d|_�j|jd�|`�j|d�Gd	d
�d
t�}|�}�j|d��j|d��j|d��j|d�d|_d
|_d|_�j|jd��j|jd
��j|jd�Gdd�dt�}|d�}�j|d��j|d��j|j�d�y
d|_Wntk
�rvYnX�j	d�yGdd�dt�}Wnt
k
�r�YnX�j	d�yGdd�dt�}Wnt
k
�r�YnX�j	d�yGdd�dt�}Wnt
k
�rYnX�j	d�yGdd�dt�}Wnt
k
�rNYnX�j	d�yGdd�dt�}Wnt
k
�r�YnX�j	d�Gd d�dt�}Gd!d�dt�}|�}d|_�j|jd�Gd"d�dt�}|�}d|_�j|jd�d;�G�fd$d�dt�}|�}d|_�j|jd��j
t�d%�t�yGd&d�dt�}Wnt
tfk
�rhYnX�j	d'�G�fd(d)�d)t��Gd*d�dt�}|�}��|_��|_��|_�j�jd�~tj��j�jd%�Gd+d,�d,|�}|�}��|_��|_�j�jd
�~tj��j�jd%�Gd-d.�d.|�}	|	�}��|_��|_��|_�j�jd�~tj��j�jd%�Gd/d0�d0t�}
|
�}��|g|_�j�jd�d}tj��j�jd%�ttd1��r(Gd2d3�d3t�}|�}
ttj��}xtd4�D]}|
|
k�q�Wttj��}�j||�G�fd5d6�d6t�}tjd7��}|�}~WdQRX�j|j�d8�Gd9d:�d:t�}�jt��|�`WdQRXdS)<Nc@seZdZgZdS)z0ClassPropertiesAndMethods.test_slots.<locals>.C0N)ryrzr{r�r7r7r7r8�C0?srNrAr�c@seZdZdgZdS)z0ClassPropertiesAndMethods.test_slots.<locals>.C1r;N)ryrzr{r�r7r7r7r8�C1EsrOr;r]c@seZdZdddgZdS)z0ClassPropertiesAndMethods.test_slots.<locals>.C3r;rLrPN)ryrzr{r�r7r7r7r8�C3QsrPrLrPr^r_c@s"eZdZdgZdd�Zdd�ZdS)z0ClassPropertiesAndMethods.test_slots.<locals>.C4�__acSs
||_dS)N)�_C4__a)r2r�r7r7r8r,bsz9ClassPropertiesAndMethods.test_slots.<locals>.C4.__init__cSs|jS)N)rR)r2r7r7r8r�dsz4ClassPropertiesAndMethods.test_slots.<locals>.C4.getN)ryrzr{r�r,r�r7r7r7r8�C4_srSrerQrfz$Double underscored names not mangledc@seZdZdgZdS)z/ClassPropertiesAndMethods.test_slots.<locals>.CN)ryrzr{r�r7r7r7r8r|ssr|z[None] slots not caughtc@seZdZdgZdS)z/ClassPropertiesAndMethods.test_slots.<locals>.Czfoo barN)ryrzr{r�r7r7r7r8r|zsz['foo bar'] slots not caughtc@seZdZdgZdS)z/ClassPropertiesAndMethods.test_slots.<locals>.CzfoobarN)ryrzr{r�r7r7r7r8r|�sz['foo\0bar'] slots not caughtc@seZdZdgZdS)z/ClassPropertiesAndMethods.test_slots.<locals>.C�1N)ryrzr{r�r7r7r7r8r|�sz['1'] slots not caughtc@seZdZdgZdS)z/ClassPropertiesAndMethods.test_slots.<locals>.Cr}N)ryrzr{r�r7r7r7r8r|�sz[''] slots not caughtc@seZdZddddgZdS)z/ClassPropertiesAndMethods.test_slots.<locals>.Cr;Za_bZ_aZA0123456789ZN)ryrzr{r�r7r7r7r8r|�sc@seZdZdZdS)z/ClassPropertiesAndMethods.test_slots.<locals>.C�abcN)ryrzr{r�r7r7r7r8r|�sc@seZdZdZdS)z/ClassPropertiesAndMethods.test_slots.<locals>.CrUN)ryrzr{r�r7r7r7r8r|�sr�cseZdZ�ZdS)z/ClassPropertiesAndMethods.test_slots.<locals>.CN)ryrzr{r�r7)�slotsr7r8r|�src@seZdZed�gZdS)z/ClassPropertiesAndMethods.test_slots.<locals>.C�N)ryrzr{�chrr�r7r7r7r8r|�szhr(128)] slots not caughtcs(eZdZdZ�fdd�Z�fdd�ZdS)z5ClassPropertiesAndMethods.test_slots.<locals>.Countedrcs�jd7_dS)Nr])r�)r2)�Countedr7r8r,�sz>ClassPropertiesAndMethods.test_slots.<locals>.Counted.__init__cs�jd8_dS)Nr])r�)r2)rYr7r8�__del__�sz=ClassPropertiesAndMethods.test_slots.<locals>.Counted.__del__N)ryrzr{r�r,rZr7)rYr7r8rY�srYc@seZdZdddgZdS)z/ClassPropertiesAndMethods.test_slots.<locals>.Cr;rLrPN)ryrzr{r�r7r7r7r8r|�sc@seZdZdS)z/ClassPropertiesAndMethods.test_slots.<locals>.DN)ryrzr{r7r7r7r8r��sr�c@seZdZdgZdS)z/ClassPropertiesAndMethods.test_slots.<locals>.E�eN)ryrzr{r�r7r7r7r8r��sr�c@seZdZddgZdS)z/ClassPropertiesAndMethods.test_slots.<locals>.Fr;rLN)ryrzr{r�r7r7r7r8r�sr�get_objectsc@seZdZdd�ZdS)z/ClassPropertiesAndMethods.test_slots.<locals>.GcSsdS)NFr7)r2rxr7r7r8�__eq__�sz6ClassPropertiesAndMethods.test_slots.<locals>.G.__eq__N)ryrzr{r]r7r7r7r8r�srr�cs(eZdZddgZdd�Z�fdd�ZdS)z/ClassPropertiesAndMethods.test_slots.<locals>.Hr;rLcSsd|_d|_dS)Nr]r^)r;rL)r2r7r7r8r,�sz8ClassPropertiesAndMethods.test_slots.<locals>.H.__init__cs �j|jd��j|jd�dS)Nr]r^)r=r;rL)�self_)r2r7r8rZ�sz7ClassPropertiesAndMethods.test_slots.<locals>.H.__del__N)ryrzr{r�r,rZr7)r2r7r8�H�sr_�stderrr}c@seZdZdZdS)z/ClassPropertiesAndMethods.test_slots.<locals>.Xr;N)ryrzr{r�r7r7r7r8r�sr�)r�r�)r�r�r;r=rLrPr�Z_ClassPropertiesAndMethods__ar?r�rrUr�r�r?r�UnicodeEncodeErrorr�r�
gc_collect�zr[rs�gcr�r\r�Zcaptured_output�getvaluer)r2rNr�rOrPrSr|rPr�r�r�sr�gZorig_objectsrpZnew_objectsr_�hr�r7)rYr2rVr8�
test_slots=s







z$ClassPropertiesAndMethods.test_slotsc
Cs2Gdd�dt�}|�}|j|d�|j|d�d|_|j|jddi�Gdd�dt�}|�}|j|d�|j|d�y
d|_Wntk
r�YnX|jd	�Gd
d�d||�}|�}|j|d�|j|d�d|_|j|jddi�Gdd
�d
||�}|�}|j|d�|j|d�d|_|j|jddi�dS)Nc@seZdZdgZdS)z7ClassPropertiesAndMethods.test_slots_special.<locals>.DrAN)ryrzr{r�r7r7r7r8r�	sr�rA�__weakref__r�r�c@seZdZdgZdS)z7ClassPropertiesAndMethods.test_slots_special.<locals>.WrjN)ryrzr{r�r7r7r7r8�Wsrkz!shouldn't be allowed to set a.fooc@seZdZgZdS)z8ClassPropertiesAndMethods.test_slots_special.<locals>.C1N)ryrzr{r�r7r7r7r8rOsrOc@seZdZgZdS)z8ClassPropertiesAndMethods.test_slots_special.<locals>.C2N)ryrzr{r�r7r7r7r8r�%sr�)r�r�r�r�r=rAr?r�)r2r�r;rkrOr�r7r7r8�test_slots_specials6

z,ClassPropertiesAndMethods.test_slots_specialcCs`ddl}Gdd�d|jd�}Gdd�dt�}|j|�|�}|j||�|jt|jj|d�dS)Nrc@seZdZdZdS)z>ClassPropertiesAndMethods.test_slots_descriptor.<locals>.MyABCr;N)ryrzr{r�r7r7r7r8�MyABC1srm)r�c@seZdZdS)zBClassPropertiesAndMethods.test_slots_descriptor.<locals>.UnrelatedN)ryrzr{r7r7r7r8�	Unrelated4srnr_)	rU�ABCMetar��registerr�rrr;�__set__)r2rUrmrn�ur7r7r8�test_slots_descriptor-s
z/ClassPropertiesAndMethods.test_slots_descriptorc
CsJGdd�dt�}Gdd�d|�}Gdd�d|�}d|_|j|jd�|j|jd�|j|jd�Gdd	�d	t�}|�}|j|d
�d|_|j|jd�dd
�|_|j|j�d�dd
�|_|jt|�d�dd
�|_|jt	|�d�|j|jd�|j|d�dd�}||_
|j|jd�d|_|j|jd�dd�}||_
y
d|_Wntk
�r\YnX|jd�|j|jd�Gdd�d|�}|�}d|_|j|jd�Gdd�dt	�}	|jd|	d�d�|j|	d�dd�|jd|	d �d!�|j|	d �dd!�|j|	d �|	d�d!�Gd"d#�d#t�}
Gd$d%�d%|
d&�}|j|t�dS)'Nc@seZdZdS)z2ClassPropertiesAndMethods.test_dynamics.<locals>.DN)ryrzr{r7r7r7r8r�@sr�c@seZdZdS)z2ClassPropertiesAndMethods.test_dynamics.<locals>.EN)ryrzr{r7r7r7r8r�Bsr�c@seZdZdS)z2ClassPropertiesAndMethods.test_dynamics.<locals>.FN)ryrzr{r7r7r7r8rDsrr]c@seZdZdS)z2ClassPropertiesAndMethods.test_dynamics.<locals>.CN)ryrzr{r7r7r7r8r|Lsr|�foobarr^cSsdS)Nr�r7)r2r7r7r8�<lambda>Rsz9ClassPropertiesAndMethods.test_dynamics.<locals>.<lambda>r�cSsdS)NzC()r7)r2r7r7r8ruTszC()cSsdS)Nrvr7)r2r7r7r8ruVsrvr�cSs|dkrdSt�dS)Nr�)r?)r2r5r7r7r8�	mygetattrZsz:ClassPropertiesAndMethods.test_dynamics.<locals>.mygetattrr�cSs|dkrt�tj|||�S)Nr�)r?r�r)r2r5r�r7r7r8�	mysetattrbsz:ClassPropertiesAndMethods.test_dynamics.<locals>.mysetattrznot spamzexpected AttributeErrorc@seZdZdS)z2ClassPropertiesAndMethods.test_dynamics.<locals>.DN)ryrzr{r7r7r7r8r�nsc@seZdZdS)z2ClassPropertiesAndMethods.test_dynamics.<locals>.IN)ryrzr{r7r7r7r8�Iusrxr;Zaar_rfc@seZdZdS)zAClassPropertiesAndMethods.test_dynamics.<locals>.dynamicmetaclassN)ryrzr{r7r7r7r8�dynamicmetaclass~sryc@seZdZdS)z:ClassPropertiesAndMethods.test_dynamics.<locals>.someclassN)ryrzr{r7r7r7r8�	someclass�srz)r�)r�r�r=r�rt�methodrnrmrr%�__getattr__r��newrr?r�r?r>)r2r�r�rr|r;rvrwrErxryrzr7r7r8�
test_dynamics>s\




z'ClassPropertiesAndMethods.test_dynamicsc3Cs�yGdd�dtt�}Wntk
r*YnX|jd�yGdd�dtd�}Wntk
r`YnX|jd�Gdd�d�}yGdd�dtt��}Wntk
r�YnX|jd	�yGd
d�dt�}Wntk
r�YnX|jd�yGdd�dt�}Wntk
�rYnX|jd
�Gdd�dt�}Gdd�dt�}Gdd�dt|d�}Gdd�dt|d�}yGdd�d||�}Wntk
�r�YnX|jd�dS)Nc@seZdZdS)z0ClassPropertiesAndMethods.test_errors.<locals>.CN)ryrzr{r7r7r7r8r|�sr|z5inheritance from both list and dict should be illegalc@seZdZdS)z0ClassPropertiesAndMethods.test_errors.<locals>.CN)ryrzr{r7r7r7r8r|�sz+inheritance from non-type should be illegalc@seZdZdS)z6ClassPropertiesAndMethods.test_errors.<locals>.ClassicN)ryrzr{r7r7r7r8�Classic�src@seZdZdS)z0ClassPropertiesAndMethods.test_errors.<locals>.CN)ryrzr{r7r7r7r8r|�sz,inheritance from CFunction should be illegalc@seZdZdZdS)z0ClassPropertiesAndMethods.test_errors.<locals>.Cr]N)ryrzr{r�r7r7r7r8r|�sz__slots__ = 1 should be illegalc@seZdZdgZdS)z0ClassPropertiesAndMethods.test_errors.<locals>.Cr]N)ryrzr{r�r7r7r7r8r|�sz!__slots__ = [1] should be illegalc@seZdZdS)z1ClassPropertiesAndMethods.test_errors.<locals>.M1N)ryrzr{r7r7r7r8r��sr�c@seZdZdS)z1ClassPropertiesAndMethods.test_errors.<locals>.M2N)ryrzr{r7r7r7r8r��sr�c@seZdZdS)z1ClassPropertiesAndMethods.test_errors.<locals>.A1N)ryrzr{r7r7r7r8�A1�sr�)r�c@seZdZdS)z1ClassPropertiesAndMethods.test_errors.<locals>.A2N)ryrzr{r7r7r7r8�A2�sr�c@seZdZdS)z0ClassPropertiesAndMethods.test_errors.<locals>.BN)ryrzr{r7r7r7r8r��sr�z5finding the most derived metaclass should have failed)r.rlrr�r�r?r�)r2r|rr�r�r�r�r�r7r7r8�test_errors�sF




z%ClassPropertiesAndMethods.test_errorsc	s&Gdd�dt�}|�}|j|jd�|df�|j|jd�|df�|j|jd�|df�Gdd�d|�}|�}|j|jd�|df�|j|jd�|df�|j|jd�|df�|j|j|d�|df�dd�}t|�}|j|jdt�d	�td	f�|j|jd�d	�td	f�|j|jj|�|j|jj|�|jt||�jj|�|jt||�jj|�|jt||�j�|f�|jt||�j�|f�td�jd�}|j	t
|�yt|dd
�Wnt
k
�r�YnX|jd�t|�}|j|ji�d	|_
|j|j
d	�|j|jdd	i�|`
|j|d�dS)
Nc@seZdZdd�Zee�ZdS)z6ClassPropertiesAndMethods.test_classmethods.<locals>.CcWs|S)Nr7)r;r7r7r8r��sz:ClassPropertiesAndMethods.test_classmethods.<locals>.C.fooN)ryrzr{r�r��goor7r7r7r8r|�sr|r]c@seZdZdS)z6ClassPropertiesAndMethods.test_classmethods.<locals>.DN)ryrzr{r7r7r7r8r��sr�cSs||fS)Nr7)r��argr7r7r8�f�sz6ClassPropertiesAndMethods.test_classmethods.<locals>.frr�)r�z)classmethod shouldn't accept keyword argsr�)r�r=r�r�r�r�r%�__self__r�rrr�rAr�r�)	r2r|rPr�rEr�ZffrD�cm)r�r7r8�test_classmethods�sF
z+ClassPropertiesAndMethods.test_classmethodscCsPtjtd�}td�}|�}xtd�D]}|jd�q$W|j|�|ddd�dS)N�gettotalrefcountrvrr�)�delta)r�
get_attributerr�r�r,�assertAlmostEqual)r2r�r��refs_beforerpr7r7r8�%test_refleaks_in_classmethod___init__�sz?ClassPropertiesAndMethods.test_refleaks_in_classmethod___init__z"the module 'xxsubtype' is internalcCs�ddl}d
}ddi}|jj||�\}}}|j||j�|j||�|j||�|j�j||�\}}}|j||j�|j||�|j||�|jjd}||jf|�|�\}}	}
|j||j�|j|	|�|j|
|�Gdd	�d	|j�}||f|�|�\}}	}
|j||�|j|	|�|j|
|�|jt��|�WdQRX|jt��||j��WdQRX|jt��|t�WdQRXdS)Nrr]r^r_rU�{�	classmethc@seZdZdS)zAClassPropertiesAndMethods.test_classmethods_in_c.<locals>.SubSpamN)ryrzr{r7r7r7r8�SubSpamsr�)r]r^r_)r�r�r�r=rArrr.)r2r�r;rEr�r��d1Zspam_cmZx2r��d2r�r7r7r8�test_classmethods_in_c�s6z0ClassPropertiesAndMethods.test_classmethods_in_ccCsGdd�dt�}|�}|j|jd�d�|j|jd�d	�|j|jd�|df�Gdd�d|�}|�}|j|jd�d
�|j|jd�d�|j|jd�|df�|j|j|d�|df�td�}|j|ji�d|_|j|jd�|j|jddi�|`|j|d�dS)Nc@seZdZdd�Zee�ZdS)z7ClassPropertiesAndMethods.test_staticmethods.<locals>.CcWs|S)Nr7)r;r7r7r8r�sz;ClassPropertiesAndMethods.test_staticmethods.<locals>.C.fooN)ryrzr{r�r�r�r7r7r7r8r|sr|r]c@seZdZdS)z7ClassPropertiesAndMethods.test_staticmethods.<locals>.DN)ryrzr{r7r7r7r8r�#sr�r�r�)r])r])r])r])r�r=r�r�r�rAr�r�)r2r|rPr�rE�smr7r7r8�test_staticmethodss$z,ClassPropertiesAndMethods.test_staticmethodscCsPtjtd�}td�}|�}xtd�D]}|jd�q$W|j|�|ddd�dS)Nr�rvrr�)r�)rr�rr�r�r,r�)r2r�r�r�rpr7r7r8�&test_refleaks_in_staticmethod___init__2sz@ClassPropertiesAndMethods.test_refleaks_in_staticmethod___init__cCs�ddl}d}ddi}|jj||�\}}}|j|d�|j||�|j||�|j�j||�\}}}|j|d�|j||�|j||�dS)Nrr]r^r_rUr�)r]r^r_)r�r�Z
staticmethr=)r2r�r;rEr�r�r�r�r7r7r8�test_staticmethods_in_c;sz1ClassPropertiesAndMethods.test_staticmethods_in_ccsGdd�d����}|j�jd��df�|j|jd��df�|j|jd�|df�Gdd�d��}|�}|j|jd�|df�|j|jd�|df�|j|jd�|df�|j|j|d�|df�G�fdd�d�}|j|�jj�j�|jt�jj����jd��dS)	Nc@seZdZdd�Zee�ZdS)z1ClassPropertiesAndMethods.test_classic.<locals>.CcWs|S)Nr7)r;r7r7r8r�Msz5ClassPropertiesAndMethods.test_classic.<locals>.C.fooN)ryrzr{r�r�r�r7r7r7r8r|Lsr|r]c@seZdZdS)z1ClassPropertiesAndMethods.test_classic.<locals>.DN)ryrzr{r7r7r7r8r�Ssr�cseZdZ�jZdS)z1ClassPropertiesAndMethods.test_classic.<locals>.EN)ryrzr{r�r7)r|r7r8r�Zsr�z<bound method )r=r�r��__func__r�rmr�r�)r2rPr�rEr�r7)r|r8�test_classicJsz&ClassPropertiesAndMethods.test_classiccCshGdd�dt�}|�}|j|jd�|j|jd�d|_|j|jd�|j|jd�|`|j|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||_||_||_dS)N)�_computed_attribute__get�_computed_attribute__set�_computed_attribute__delete)r2r�r��deleter7r7r8r,cszNClassPropertiesAndMethods.test_compattr.<locals>.C.computed_attribute.__init__cSs
|j|�S)N)r�)r2r�r?r7r7r8r�gszMClassPropertiesAndMethods.test_compattr.<locals>.C.computed_attribute.__get__cSs|j||�S)N)r�)r2r�r�r7r7r8rqiszMClassPropertiesAndMethods.test_compattr.<locals>.C.computed_attribute.__set__cSs
|j|�S)N)r�)r2r�r7r7r8�
__delete__kszPClassPropertiesAndMethods.test_compattr.<locals>.C.computed_attribute.__delete__)NN)N)ryrzr{r,r�rqr�r7r7r7r8�computed_attributebs

r�cSs
d|_dS)Nr)�_C__x)r2r7r7r8r,msz;ClassPropertiesAndMethods.test_compattr.<locals>.C.__init__cSs|j}|d|_|S)Nr])r�)r2r�r7r7r8Z__get_xos
z:ClassPropertiesAndMethods.test_compattr.<locals>.C.__get_xcSs
||_dS)N)r�)r2r�r7r7r8Z__set_xssz:ClassPropertiesAndMethods.test_compattr.<locals>.C.__set_xcSs|`dS)N)r�)r2r7r7r8Z
__delete_xusz=ClassPropertiesAndMethods.test_compattr.<locals>.C.__delete_xN)
ryrzr{r�r�r,Z	_C__get_xZ	_C__set_xZ_C__delete_xr�r7r7r7r8r|asr|rr]r��r�)r�r=r�r�)r2r|r;r7r7r8�
test_compattr_sz'ClassPropertiesAndMethods.test_compattrcCshGdd�dt�}|�}|j|jd�|j|j|�Gdd�d|�}|�}|j|jd�|j|j|�dS)Nc@seZdZdd�Zdd�ZdS)z2ClassPropertiesAndMethods.test_newslots.<locals>.CcSstj|�}d|_|S)Nr])r.r�r�)r�r2r7r7r8r��s
z:ClassPropertiesAndMethods.test_newslots.<locals>.C.__new__cSs|jd|_dS)Nr^)r�)r2r7r7r8r,�sz;ClassPropertiesAndMethods.test_newslots.<locals>.C.__init__N)ryrzr{r�r,r7r7r7r8r|�sr|r_c@seZdZdS)z2ClassPropertiesAndMethods.test_newslots.<locals>.DN)ryrzr{r7r7r7r8r��sr�)r.r=r�r�)r2r|r;r�rLr7r7r8�
test_newslots�sz'ClassPropertiesAndMethods.test_newslotscCsz|jttj�|jttjd�|jttjt�|jttjt�Gdd�dt�}|jt|�Gdd�dt�}|jt|�dS)Nr}c@seZdZejZdS)z1ClassPropertiesAndMethods.test_bad_new.<locals>.CN)ryrzr{r.r�r7r7r7r8r|�sr|c@seZdZejZdS)z1ClassPropertiesAndMethods.test_bad_new.<locals>.CN)ryrzr{r�r�r7r7r7r8r|�s)rrr�r�r.)r2r|r7r7r8�test_bad_new�sz&ClassPropertiesAndMethods.test_bad_newcCs4Gdd�dt�}tj|�|jttj|d�tj|��|jttj|�d�Gdd�dt�}tj|�tj|d�tj|d��|jttj|d�d�Gdd�dt�}tj|�|jttj|d�tj|d��tj|d�d�Gdd�dt�}tj|�|jttj|d�tj|d��|jttj|d�d�dS)Nc@seZdZdS)z4ClassPropertiesAndMethods.test_object_new.<locals>.AN)ryrzr{r7r7r7r8r��sr�rec@seZdZdd�ZdS)z4ClassPropertiesAndMethods.test_object_new.<locals>.AcSs
||_dS)N)r�)r2r�r7r7r8r,�sz=ClassPropertiesAndMethods.test_object_new.<locals>.A.__init__N)ryrzr{r,r7r7r7r8r��sr_c@seZdZdd�ZdS)z4ClassPropertiesAndMethods.test_object_new.<locals>.AcSs
tj|�S)N)r�r�)r�r�r7r7r8r��sz<ClassPropertiesAndMethods.test_object_new.<locals>.A.__new__N)ryrzr{r�r7r7r7r8r��sc@seZdZdd�Zdd�ZdS)z4ClassPropertiesAndMethods.test_object_new.<locals>.AcSs
tj|�S)N)r�r�)r�r�r7r7r8r��sz<ClassPropertiesAndMethods.test_object_new.<locals>.A.__new__cSs
||_dS)N)r�)r2r�r7r7r8r,�sz=ClassPropertiesAndMethods.test_object_new.<locals>.A.__init__N)ryrzr{r�r,r7r7r7r8r��s)r�r�rrr,)r2r�r7r7r8�test_object_new�s(



z)ClassPropertiesAndMethods.test_object_newcCs�Gdd�dt�}|jt|�Gdd�d|�}tj��tjdt�|d�}WdQRX|j|jd�|j|j	|�|`
|jt|�|`
tj��tjdt�|d�}WdQRX|j|jd�|j|j	|�dS)Nc@seZdZdd�ZdS)z=ClassPropertiesAndMethods.test_restored_object_new.<locals>.Ac_st�dS)N)�AssertionError)r�r3r4r7r7r8r��szEClassPropertiesAndMethods.test_restored_object_new.<locals>.A.__new__N)ryrzr{r�r7r7r7r8r��sr�c@seZdZejZdd�ZdS)z=ClassPropertiesAndMethods.test_restored_object_new.<locals>.BcSs
||_dS)N)r�)r2r�r7r7r8r,�szFClassPropertiesAndMethods.test_restored_object_new.<locals>.B.__init__N)ryrzr{r�r�r,r7r7r7r8r��sr��errorr_)r�rr��warnings�catch_warnings�simplefilter�DeprecationWarningr=r�r�r�)r2r�r�rLr7r7r8�test_restored_object_new�s 

z2ClassPropertiesAndMethods.test_restored_object_newc	Cs�Gdd�dt�}Gdd�d|�}Gdd�d|�}Gdd�d||�}|j|j�||||tg�|j|j||||tf�|j|�j�d�Gd	d
�d
t�}Gdd�d|||||d
�}|j|jt|||||f�|j|�j�d�y:Gdd�dt�}Gdd�dt|d
�}tj|�}d|d<Wntk
�r,YnX|jd�y(Gdd�dt�}Gdd�dt|d
�}Wntk
�rvYnX|jd�y(Gdd�dt�}Gdd�dt|d
�}Wntk
�r�YnX|jd�dS)Nc@seZdZdd�ZdS)z0ClassPropertiesAndMethods.test_altmro.<locals>.AcSsdS)Nr�r7)r2r7r7r8r��sz2ClassPropertiesAndMethods.test_altmro.<locals>.A.fN)ryrzr{r�r7r7r7r8r��sr�c@seZdZdS)z0ClassPropertiesAndMethods.test_altmro.<locals>.BN)ryrzr{r7r7r7r8r��sr�c@seZdZdd�ZdS)z0ClassPropertiesAndMethods.test_altmro.<locals>.CcSsdS)Nr|r7)r2r7r7r8r��sz2ClassPropertiesAndMethods.test_altmro.<locals>.C.fN)ryrzr{r�r7r7r7r8r|�sr|c@seZdZdS)z0ClassPropertiesAndMethods.test_altmro.<locals>.DN)ryrzr{r7r7r7r8r��sr�c@seZdZdd�ZdS)z?ClassPropertiesAndMethods.test_altmro.<locals>.PerverseMetaTypecSstj|�}|j�|S)N)r?�mro�reverse)r��Lr7r7r8r��s
zCClassPropertiesAndMethods.test_altmro.<locals>.PerverseMetaType.mroN)ryrzr{r�r7r7r7r8�PerverseMetaType�sr�c@seZdZdS)z0ClassPropertiesAndMethods.test_altmro.<locals>.XN)ryrzr{r7r7r7r8r��sr�)r�c@seZdZdd�ZdS)z9ClassPropertiesAndMethods.test_altmro.<locals>._metaclasscSs
|ttgS)N)rlr�)r2r7r7r8r��sz=ClassPropertiesAndMethods.test_altmro.<locals>._metaclass.mroN)ryrzr{r�r7r7r7r8r��sr�c@seZdZdS)z0ClassPropertiesAndMethods.test_altmro.<locals>.XN)ryrzr{r7r7r7r8r��srfrezdevious mro() return not caughtc@seZdZdd�ZdS)z9ClassPropertiesAndMethods.test_altmro.<locals>._metaclasscSsdgS)Nr]r7)r2r7r7r8r�sz=ClassPropertiesAndMethods.test_altmro.<locals>._metaclass.mroN)ryrzr{r�r7r7r7r8r�sc@seZdZdS)z0ClassPropertiesAndMethods.test_altmro.<locals>.XN)ryrzr{r7r7r7r8r�	sz!non-class mro() return not caughtc@seZdZdd�ZdS)z9ClassPropertiesAndMethods.test_altmro.<locals>._metaclasscSsdS)Nr]r7)r2r7r7r8r�sz=ClassPropertiesAndMethods.test_altmro.<locals>._metaclass.mroN)ryrzr{r�r7r7r7r8r�sc@seZdZdS)z0ClassPropertiesAndMethods.test_altmro.<locals>.XN)ryrzr{r7r7r7r8r�sz$non-sequence mro() return not caught)	r�r=r�rr�r?r�rr�)	r2r�r�r|r�r�r�r�r�r7r7r8�test_altmro�s>


z%ClassPropertiesAndMethods.test_altmrocs�Gdd�dt��G�fdd�d��}|�}|j|jd�d|_|j|jd
�|`|j|jd�|j|dd�d	|d<|j|jd�|d=|j|jd�|j|d
d�dtd
d�f�d|d
d�<|j|jtd
d�df�|d
d�=|j|jtd
d��dS)Nc@seZdZdS)z5ClassPropertiesAndMethods.test_overloading.<locals>.BN)ryrzr{r7r7r7r8r�sr�csDeZdZdd�Z�fdd�Z�fdd�Zdd�Zd	d
�Zdd�Zd
S)z5ClassPropertiesAndMethods.test_overloading.<locals>.CcSs|dkrd|fSt�dS)Nr�r@)r?)r2r5r7r7r8r|"szAClassPropertiesAndMethods.test_overloading.<locals>.C.__getattr__cs&|dkr||f|_n�j|||�SdS)Nr�)r�r)r2r5r�)r�r7r8r'szAClassPropertiesAndMethods.test_overloading.<locals>.C.__setattr__cs |dkr||_n�j||�SdS)Nr�)rr
)r2r5)r�r7r8r
,szAClassPropertiesAndMethods.test_overloading.<locals>.C.__delattr__cSsd|fS)N�getitemr7)r2r�r7r7r8rO2szAClassPropertiesAndMethods.test_overloading.<locals>.C.__getitem__cSs||f|_dS)N)�setitem)r2r�r�r7r7r8rY4szAClassPropertiesAndMethods.test_overloading.<locals>.C.__setitem__cSs
||_dS)N)�delitem)r2r�r7r7r8�__delitem__6szAClassPropertiesAndMethods.test_overloading.<locals>.C.__delitem__N)	ryrzr{r|rr
rOrYr�r7)r�r7r8r|!sr|r@r�r�r��rr�)r@r�)r�r�)r�r�)r�r�)r�r=r�r�rr�r�rQ)r2r|r;r7)r�r8�test_overloadings$
z*ClassPropertiesAndMethods.test_overloadingcs�Gdd�dt���d��|j�j�d�G��fdd�d��}|d�}|j|j�d�|j|j�d�|j|j�d�G�fdd�dt�}|j|�jj�j�|jt�jj�d���j	d	��dS)
Nc@seZdZdd�Zdd�ZdS)z1ClassPropertiesAndMethods.test_methods.<locals>.CcSs
||_dS)N)r�)r2r�r7r7r8r,Osz:ClassPropertiesAndMethods.test_methods.<locals>.C.__init__cSs|jS)N)r�)r2r7r7r8r�Qsz5ClassPropertiesAndMethods.test_methods.<locals>.C.fooN)ryrzr{r,r�r7r7r7r8r|Nsr|r]cseZdZ�jZ�jZdS)z1ClassPropertiesAndMethods.test_methods.<locals>.DN)ryrzr{r�rr�r7)r|�c1r7r8r�Usr�r^cseZdZ�jZdS)z1ClassPropertiesAndMethods.test_methods.<locals>.EN)ryrzr{r�r7)r|r7r8r�\sr�z<bound method )
r�r=r�rr�r�r�rmr�r�)r2r�r�r�r7)r|r�r8�test_methodsLsz&ClassPropertiesAndMethods.test_methodscs�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�}�x|D�]\}}}�}Gd8d9�d9|�}x"|j�D]\}}t|||��qWt|||�||��g�Gd:d9�d9|�}x"|j�D]\}}t|||��qTWt||||��||���j�d;g|�Gd<d9�d9|�}x"|j�D]\}}t|||��q�Wt|||���j�||���q�WdS)@Nc	Ss|�WdQRXdS)Nr7)Zmanagerr7r7r8�run_contexteszIClassPropertiesAndMethods.test_special_method_lookup.<locals>.run_contextcSs|S)Nr7)r2r7r7r8�idenhszBClassPropertiesAndMethods.test_special_method_lookup.<locals>.idencSsdS)Nshellor7)r2r7r7r8rjszCClassPropertiesAndMethods.test_special_method_lookup.<locals>.hellocSsgS)Nr7)r2r7r7r8�	empty_seqlszGClassPropertiesAndMethods.test_special_method_lookup.<locals>.empty_seqcSsdS)Nrr7)r2r7r7r8�zeronszBClassPropertiesAndMethods.test_special_method_lookup.<locals>.zerocSsdS)Ny�?r7)r2r7r7r8�complex_numpszIClassPropertiesAndMethods.test_special_method_lookup.<locals>.complex_numcSst�dS)N)�
StopIteration)r2r7r7r8r�rszBClassPropertiesAndMethods.test_special_method_lookup.<locals>.stopcSsdS)NTr7)r2�thingr7r7r8�return_truetszIClassPropertiesAndMethods.test_special_method_lookup.<locals>.return_truecSs
tt|�S)N)r�r%)r�r7r7r8�
do_isinstancevszKClassPropertiesAndMethods.test_special_method_lookup.<locals>.do_isinstancecSs
tt|�S)N)r�r%)r�r7r7r8�
do_issubclassxszKClassPropertiesAndMethods.test_special_method_lookup.<locals>.do_issubclasscs*Gdd�d|jt�}�j|�dd�dS)Nc@seZdZdS)z^ClassPropertiesAndMethods.test_special_method_lookup.<locals>.do_dict_missing.<locals>.DictSubN)ryrzr{r7r7r7r8�DictSub{sr��hira)r�rlr=)Zcheckerr�)r2r7r8�do_dict_missingzszMClassPropertiesAndMethods.test_special_method_lookup.<locals>.do_dict_missingcs�j|d�dS)Nr�ra)r=)r^r�)r2r7r8�some_number~szIClassPropertiesAndMethods.test_special_method_lookup.<locals>.some_numbercWsdS)Nr7)r3r7r7r8�swallow�szEClassPropertiesAndMethods.test_special_method_lookup.<locals>.swallowcSsdS)Nrr7)r2�specr7r7r8�format_impl�szIClassPropertiesAndMethods.test_special_method_lookup.<locals>.format_impl�	__bytes__�__reversed__�__length_hint__)rk�__next__�
__sizeof__�__instancecheck__�__missing__r��__subclasscheck__rB�	__enter__�__exit__�__complex__�
__format__�	__floor__�	__trunc__�__ceil__�__dir__�	__round__cs(eZdZ�fdd�Z�f�fdd�	ZdS)zEClassPropertiesAndMethods.test_special_method_lookup.<locals>.CheckercSs|jdj|��dS)Nz__getattr__ called with {0})r��format)r2�attr�testr7r7r8r|�szQClassPropertiesAndMethods.test_special_method_lookup.<locals>.Checker.__getattr__cs$|�kr|jdj|��tj||�S)Nz __getattribute__ called with {0})r�r�r�r	)r2r�r�)�okr7r8r	�szVClassPropertiesAndMethods.test_special_method_lookup.<locals>.Checker.__getattribute__N)ryrzr{r|r	r7)r�r2r7r8�Checker�sr�cs eZdZdd�Z�fdd�ZdS)zJClassPropertiesAndMethods.test_special_method_lookup.<locals>.SpecialDescrcSs
||_dS)N)�impl)r2r�r7r7r8r,�szSClassPropertiesAndMethods.test_special_method_lookup.<locals>.SpecialDescr.__init__cs�jd�|jj||�S)Nr])rir�r�)r2r��owner)�recordr7r8r��s
zRClassPropertiesAndMethods.test_special_method_lookup.<locals>.SpecialDescr.__get__N)ryrzr{r,r�r7)r�r7r8�SpecialDescr�sr�c@seZdZdS)zIClassPropertiesAndMethods.test_special_method_lookup.<locals>.MyExceptionN)ryrzr{r7r7r7r8�MyException�sr�cseZdZ�fdd�ZdS)zFClassPropertiesAndMethods.test_special_method_lookup.<locals>.ErrDescrcs��dS)Nr7)r2r�r�)r�r7r8r��szNClassPropertiesAndMethods.test_special_method_lookup.<locals>.ErrDescr.__get__N)ryrzr{r�r7)r�r7r8�ErrDescr�sr�c@seZdZdS)z?ClassPropertiesAndMethods.test_special_method_lookup.<locals>.XN)ryrzr{r7r7r7r8r��sr�c@seZdZdS)z?ClassPropertiesAndMethods.test_special_method_lookup.<locals>.XN)ryrzr{r7r7r7r8r��sr]c@seZdZdS)z?ClassPropertiesAndMethods.test_special_method_lookup.<locals>.XN)ryrzr{r7r7r7r8r��s)N)r�)rB)rJr��reversedr.r�	getsizeofr�r��mathZfloorZtruncr%Zceil�dir�roundr��	Exceptionr/r�r=r)r2r�r�rr�r�r�r�r�r�r�r�r�r�r�Zspecialsr�r�r�r5ZrunnerZ	meth_impl�envr�r�r�r7)r�r�r�r2r8�test_special_method_lookupasp






z4ClassPropertiesAndMethods.test_special_method_lookupc
Cs�Gdd�dt�}|�}|�}|j|�|jt|�t|��t|�t|�|j||�|j||k�|j||k�|j||k�|jt|�j	d�d�|jt|�t
|��|jd|�xtd�D]}|j
||�q�W|jd|�Gdd�dt�}|�}|�}|j|�|jt|�t|��t|�t|�|j||�|j||�|j||k�|j||k�|jt|�j	d	�d�|jt|�t
|��|jd|�xtd�D]}|j
||��q�W|jd|�Gd
d�dt�}|d�}	|d�}
|d�}|j|	�|j|
�|jt|	�td��|j|	|	�|j|	|
�|j|	|	k�|j|	|
�|j|	|
k�|j|	|
k�|j|
|	k�|j|
|	k�|jt|	�d�|jt
|	�d
�|td��}|jd|�xtd�D]}|j
||��q�W|jd|�dS)Nc@seZdZdd�ZdS)z2ClassPropertiesAndMethods.test_specials.<locals>.CcSs$d|kodknr|St�dS)Nrr�)�
IndexError)r2rpr7r7r8rO�sz>ClassPropertiesAndMethods.test_specials.<locals>.C.__getitem__N)ryrzr{rOr7r7r7r8r|�sr|zC object at rr]r�c@seZdZdd�ZdS)z2ClassPropertiesAndMethods.test_specials.<locals>.DcSs$d|kodknr|St�dS)Nrr�)r�)r2rpr7r7r8rO�sz>ClassPropertiesAndMethods.test_specials.<locals>.D.__getitem__N)ryrzr{rOr7r7r7r8r��sr�z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
||_dS)N)r�)r2r�r7r7r8r,�sz?ClassPropertiesAndMethods.test_specials.<locals>.Proxy.__init__cSs
|jS)N)r�)r2r7r7r8r~sz?ClassPropertiesAndMethods.test_specials.<locals>.Proxy.__bool__cSs
t|j�S)N)�hashr�)r2r7r7r8�__hash__sz?ClassPropertiesAndMethods.test_specials.<locals>.Proxy.__hash__cSs
|j|kS)N)r�)r2rxr7r7r8r]sz=ClassPropertiesAndMethods.test_specials.<locals>.Proxy.__eq__cSs
|j|kS)N)r�)r2rxr7r7r8�__ne__sz=ClassPropertiesAndMethods.test_specials.<locals>.Proxy.__ne__cSs
|j|kS)N)r�)r2rxr7r7r8�__ge__sz=ClassPropertiesAndMethods.test_specials.<locals>.Proxy.__ge__cSs
|j|kS)N)r�)r2rxr7r7r8�__gt__
sz=ClassPropertiesAndMethods.test_specials.<locals>.Proxy.__gt__cSs
|j|kS)N)r�)r2rxr7r7r8�__le__sz=ClassPropertiesAndMethods.test_specials.<locals>.Proxy.__le__cSs
|j|kS)N)r�)r2rxr7r7r8�__lt__sz=ClassPropertiesAndMethods.test_specials.<locals>.Proxy.__lt__cSs
d|jS)NzProxy:%s)r�)r2r7r7r8r�sz>ClassPropertiesAndMethods.test_specials.<locals>.Proxy.__str__cSs
d|jS)Nz	Proxy(%r))r�)r2r7r7r8rnsz?ClassPropertiesAndMethods.test_specials.<locals>.Proxy.__repr__cSs
||jkS)N)r�)r2r�r7r7r8r`szCClassPropertiesAndMethods.test_specials.<locals>.Proxy.__contains__N)ryrzr{r,r~r�r]r�r�r�r�r�r�rnr`r7r7r7r8�Proxy�sr�zProxy:0zProxy(0)r�r�r�r�)r�r�r>�idr�r=r�ZassertGreaterEqualr�findrm�assertNotInr�r)
r2r|r��c2rpr�r�r�r�Zp0Zp1Zp_1Zp10r7r7r8�
test_specials�sp
z'ClassPropertiesAndMethods.test_specialsc
Cs�ddl}Gdd�dt�}|�}|j|�}|j|�|�~tj�|j|�d�~Gdd�dt�}|�}y|j|�Wn2tk
r�}z|jdt|��WYdd}~XnX|j	d�Gdd	�d	t�}|�}	|j|	�}|j|�|	�~	tj�|j|�d�~dS)
Nrc@seZdZdS)z2ClassPropertiesAndMethods.test_weakrefs.<locals>.CN)ryrzr{r7r7r7r8r|/sr|c@seZdZdgZdS)z7ClassPropertiesAndMethods.test_weakrefs.<locals>.NoWeakr�N)ryrzr{r�r7r7r7r8�NoWeak8sr�zweak referencez!weakref.ref(no) should be illegalc@seZdZddgZdS)z5ClassPropertiesAndMethods.test_weakrefs.<locals>.Weakr�rjN)ryrzr{r�r7r7r7r8�WeakAsr�)
�weakrefr��refr=rrbrrrr�)
r2rr|rP�rr��nor5r��yesr7r7r8�
test_weakrefs,s0
"

z'ClassPropertiesAndMethods.test_weakrefsc
CsGdd�dt�}|�}|j|d�d|_|j|jd�|j|jd�|`|j|d�|j|d�|jj|d�|j|jj|�d�|jj|�|j|d�|jd}|j	|t
�t|�}|jd|�|jd|�|jd	|�|jd
|�|j|j
d�|j|j|jd�|j|j|jd
�|j|j|jd�x|dD]t}yt||d�WnNtk
�r�}z0t|�jd�dk�r�|jd|t|�f�WYdd}~XnX|jd|��q8Wd|_
|j|j
d�Gdd�dt�}|�}yx|D]}	t|	��q�WWntk
�rYnX|jd�dS)Nc@s4eZdZdd�Zdd�Zdd�Zeeeedd�Zd	S)
z4ClassPropertiesAndMethods.test_properties.<locals>.CcSs|jS)N)r�)r2r7r7r8�getxNsz9ClassPropertiesAndMethods.test_properties.<locals>.C.getxcSs
||_dS)N)r�)r2r�r7r7r8�setxPsz9ClassPropertiesAndMethods.test_properties.<locals>.C.setxcSs|`dS)N)r�)r2r7r7r8�delxRsz9ClassPropertiesAndMethods.test_properties.<locals>.C.delxzI'm the x property.)�docN)ryrzr{rrrr�r�r7r7r7r8r|Msr|r�r�r�rv�__doc__�fget�fset�fdelzI'm the x property.rrr�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>.DcSsddS)Nr]rr7)rfr7r7r8rusz=ClassPropertiesAndMethods.test_properties.<locals>.D.<lambda>N)ryrzr{r�rOr7r7r7r8r�~sr�z,expected ZeroDivisionError from bad property)rrr
)r�r�r�r=r�rqr�r�rAr�r�r�rr
r�rrr
r�r?rr�r��ZeroDivisionError)
r2r|r;�raw�attrsr�r5r�rErpr7r7r8�test_propertiesKsV

"
z)ClassPropertiesAndMethods.test_propertiesr^z)Docstrings are omitted with -O2 and abovecsG�fdd�dt�}dS)NcsJeZdZdd�Zdd�Zee�Z�jejd�eed�Z	�je	jd�dS)z?ClassPropertiesAndMethods.test_properties_doc_attrib.<locals>.EcSsdS)Nrr7)r2r7r7r8�getter�szFClassPropertiesAndMethods.test_properties_doc_attrib.<locals>.E.gettercSsdS)Nr7)r^r�r7r7r8�setter�szFClassPropertiesAndMethods.test_properties_doc_attrib.<locals>.E.setterz
getter method)rN)
ryrzr{rrr�Zpropr=r
Zprop2r7)r2r7r8r��s
r�)r�)r2r�r7)r2r8�test_properties_doc_attrib�sz4ClassPropertiesAndMethods.test_properties_doc_attribcs:yddl�Wntk
r YnXG�fdd�dt�}dS)NrcseZdZe�j�ZdS)z>ClassPropertiesAndMethods.test_testcapi_no_segfault.<locals>.XN)ryrzr{r�Ztest_with_docstring�pr7)�	_testcapir7r8r��sr�)r�ImportErrorr�)r2r�r7)rr8�test_testcapi_no_segfault�s
z3ClassPropertiesAndMethods.test_testcapi_no_segfaultcsGdd�dt����}|j�jjd�|j|d�d|_|j|d�|j|jd�|j|jd�|`|j|d�|j|d�G�fdd�d��}|�}d	|_|j|jd	�|`|`Gd
d�dt����}d|_|j|jd�|`G�fdd
�d
��}|�}d|_|j|jd�|`dS)Nc@s@eZdZedd�Zejdd��Zejdd��Zejdd��ZdS)z9ClassPropertiesAndMethods.test_properties_plus.<locals>.Cr)r	cSs|jS)N)�_foo)r2r7r7r8r��sz=ClassPropertiesAndMethods.test_properties_plus.<locals>.C.foocSst|�|_dS)N)r#r)r2r�r7r7r8r��scSs|`dS)N)r)r2r7r7r8r��sN)ryrzr{r�r�rr�deleterr7r7r7r8r|�s
r|rr�r�rcseZdZ�jjdd��ZdS)z9ClassPropertiesAndMethods.test_properties_plus.<locals>.DcSs"y|`Wntk
rYnXdS)N)rr?)r2r7r7r8r��sz=ClassPropertiesAndMethods.test_properties_plus.<locals>.D.fooN)ryrzr{r�rr7)r|r7r8r��sr�r�c@sDeZdZedd��Zejdd��Zejdd��Zejddd��ZdS)z9ClassPropertiesAndMethods.test_properties_plus.<locals>.EcSs|jS)N)r)r2r7r7r8r��sz=ClassPropertiesAndMethods.test_properties_plus.<locals>.E.foocSst�dS)N)�RuntimeError)r2r�r7r7r8r��scSst|�|_dS)N)r#r)r2r�r7r7r8r��sNcSs|`dS)N)r)r2r�r7r7r8r��s)N)ryrzr{r�r�rrr7r7r7r8r��s
r�cs*eZdZ�jjdd��Zejdd��ZdS)z9ClassPropertiesAndMethods.test_properties_plus.<locals>.FcSs|`dS)N)r)r2r7r7r8r��sz=ClassPropertiesAndMethods.test_properties_plus.<locals>.F.foocSstd|�|_dS)Nr)�maxr)r2r�r7r7r8r��sN)ryrzr{r�rrr7)r�r7r8r�srr�ri���i���i����)r�r=r�r
r�r�r)r2rPr�rEr[rr�r7)r|r�r8�test_properties_plus�s6z.ClassPropertiesAndMethods.test_properties_pluscCs�t�}|j|i�ti�}|j|i�tddd��}|j|ddd��|j|tt|j����|j|tt|j����tddd��}|j|tddd��|j|tf|��|j|tddidd��|j|td'gdd	��|j|td(d)gf|��|j|tf|��x|ddd
ddgd*fD]f}yt|�WnDtk
�r<Yn>tk
�rj|dk�rXn|jd|�YnX|jd|��qWytii�Wntk
�r�YnX|jd�Gdd�d�}yt|��Wntk
�r�YnX|jd�dd�|_dd�|_	t|��}|j||j�Gdd�d�}t|dd�|dd�|dd�|dd�g�}|j|ddd��tt
td�tdd���}|j|td d!�td�D���xHd+gd,gfD]8}yt|�Wntk
�r�YnX|jd&|��q�WdS)-Nr^rL)r]r;r])�one�twor)r r )rrvr�ry�0zno TypeError from dict(%r)zno TypeError from dict({}, {})c@seZdZdddd�ZdS)zAClassPropertiesAndMethods.test_dict_constructors.<locals>.Mappingr^ray�?)r]r_r;N)ryrzr{rlr7r7r7r8�Mapping	sr"z*no TypeError from dict(incomplete mapping)cSst|jj��S)N)r.rlrh)r2r7r7r8ru	szBClassPropertiesAndMethods.test_dict_constructors.<locals>.<lambda>cSs
|j|S)N)rl)r2rpr7r7r8ru	sc@seZdZdd�Zdd�ZdS)zJClassPropertiesAndMethods.test_dict_constructors.<locals>.AddressBookEntrycSs||_||_dS)N)�first�last)r2r#r$r7r7r8r,"	szSClassPropertiesAndMethods.test_dict_constructors.<locals>.AddressBookEntry.__init__cSst|j|jg�S)N)rjr#r$)r2r7r7r8rk%	szSClassPropertiesAndMethods.test_dict_constructors.<locals>.AddressBookEntry.__iter__N)ryrzr{r,rkr7r7r7r8�AddressBookEntry!	sr%�TimZWarsaw�BarryZPeters)r'r&rarecSsg|]}||df�qS)r]r7)�.0rpr7r7r8�
<listcomp>/	szDClassPropertiesAndMethods.test_dict_constructors.<locals>.<listcomp>�tooshort�too�long�by 1zno ValueError from dict(%r))r r^)rrv)r r�)r)r*)r+r,r-)rlr=r.r/rjr�
ValueErrorr�rhrO�zipr�)r2rEZbadargr"r%Zbadr7r7r8�test_dict_constructors�sl






z0ClassPropertiesAndMethods.test_dict_constructorscs8d}|jt�ddg�~x2dddddgddd/ddit|jfD]}t|�q<Wd	d
�}Gdd�dt�}d
dg}|j|t|��|�|�}|j|t|��|�d|_dd�|_|j|t|��|ddg�Gdd�d|�}ddg|}|j|t|��|�|�}	|j|t|	��|�d|	_dd�|	_|j|t|	��|ddg�Gdd�dtt	��}
|
d�}d|_
d|_dd d!d"d#g��fd$d%�t|�D�}|j|d&d'g�Gd(d)�d)|
�}
|
d*�}d|_
d|_|j|jd+�yt|�Wnt
k
�r�YnX|jtt�tt��G�fd,d-�d-t��G�fd.d�dt�}t|��dS)0Nr��junkr2r^y@g@�2�2cSsdd�|D�S)NcSsg|]}|jd�s|�qS)r�)r�)r(rfr7r7r8r)G	szKClassPropertiesAndMethods.test_dir.<locals>.interesting.<locals>.<listcomp>r7)�stringsr7r7r8�interestingF	sz7ClassPropertiesAndMethods.test_dir.<locals>.interestingc@seZdZdZdd�ZdS)z-ClassPropertiesAndMethods.test_dir.<locals>.Cr]cSsdS)Nr7)r2r7r7r8�CmethodK	sz5ClassPropertiesAndMethods.test_dir.<locals>.C.CmethodN)ryrzr{�Cdatar6r7r7r7r8r|I	sr|r7r6cSsdS)Nrr7)r2r7r7r8ruU	sz4ClassPropertiesAndMethods.test_dir.<locals>.<lambda>�cdata�cmethodc@seZdZdZdd�ZdS)z-ClassPropertiesAndMethods.test_dir.<locals>.Ar]cSsdS)Nr7)r2r7r7r8�Amethod[	sz5ClassPropertiesAndMethods.test_dir.<locals>.A.AmethodN)ryrzr{�Adatar:r7r7r7r8r�Y	sr�r;r:r�cSsdS)Nr_r7)r2r7r7r8ruc	s�adata�amethodc@seZdZdS)z-ClassPropertiesAndMethods.test_dir.<locals>.MN)ryrzr{r7r7r7r8�Mh	sr>rGr]ryr
�__package__�
__loader__�__spec__csg|]}|�kr|�qSr7r7)r(r�)�default_attributesr7r8r)o	sz6ClassPropertiesAndMethods.test_dir.<locals>.<listcomp>r;rLc@seZdZdd�Zee�ZdS)z.ClassPropertiesAndMethods.test_dir.<locals>.M2cSsdS)NzNot a dict!r7)r2r7r7r8�getdicts	sz6ClassPropertiesAndMethods.test_dir.<locals>.M2.getdictN)ryrzr{rCr�rAr7r7r7r8r�r	sr��m2zNot a dict!cs<eZdZdd�Zdd�Z�fdd�Zdd�Z�fd	d
�ZdS)z3ClassPropertiesAndMethods.test_dir.<locals>.WrappercSs
||_dS)N)�
_Wrapper__obj)r2r�r7r7r8r,�	sz<ClassPropertiesAndMethods.test_dir.<locals>.Wrapper.__init__cSsdt|j�S)NzWrapper(%s))rmrE)r2r7r7r8rn�	sz<ClassPropertiesAndMethods.test_dir.<locals>.Wrapper.__repr__cs�|j|�S)N)rE)r2r�)�Wrapperr7r8rO�	sz?ClassPropertiesAndMethods.test_dir.<locals>.Wrapper.__getitem__cSs
t|j�S)N)r�rE)r2r7r7r8r:�	sz;ClassPropertiesAndMethods.test_dir.<locals>.Wrapper.__len__cs�t|j|��S)N)r@rE)r2r5)rFr7r8r|�	sz?ClassPropertiesAndMethods.test_dir.<locals>.Wrapper.__getattr__N)ryrzr{r,rnrOr:r|r7)rFr7r8rF�	s
rFcs eZdZ�fdd�Zee�ZdS)z-ClassPropertiesAndMethods.test_dir.<locals>.Ccs�t|��S)N)r?)r2)rFr7r8Z
__getclass�	sz8ClassPropertiesAndMethods.test_dir.<locals>.C.__getclassN)ryrzr{Z_C__getclassr�r�r7)rFr7r8r|�	s)r^)r=r�r?�test_dirr�r8r9r<r=rrLr;rArrw�Ellipsis)r2r1r�r5r|ZcstuffrPr�Zastuffr;r>Z	minstance�namesr�Z
m2instancer7)rFrBr8rG:	sV(

z"ClassPropertiesAndMethods.test_dirc+s�Gdd�dt�}|j|�jd�d�G�fdd�d|��|j��jd�d�Gd	d
�d
|�}t|�|_|j|�jd�d�G�fd
d�d|���|j��jd�d�G�fdd�dt��G��fdd�d���|j��jd�d�Gdd�d��}�|�|_|j|�jd�d�yt�d�Wntk
�r4YnX|jd�yt�|��Wntk
�rfYnX|jd�yt��jd�Wntk
�r�YnX|jd�yt��j|��Wntk
�r�YnX|jd �Gd!d"�d"t�}Gd#d$�d$|�}|�}|j|j	d%�|jt||�j	d�Gd&d'�d't�}G�fd(d)�d)|��|j�j
�|j�yt|dd*�Wntk
�r�YnX|jd+�dS),Nc@seZdZdd�ZdS)z0ClassPropertiesAndMethods.test_supers.<locals>.AcSsd|S)NzA(%r)r7)r2r;r7r7r8rD�	sz5ClassPropertiesAndMethods.test_supers.<locals>.A.methN)ryrzr{rDr7r7r7r8r��	sr�r]zA(1)cs&eZdZ��fdd�Zdd�Z�ZS)z0ClassPropertiesAndMethods.test_supers.<locals>.Bcst�|�|_dS)N)r�r�)r2)r�r�r7r8r,�	sz9ClassPropertiesAndMethods.test_supers.<locals>.B.__init__cSsd||jj|�S)NzB(%r))r�rD)r2r;r7r7r8rD�	sz5ClassPropertiesAndMethods.test_supers.<locals>.B.meth)ryrzr{r,rDr�r7)r�)r�r8r��	sr�r^zB(2)A(2)c@seZdZdd�ZdS)z0ClassPropertiesAndMethods.test_supers.<locals>.CcSsd||jj|�S)NzC(%r))r�rD)r2r;r7r7r8rD�	sz5ClassPropertiesAndMethods.test_supers.<locals>.C.methN)ryrzr{rDr7r7r7r8r|�	sr|r_zC(3)A(3)cseZdZ��fdd�Z�ZS)z0ClassPropertiesAndMethods.test_supers.<locals>.Dcsd|t�|�j|�S)NzD(%r))r�rD)r2r;)r�r�r7r8rD�	sz5ClassPropertiesAndMethods.test_supers.<locals>.D.meth)ryrzr{rDr�r7)r�)r�r8r��	sr�razD(4)C(4)B(4)A(4)cseZdZ��fdd�Z�ZS)z6ClassPropertiesAndMethods.test_supers.<locals>.mysupercst�|�j|�S)N)r�r,)r2r3)r��mysuperr7r8r,�	sz?ClassPropertiesAndMethods.test_supers.<locals>.mysuper.__init__)ryrzr{r,r�r7)rJ)r�r8rJ�	srJcseZdZ��fdd�ZdS)z0ClassPropertiesAndMethods.test_supers.<locals>.Ecsd|��|�j|�S)NzE(%r))rD)r2r;)r�rJr7r8rD�	sz5ClassPropertiesAndMethods.test_supers.<locals>.E.methN)ryrzr{rDr7)r�rJr7r8r��	sr�rezE(5)D(5)C(5)B(5)A(5)c@seZdZdd�ZdS)z0ClassPropertiesAndMethods.test_supers.<locals>.FcSs |j}d||jjf|j|�S)Nz	F(%r)[%s])�	_F__superr�ryrD)r2r;rfr7r7r8rD�	sz5ClassPropertiesAndMethods.test_supers.<locals>.F.methN)ryrzr{rDr7r7r7r8r�	srrfz!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>.DDbasecSsdS)Nr�r7)r2r7r7r8r�	sz:ClassPropertiesAndMethods.test_supers.<locals>.DDbase.getxN)ryrzr{rr�r�r7r7r7r8�DDbase�	srLc@seZdZdd�Zee�ZdS)z4ClassPropertiesAndMethods.test_supers.<locals>.DDsubcSsdS)Nrr7)r2r7r7r8r�	sz9ClassPropertiesAndMethods.test_supers.<locals>.DDsub.getxN)ryrzr{rr�r�r7r7r7r8�DDsub�	srMrc@seZdZedd��ZdS)z3ClassPropertiesAndMethods.test_supers.<locals>.BasecSsdS)Nr�r7)r2r7r7r8ru�	sz<ClassPropertiesAndMethods.test_supers.<locals>.Base.<lambda>N)ryrzr{r��aPropr7r7r7r8�Base�	srOcs"eZdZe��fdd��Z�ZS)z2ClassPropertiesAndMethods.test_supers.<locals>.Subcst�|�jS)N)r�rN)�klass)�Subr�r7r8r��	sz7ClassPropertiesAndMethods.test_supers.<locals>.Sub.test)ryrzr{r�r�r�r7)rQ)r�r8rQ�	srQ)r�z#super shouldn't accept keyword args)r�r=rDr�r�rKrr�r�r�r�rN)r2r�r|rrLrM�ddrO)r�)r�r�r�rQrJr8�test_supers�	s`





z%ClassPropertiesAndMethods.test_supersc
sG�fdd�dt��|jt�d�d�d�|jt�d�d�d��d�}|j|d�|jt|�d�|jt|�jt�|jt|�td��|j|
jt�|j|d	?jt�|j|d	>jt�|j�d	�d
>jt�|j�d	�d
?jt�G�fdd�dt��|jt�d
�d�d�|jtd�d��d��d�}|j|d�|jt|�d�|jt|�td��|jt|�jt�|j|
jt�|j|jt�|j�d	�jt�|j|d	?jt�|j|d	>jt�|j|d	jt�|j|djt�|j|djt�|j|djt�|jd|jt�|j|d	Bjt�|j|d	Ajt�|j|d8@jt�|j�d	�d
>jt�|j�d	�d
?jt�|jt�d	��jt�Gdd�dt�}|d�}|j|d	jt�|jd	|jt�|d9�}|j|ji�|jt|�d:�Gdd�dt	�}|jt|d��d�|d�}|j|d�|jt	|�d�|jt	|�jt	�|jt|�td��|j|
jt	�Gdd�dt
�}|d;d�}|jt|�d�t
d<d�}|j|jt
�|j||�|jt
|�|�|jt
|�jt
�||�}|jt|�d�|j||�|jt
|�|�|jt
|�jt
�|jt|�t|��|j|
jt
�|j|d	jt
�|j|d	|�|j|d	jt
�|j|d	|�|j|djt
�|j|d|�|j|djt
�|j|d|�Gdd�dt�}|d=�}|j|d>�|j|j�|d?��|j|j�j�|d@��x:t
d#�D].}|t
|��}|j�}	|	j�}
|j|
|��qBW|dA�}|jt|�dB�|jt|�jt�|jt|�tdC��|j|dd�jt�|j|djt�|j|d	jt�|j|fjt�|f�}|jt|�f�|jt|�jt�|j||jt�|j|d	jt�|j|djt�|j|d jt�|j|dd�jt�Gd$d%�d%t�}|d&�}|j|d&�|j|j�|d'��|j|j�j�|d&��xFt
d(�D]:}|d)jttt
|����}|j�}|j�}	|j|	|��q�W|d*�}|jt|�d*�|jt|�jt�dD}||�}|j||�|jt|�|�|jt|�jt�|jt|�t|��|j|di|d�|j|di|d�|j|d)jt�|j|d)|�|jd)|jt�|jd)||�|j|d	jt�|j|d	d)�|j|djt�|j|d|�|j|d jt�|j|d ||�|j|dd�jt�|j|dd�|�|j|d	d	�jt�|j|d	d	�d)�|j|j�jt�|j|j�|�|j|j�jt�|j|j�|�|j|j�jt�|j|j�|�i}
|j|j|
�jt�|j|j|
�|�|j|jd,d,�jt�|j|jd,d,�|�|j|jt|��jt�|j|jt|��|�|j|jt|��jt�|j|jt|��|�|j|jt|��jt�|j|jt|��|�|j|j�jt�|j|j�|�Gd-d.�d.t�}|d/�}	|j|	d/�|j|	j�|d0��|j|	j�j�|d/��d*}||�}	|jt|	�|�|jt|	�jt�|jt|	�t|��|j|	di|d�|j|di|	d�|j|	j�jt�|j|	j�|�|j|	j�jt�|j|	j�|�|j|	j�jt�|j|	j�|�|j|	jd,d,�jt�|j|	jd,d,�|�|j|	jd1d1�jt�|j|	jd1d1�|�|j|	jt|	��jt�|j|	jt|	��|�|j|	jt|	��jt�|j|	jt|	��|�|j|	jt|	��jt�|j|	jt|	��|�|j|	j�jt�|j|	j�|�|j|	j�jt�|j|	j�|�|j|	j�jt�|j|	j�|�|j|	j�jt�|j|	j�|�|j|	d)jt�|j|	d)|�|jd)|	jt�|jd)|	|�|j|	d	jt�|j|	d	d)�|j|	djt�|j|	d|�|j|	d jt�|j|	d ||�|j|	dd�jt�|j|	dd�|�|j|	d	d	�jt�|j|	d	d	�d)�Gd2d3�d3t�}|t
d��}|j|tt
d���|jd4�|j|tt
d��d4g�d|d<|j|tt
d!���|j t
d!d5��|j|tt
d5���g|dEd�<|j|tt
d6���|d7d6�=|jt|�d7�|j|tt
d7���|jt|�tt
d7���|j|d	d	�|j|dd�|j|dFd	�|j|dGd�|j|dd�tt
d���dS)HNcs eZdZdd�Z�fdd�ZdS)z@ClassPropertiesAndMethods.test_basic_inheritance.<locals>.hexintcSst|�S)N)�hex)r2r7r7r8rn
szIClassPropertiesAndMethods.test_basic_inheritance.<locals>.hexint.__repr__cs�tj||��S)N)r%rK)r2rx)�hexintr7r8rK
szHClassPropertiesAndMethods.test_basic_inheritance.<locals>.hexint.__add__N)ryrzr{rnrKr7)rUr7r8rU
srU��	Z0x10i�Z0x3efi90rr�cs.eZdZgZdd�Z��fdd�ZeZ�ZS)zAClassPropertiesAndMethods.test_basic_inheritance.<locals>.octlongcSst|�S)N)�oct)r2r7r7r8r�%
szIClassPropertiesAndMethods.test_basic_inheritance.<locals>.octlong.__str__cs|jt�|�j|��S)N)r�r�rK)r2rx)r��octlongr7r8rK'
szIClassPropertiesAndMethods.test_basic_inheritance.<locals>.octlong.__add__)ryrzr{r�r�rKr�r�r7)rY)r�r8rY#
srYr_reZ0o10i�Z0o5675r]c@seZdZdS)zCClassPropertiesAndMethods.test_basic_inheritance.<locals>.longcloneN)ryrzr{r7r7r7r8�	longcloneF
srZc@s$eZdZdgZd	dd�Zdd�ZdS)
zCClassPropertiesAndMethods.test_basic_inheritance.<locals>.precfloatr��r�cSst|�|_dS)N)r%r�)r2r�r�r7r7r8r,S
szLClassPropertiesAndMethods.test_basic_inheritance.<locals>.precfloat.__init__cSsd|j|fS)Nz%.*g)r�)r2r7r7r8rnU
szLClassPropertiesAndMethods.test_basic_inheritance.<locals>.precfloat.__repr__N)r[r�)ryrzr{r�r,rnr7r7r7r8�	precfloatQ
s
r\g�������?z1.1g��@c@seZdZdd�ZdS)zDClassPropertiesAndMethods.test_basic_inheritance.<locals>.madcomplexcSsd|j|jfS)Nz%.17gj%+.17g)r�r�)r2r7r7r8rn`
szMClassPropertiesAndMethods.test_basic_inheritance.<locals>.madcomplex.__repr__N)ryrzr{rnr7r7r7r8�
madcomplex_
sr]raz4j-3c@seZdZdZdd�ZdS)zBClassPropertiesAndMethods.test_basic_inheritance.<locals>.madtupleNcSs2|jdk	r|jSt|�}|j�|j|�|_|jS)N)�_revr.r�r�)r2r�r7r7r8�rev{
s
zFClassPropertiesAndMethods.test_basic_inheritance.<locals>.madtuple.rev)ryrzr{r^r_r7r7r7r8�madtupley
sr`r^rf�ic@seZdZdZdd�ZdS)zCClassPropertiesAndMethods.test_basic_inheritance.<locals>.madstringNcSs8|jdk	r|jSt|�}|j�|jdj|��|_|jS)Nr})r^r.r�r��join)r2r�r7r7r8r_�
s
zGClassPropertiesAndMethods.test_basic_inheritance.<locals>.madstring.rev)ryrzr{r^r_r7r7r7r8�	madstring�
srcZabcdefghijklmnopqrstuvwxyzZzyxwvutsrqponmlkjihgfedcba�r}Z12345�r�c@seZdZdZdd�ZdS)zDClassPropertiesAndMethods.test_basic_inheritance.<locals>.madunicodeNcSs8|jdk	r|jSt|�}|j�|jdj|��|_|jS)Nr})r^r.r�r�rb)r2r�r7r7r8r_�
s
zHClassPropertiesAndMethods.test_basic_inheritance.<locals>.madunicode.rev)ryrzr{r^r_r7r7r7r8�
madunicode�
srfZABCDEFZFEDCBAZxyc@seZdZdS)zAClassPropertiesAndMethods.test_basic_inheritance.<locals>.sublistN)ryrzr{r7r7r7r8�sublistsrgr��r�r�r�r����rj)
r]r^r_rarerfrVrarWr)
r]r^r_rarerfrVrarWr)
rrWrarVrfrerar_r^r])
r]r^r_rarerfrVrarWr)r]r^r_rare)r]r^r_rare)r]r^r_rarez���i����r�)!r%r=rmr�r�r�rr#rAr&r�rKr_r�rb�maprX�strip�lstrip�rstrip�	translate�replace�ljustr��rjust�center�lower�upper�
capitalize�titler.rir�)r2r;rZr\r]�baser`rprFrrr�rcrfZidentitytabrfrgr7)rUrYr8�test_basic_inheritance
s�

			

z0ClassPropertiesAndMethods.test_basic_inheritancecCs�|jtdd�d�|jtdd�d�|jtdd�d�|jtddd�tdd��|jtd	d
�d�|jtdd
d�d�|jttd�d�d�|jtdd�ttd���xNttttttttfD]6}y|dd�Wntk
r�Yq�X|j	d|�q�WdS)Nr])r�r^g@r_r�i�)r�r�i�)r��500sabc�strict)r��errorsrU)�sequencer)Zbogus_keyword_argz4expected TypeError from bogus keyword argument to %r)rr]r^)rr]r^)
r=r%r&r�rrKr�r.rr�)r2�constructorr7r7r8�
test_keywordsXs z'ClassPropertiesAndMethods.test_keywordscs�G�fdd�dt��|j�d�d�|jd�d��|jt�d��d��d�d�d�d	�d
�di}|j|�d�d�|j|�d�d	�|j|�d
�d�|j�d�|�|j|j�d��d�dS)Ncs(eZdZdd�Z�fdd�Zdd�ZdS)zFClassPropertiesAndMethods.test_str_subclass_as_dict_key.<locals>.cistrcSs|j�|_t|j�|_dS)N)ru�	canonicalr��hashcode)r2r�r7r7r8r,ws
zOClassPropertiesAndMethods.test_str_subclass_as_dict_key.<locals>.cistr.__init__cst|��s�|�}|j|jkS)N)r�r�)r2rx)�cistrr7r8r]{s
zMClassPropertiesAndMethods.test_str_subclass_as_dict_key.<locals>.cistr.__eq__cSs|jS)N)r�)r2r7r7r8r��szOClassPropertiesAndMethods.test_str_subclass_as_dict_key.<locals>.cistr.__hash__N)ryrzr{r,r]r�r7)r�r7r8r�qsr��ABCrUZaBcrr]r r^ZtHreer_ZtWoZTHrEEZONeZthrEE)rr=rr�)r2rEr7)r�r8�test_str_subclass_as_dict_keynsz7ClassPropertiesAndMethods.test_str_subclass_as_dict_keyc

sGdd�d�}�x�|ttfD]�}G�fdd�d|���d�}�d�}�d�}|j|d�|||d�}x�dD]�}x�dD]�}x~dD]v}	|jtd|	�td|	�d||f�|jtd|	�td|	�d||f�|jtd|	�td|	�d||f�q~WqtWqjWqWdS)Nc@seZdZdS)zCClassPropertiesAndMethods.test_classic_comparisons.<locals>.classicN)ryrzr{r7r7r7r8�classic�sr�cs\eZdZdd�Z�fdd�Z�fdd�Z�fdd�Z�fd	d
�Z�fdd�Z�fd
d�Z	dS)z=ClassPropertiesAndMethods.test_classic_comparisons.<locals>.CcSst|�|_dS)N)r%r�)r2r�r7r7r8r,�szFClassPropertiesAndMethods.test_classic_comparisons.<locals>.C.__init__cs8t|��r|j|jkSt|t�s*t|t�r4|j|kStS)N)r�r�r%rw)r2rx)r|r7r8r]�s


zDClassPropertiesAndMethods.test_classic_comparisons.<locals>.C.__eq__cs8t|��r|j|jkSt|t�s*t|t�r4|j|kStS)N)r�r�r%rw)r2rx)r|r7r8r��s


zDClassPropertiesAndMethods.test_classic_comparisons.<locals>.C.__ne__cs8t|��r|j|jkSt|t�s*t|t�r4|j|kStS)N)r�r�r%rw)r2rx)r|r7r8r��s


zDClassPropertiesAndMethods.test_classic_comparisons.<locals>.C.__lt__cs8t|��r|j|jkSt|t�s*t|t�r4|j|kStS)N)r�r�r%rw)r2rx)r|r7r8r��s


zDClassPropertiesAndMethods.test_classic_comparisons.<locals>.C.__le__cs8t|��r|j|jkSt|t�s*t|t�r4|j|kStS)N)r�r�r%rw)r2rx)r|r7r8r��s


zDClassPropertiesAndMethods.test_classic_comparisons.<locals>.C.__gt__cs8t|��r|j|jkSt|t�s*t|t�r4|j|kStS)N)r�r�r%rw)r2rx)r|r7r8r��s


zDClassPropertiesAndMethods.test_classic_comparisons.<locals>.C.__ge__N)
ryrzr{r,r]r�r�r�r�r�r7)r|r7r8r|�sr|r]r^r_)r]r^r_r�<=�==�!=r�>=zc[x] %s c[y]zx %s yz
x=%d, y=%dz	c[x] %s yz	x %s c[y])r]r^r_)r]r^r_)rr�r�r�rr�)r%r�r=r>)
r2r�ryr�r��c3rPr��y�opr7)r|r8�test_classic_comparisons�s((





z2ClassPropertiesAndMethods.test_classic_comparisonsc
spGdd�dt�}|d�}�j|d��jd|�Gdd�dt�}|d�}�j|d��jd|�Gdd	�d	�}�x�|tttfD�]�}G��fd
d�d|���d�}�d�}�d
�}	�j|d�|||	d�}
x�dD]�}x�dD]�}x�d D]x}
�jtd|
�td|
�d||f��jtd|
�td|
�d||f��jtd|
�td|
�d||f��q�Wq�Wq�Wq~WdS)!Nc@seZdZdS)z:ClassPropertiesAndMethods.test_rich_comparisons.<locals>.ZN)ryrzr{r7r7r7r8r��sr�r]yc@seZdZdd�ZdS)z;ClassPropertiesAndMethods.test_rich_comparisons.<locals>.ZZc	Ss yt||�dkStSdS)Ng���ư>)r#rw)r2rxr7r7r8r]�szBClassPropertiesAndMethods.test_rich_comparisons.<locals>.ZZ.__eq__N)ryrzr{r]r7r7r7r8�ZZ�sr�g�ׇP�?c@seZdZdS)z@ClassPropertiesAndMethods.test_rich_comparisons.<locals>.classicN)ryrzr{r7r7r7r8r��sr�csheZdZdd�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|�|_dS)N)r%r�)r2r�r7r7r8r,�szCClassPropertiesAndMethods.test_rich_comparisons.<locals>.C.__init__cs�jd�dS)Nzshouldn't call __cmp__)r�)r^rx)r2r7r8�__cmp__�szBClassPropertiesAndMethods.test_rich_comparisons.<locals>.C.__cmp__cs8t|��r|j|jkSt|t�s*t|t�r4|j|kStS)N)r�r�r%rw)r2rx)r|r7r8r]�s


zAClassPropertiesAndMethods.test_rich_comparisons.<locals>.C.__eq__cs8t|��r|j|jkSt|t�s*t|t�r4|j|kStS)N)r�r�r%rw)r2rx)r|r7r8r��s


zAClassPropertiesAndMethods.test_rich_comparisons.<locals>.C.__ne__cs8t|��r|j|jkSt|t�s*t|t�r4|j|kStS)N)r�r�r%rw)r2rx)r|r7r8r��s


zAClassPropertiesAndMethods.test_rich_comparisons.<locals>.C.__lt__cs8t|��r|j|jkSt|t�s*t|t�r4|j|kStS)N)r�r�r%rw)r2rx)r|r7r8r��s


zAClassPropertiesAndMethods.test_rich_comparisons.<locals>.C.__le__cs8t|��r|j|jkSt|t�s*t|t�r4|j|kStS)N)r�r�r%rw)r2rx)r|r7r8r��s


zAClassPropertiesAndMethods.test_rich_comparisons.<locals>.C.__gt__cs8t|��r|j|jkSt|t�s*t|t�r4|j|kStS)N)r�r�r%rw)r2rx)r|r7r8r�s


zAClassPropertiesAndMethods.test_rich_comparisons.<locals>.C.__ge__N)ryrzr{r,r�r]r�r�r�r�r�r7)r|r2r7r8r|�sr|r^r_)r]r^r_r�<=�==�!=r�>=zc[x] %s c[y]zx %s yz
x=%d, y=%dz	c[x] %s yz	x %s c[y]y�?y�?y�?y�?)r]r^r_)r]r^r_)rr�r�r�rr�)r�r=r%r�r.r>)r2r�rcr�Zzzr�ryr�r�r�rPr�r�r�r7)r|r2r8�test_rich_comparisons�s8)





z/ClassPropertiesAndMethods.test_rich_comparisonscs4ddlm}�fdd�}||jd�|tjd�dS)Nr)�FileIOcs�j|j|�dS)N)r=r
)�descrZwhat)r2r7r8�check sz6ClassPropertiesAndMethods.test_descrdoc.<locals>.checkzTrue if the file is closedz!the real part of a complex number)�_ior��closedr�r�)r2r�r�r7)r2r8�
test_descrdocsz'ClassPropertiesAndMethods.test_descrdoccsvGdd�dt��G�fdd�d�}G�fdd�dt�}|j|jd�|j|�jd�|j|jd	�|j|�jd
�dS)Nc@seZdZdd�ZdS)z?ClassPropertiesAndMethods.test_doc_descriptor.<locals>.DocDescrcSs&|r|jjd}|r|j}d||fS)Nz	 instancezobject=%s; type=%s)r�ry)r2r�Zotyper7r7r8r�)s
zGClassPropertiesAndMethods.test_doc_descriptor.<locals>.DocDescr.__get__N)ryrzr{r�r7r7r7r8�DocDescr(sr�cseZdZ��ZdS)z?ClassPropertiesAndMethods.test_doc_descriptor.<locals>.OldClassN)ryrzr{r
r7)r�r7r8�OldClass/sr�cseZdZ��ZdS)z?ClassPropertiesAndMethods.test_doc_descriptor.<locals>.NewClassN)ryrzr{r
r7)r�r7r8�NewClass1sr�zobject=None; type=OldClassz'object=OldClass instance; type=OldClasszobject=None; type=NewClassz'object=NewClass instance; type=NewClass)r�r=r
)r2r�r�r7)r�r8�test_doc_descriptor%sz-ClassPropertiesAndMethods.test_doc_descriptorcs Gdd�dt�}Gdd�dt�}Gdd�dt�}Gdd�d||�}xX||||fD]H}xB||||fD]2}|�}||_�j|j|�||_�j|j|�qbWqPW�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%|�}x�||f||
f|
|f||f||ffD]n\}}|�}d|_||_�j|j|d&||f��j|jd�||_�j|j|d&||f��j|jd��qWx`||||||||t|	f
D]D}x<||||||||t|	f
D] }||k�rȐq�||�|��q�W�q�WGd'd(�d(t��G�fd)d*�d*t���fd+d,�t	d-�D�}~dS).Nc@seZdZdS)z3ClassPropertiesAndMethods.test_set_class.<locals>.CN)ryrzr{r7r7r7r8r|:sr|c@seZdZdS)z3ClassPropertiesAndMethods.test_set_class.<locals>.DN)ryrzr{r7r7r7r8r�;sr�c@seZdZdS)z3ClassPropertiesAndMethods.test_set_class.<locals>.EN)ryrzr{r7r7r7r8r�<sr�c@seZdZdS)z3ClassPropertiesAndMethods.test_set_class.<locals>.FN)ryrzr{r7r7r7r8r=srcsly
||_Wntk
rYnX�jd||f�yt|d�Wnttfk
rXYnX�jd|�dS)Nz!shouldn't allow %r.__class__ = %rr�z shouldn't allow del %r.__class__)r�rr�rr?)r�r|)r2r7r8�cantEs
z6ClassPropertiesAndMethods.test_set_class.<locals>.cantr]c@seZdZgZdS)z5ClassPropertiesAndMethods.test_set_class.<locals>.IntN)ryrzr{r�r7r7r7r8�IntXsr�Tr^c@seZdZddgZdS)z3ClassPropertiesAndMethods.test_set_class.<locals>.Gr;rLN)ryrzr{r�r7r7r7r8r_src@seZdZddgZdS)z3ClassPropertiesAndMethods.test_set_class.<locals>.HrLr;N)ryrzr{r�r7r7r7r8r_asr_c@seZdZddgZdS)z3ClassPropertiesAndMethods.test_set_class.<locals>.Ir;rLN)ryrzr{r�r7r7r7r8rxcsrxc@seZdZddgZdS)z3ClassPropertiesAndMethods.test_set_class.<locals>.JrPrLN)ryrzr{r�r7r7r7r8�Jesr�c@seZdZdddgZdS)z3ClassPropertiesAndMethods.test_set_class.<locals>.Kr;rLrEN)ryrzr{r�r7r7r7r8�Kgsr�c@seZdZdgZdS)z3ClassPropertiesAndMethods.test_set_class.<locals>.Lr[N)ryrzr{r�r7r7r7r8r�isr�c@seZdZdgZdS)z3ClassPropertiesAndMethods.test_set_class.<locals>.Mr[N)ryrzr{r�r7r7r7r8r>ksr>c@seZdZdgZdS)z3ClassPropertiesAndMethods.test_set_class.<locals>.NrjN)ryrzr{r�r7r7r7r8r�msr�c@seZdZdgZdS)z3ClassPropertiesAndMethods.test_set_class.<locals>.PrAN)ryrzr{r�r7r7r7r8�Posr�c@seZdZdS)z3ClassPropertiesAndMethods.test_set_class.<locals>.QN)ryrzr{r7r7r7r8�Qqsr�c@seZdZddgZdS)z3ClassPropertiesAndMethods.test_set_class.<locals>.RrArjN)ryrzr{r�r7r7r7r8�Rssr�z0assigning %r as __class__ for %r silently failedc@seZdZdS)z3ClassPropertiesAndMethods.test_set_class.<locals>.ON)ryrzr{r7r7r7r8�O�sr�cseZdZ�fdd�ZdS)z3ClassPropertiesAndMethods.test_set_class.<locals>.Acs
�|_dS)N)r�)r2)r�r7r8rZ�sz;ClassPropertiesAndMethods.test_set_class.<locals>.A.__del__N)ryrzr{rZr7)r�r7r8r��sr�csg|]
}���qSr7r7)r(r�)r�r7r8r)�sz<ClassPropertiesAndMethods.test_set_class.<locals>.<listcomp>rv)
r�r�r�r.r%�boolr?r;r=r�)r2r|r�r�rr�Zcls2r�r�r��orr_rxr�r�r�r>r�r�r�r�rqr7)r�r�r2r8�test_set_class8sp


,


z(ClassPropertiesAndMethods.test_set_classcs�Gdd�dt�}|�}ddi|_�j|jd��fdd���|d��|g��|d�|`Gdd�dt�����fd	d
�}Gdd�dt��}Gd
d�d�t�}Gdd�dt|d�}Gdd�dt|d�}xR|||fD]D}||�|j}	yd|	d<Wntk
�rYq�X�jd|�q�WGdd�dtj��}
Gdd�d�tj�}x,|
|fD] }|d�}
||
�d|
jd<�qNWdd�}Gdd�dt	��}Gdd �d �t	�}xHt	||fD]:}|�}d!di|_�j|j
d��j||�|t����q�WdS)"Nc@seZdZdS)z2ClassPropertiesAndMethods.test_set_dict.<locals>.CN)ryrzr{r7r7r7r8r|�sr|rLr]cs:y
||_Wnttfk
r"YnX�jd||f�dS)Nz shouldn't allow %r.__dict__ = %r)rAr?rr�)r�rl)r2r7r8r��s

z5ClassPropertiesAndMethods.test_set_dict.<locals>.cantc@seZdZdS)z5ClassPropertiesAndMethods.test_set_dict.<locals>.BaseN)ryrzr{r7r7r7r8rO�srOcs��|i�y|`Wnttfk
r*YnX�jd|��jd}y|j|i�Wnttfk
rlYnX�jd|�dS)Nzshouldn't allow del %r.__dict__rAz&dict_descr allowed access to %r's dict)rAr?rr�rq)r�Z
dict_descr)rOr�r2r7r8�verify_dict_readonly�s

zEClassPropertiesAndMethods.test_set_dict.<locals>.verify_dict_readonlyc@seZdZdS)z6ClassPropertiesAndMethods.test_set_dict.<locals>.Meta1N)ryrzr{r7r7r7r8�Meta1�sr�c@seZdZdS)z6ClassPropertiesAndMethods.test_set_dict.<locals>.Meta2N)ryrzr{r7r7r7r8�Meta2�sr�c@seZdZdS)z2ClassPropertiesAndMethods.test_set_dict.<locals>.DN)ryrzr{r7r7r7r8r��sr�)r�c@seZdZdS)z2ClassPropertiesAndMethods.test_set_dict.<locals>.EN)ryrzr{r7r7r7r8r��sr�Zeggsr�z%r's __dict__ can be modifiedc@seZdZdS)z8ClassPropertiesAndMethods.test_set_dict.<locals>.Module1N)ryrzr{r7r7r7r8�Module1�sr�c@seZdZdS)z8ClassPropertiesAndMethods.test_set_dict.<locals>.Module2N)ryrzr{r7r7r7r8�Module2�sr�cSs*y|`Wnttfk
r dSXdSdS)NFT)rArr?)r[r7r7r8�can_delete_dict�s
z@ClassPropertiesAndMethods.test_set_dict.<locals>.can_delete_dictc@seZdZdS)z;ClassPropertiesAndMethods.test_set_dict.<locals>.Exception1N)ryrzr{r7r7r7r8�
Exception1�sr�c@seZdZdS)z;ClassPropertiesAndMethods.test_set_dict.<locals>.Exception2N)ryrzr{r7r7r7r8�
Exception2�sr�r;)r�rAr=rLr?rr�rrr�r;r.)r2r|r;r�r�r�r�r�r�Z
class_dictr�r�rr�r�r�r�Z
ExceptionTyper[r7)rOr�r2r8�
test_set_dict�sJ




z'ClassPropertiesAndMethods.test_set_dictcs�G�fdd�dt��|jt�d��d��d�|jt�d�d�d�|jtd�d��d�|jt�d��d��d�|jtd�d��d�|jt�d�d�d�|jtt�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%)r2r7r7r8rn�szKClassPropertiesAndMethods.test_binary_operator_override.<locals>.I.__repr__cs�t|�t|��S)N)r%)r2rx)rxr7r8rK�szJClassPropertiesAndMethods.test_binary_operator_override.<locals>.I.__add__Ncs>|dkr�tt|�t|���S�tt|�t|�t|���SdS)N)rr%)r2rxr�)rxr7r8�__pow__�szJClassPropertiesAndMethods.test_binary_operator_override.<locals>.I.__pow__cs@|dkr �tt|�t|�|��S�tt|�t|�t|���SdS)N)rr%)r2rxr�)rxr7r8�__rpow__�szKClassPropertiesAndMethods.test_binary_operator_override.<locals>.I.__rpow__)N)N)ryrzr{rnrKr�r�r�r7)rxr7r8rx�s
rxr]r^zI(3)r_zI(8)rec@seZdZdd�ZdS)zBClassPropertiesAndMethods.test_binary_operator_override.<locals>.ScSs|j�|j�kS)N)ru)r2rxr7r7r8r]
szIClassPropertiesAndMethods.test_binary_operator_override.<locals>.S.__eq__N)ryrzr{r]r7r7r7r8�S
sr�)r%r=rmrr)r2r�r7)rxr8�test_binary_operator_override�s$z7ClassPropertiesAndMethods.test_binary_operator_overridec	Cs|Gdd�dt�}Gdd�d|�}Gdd�d|�}Gdd�d||�}|�}t|�}d	d
�|_|jt|�d�dd
�|_|jt|�d
�dd
�|_|jt|�d�dd
�|_|jt|�d�d|_|jtt|�|`|jt|�d�d|_|jtt|�|`|jt|�d
�d|_|jtt|�|`|jt|�d�d|_|jtt|�|`|jt|�|�d|_d|_|j|jd�|j|jd�dd�}||_|j|jd�|j|jd�dd�}||_	|j|j
d�|j|jd�|j|jd�|`|j|jd�|`|j|jd�|j|jd�|`	y
|jWntk
�r8YnX|jd�Gdd�dt�}Gdd�d|�}~t
j�dd
�|_dS)Nc@seZdZdS)z>ClassPropertiesAndMethods.test_subclass_propagation.<locals>.AN)ryrzr{r7r7r7r8r�

sr�c@seZdZdS)z>ClassPropertiesAndMethods.test_subclass_propagation.<locals>.BN)ryrzr{r7r7r7r8r�
sr�c@seZdZdS)z>ClassPropertiesAndMethods.test_subclass_propagation.<locals>.CN)ryrzr{r7r7r7r8r|
sr|c@seZdZdS)z>ClassPropertiesAndMethods.test_subclass_propagation.<locals>.DN)ryrzr{r7r7r7r8r�
sr�cSsdS)Nr�r7)r2r7r7r8ru
szEClassPropertiesAndMethods.test_subclass_propagation.<locals>.<lambda>r�cSsdS)Ni:r7)r2r7r7r8ru
si:cSsdS)N�r7)r2r7r7r8ru
sr�cSsdS)Nrvr7)r2r7r7r8ru
srvcSs|dkrdStj||�S)Nr�r�)r�r	)r2r5r7r7r8r	0
szMClassPropertiesAndMethods.test_subclass_propagation.<locals>.__getattribute__r�cSs|dkrdSt|��dS)Nr�r�r�r)r�r�r�)r?)r2r5r7r7r8r|7
szHClassPropertiesAndMethods.test_subclass_propagation.<locals>.__getattr__rzd.foo should be undefined nowc@seZdZdS)z>ClassPropertiesAndMethods.test_subclass_propagation.<locals>.AN)ryrzr{r7r7r7r8r�M
sc@seZdZdS)z>ClassPropertiesAndMethods.test_subclass_propagation.<locals>.BN)ryrzr{r7r7r7r8r�O
scWsdS)Nr7)r;r7r7r8ruS
s)r�r�r�r=rrr�r�r	r|r�r?r�rrbrY)	r2r�r�r|r�rEZ	orig_hashr	r|r7r7r8�test_subclass_propagation
sv





z3ClassPropertiesAndMethods.test_subclass_propagationcCs�ddl}Gdd�dt�}d}||�}|j|j|�|j|��Gdd�dt�}|d�}y|j|�|jd�Wntk
r�YnXdS)	Nrc@seZdZdS)zBClassPropertiesAndMethods.test_buffer_inheritance.<locals>.MyBytesN)ryrzr{r7r7r7r8rF[
srFsabcc@seZdZdS)z@ClassPropertiesAndMethods.test_buffer_inheritance.<locals>.MyIntN)ryrzr{r7r7r7r8rBc
srBr�z2subclass of int should not have a buffer interface)�binasciirJr=�b2a_hexr%r�r)r2r�rFryrGrBr7r7r8�test_buffer_inheritanceU
s
z1ClassPropertiesAndMethods.test_buffer_inheritancecs�ddl�ddl}G�fdd�dt�}|d�}|jt|�|�|jtt|��t�|jtt|��t�|jt|�d�|jt|�d�|jt|�d�|j|j�d�|j|j�d�|j	�}t
||d�t
t|�|d�|j|j�d	�|j�dS)
Nrcs eZdZ�fdd�Zdd�ZdS)zGClassPropertiesAndMethods.test_str_of_str_subclass.<locals>.octetstringcs�j|jd��jd�S)N�ascii)r��encode�decode)r2)r�r7r8r�r
szOClassPropertiesAndMethods.test_str_of_str_subclass.<locals>.octetstring.__str__cSs|dS)Nz reprr7)r2r7r7r8rnt
szPClassPropertiesAndMethods.test_str_of_str_subclass.<locals>.octetstring.__repr__N)ryrzr{r�rnr7)r�r7r8�octetstringq
sr�r��AZ41zA repr)�filez41
41
)
r��iorr=r?rm�ordr�rn�StringIO�printre�close)r2r�r�r�Zcapturer7)r�r8�test_str_of_str_subclassl
s"z2ClassPropertiesAndMethods.test_str_of_str_subclasscCsJdd�}|j|jdd�d�g}tj|dddgd�|j|dddg�dS)	NcSs|S)Nr7)r;r7r7r8r��
sz;ClassPropertiesAndMethods.test_keyword_arguments.<locals>.fr�)r;rr]r^)r~)r=r�r.r,)r2r�r;r7r7r8�test_keyword_arguments�
s
z0ClassPropertiesAndMethods.test_keyword_argumentscCsHGdd�dt�}|�|_y|��Wntk
r8YnX|jd�dS)Nc@seZdZdS)z8ClassPropertiesAndMethods.test_recursive_call.<locals>.AN)ryrzr{r7r7r7r8r��
sr�z7Recursion limit should have been reached for __call__())r�r��RecursionErrorr�)r2r�r7r7r8�test_recursive_call�
sz-ClassPropertiesAndMethods.test_recursive_callcs�g�G�fdd�dt�}|�}|j�g�~tj�|j�dg�Gdd�dt�}|�}y
|d=Wntk
rvYnX|jd�dS)NcseZdZ�fdd�ZdS)z5ClassPropertiesAndMethods.test_delete_hook.<locals>.Ccs�jd�dS)Nr])ri)r2)r
r7r8rZ�
sz=ClassPropertiesAndMethods.test_delete_hook.<locals>.C.__del__N)ryrzr{rZr7)r
r7r8r|�
sr|r]c@seZdZdS)z5ClassPropertiesAndMethods.test_delete_hook.<locals>.DN)ryrzr{r7r7r7r8r��
sr�rz$invalid del() didn't raise TypeError)r�r=rrbrr�)r2r|rPr�rEr7)r
r8�test_delete_hook�
s
z*ClassPropertiesAndMethods.test_delete_hookcCs�Gdd�dt�}|�}yt|�Wntk
r6YnX|jd�Gdd�dt�}|�}yt|�Wntk
rxYnX|jd�dS)Nc@seZdZdS)z?ClassPropertiesAndMethods.test_hash_inheritance.<locals>.mydictN)ryrzr{r7r7r7r8�mydict�
sr�z#hash() of dict subclass should failc@seZdZdS)z?ClassPropertiesAndMethods.test_hash_inheritance.<locals>.mylistN)ryrzr{r7r7r7r8�mylist�
sr�z#hash() of list subclass should fail)rlr�rr�r.)r2r�rEr�r7r7r8�test_hash_inheritance�
s
z/ClassPropertiesAndMethods.test_hash_inheritancecSCsyddWntk
r YnX|jd�ydjd�Wntk
rNYnX|jd�ydjdg�Wntk
r~YnX|jd�ydjd�Wntk
r�YnX|jd	�yd
dWntk
r�YnX|jd�ydiWntk
�rYnX|jd
�yddWntk
�r4YnX|jd�yddWntk
�rbYnX|jd�yddWntk
�r�YnX|jd�yddWntk
�r�YnX|jd�|jdj�d�|jdj�d�|jddd�|jddd�dS)Nr;rez'' + 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%*srUz''%*s' % ('abc') doesn't raise TypeErrorz%*.*sz,'%*.*s' % ('abc', 5) doesn't raise TypeErrorz%sr]r^z%'%s' % (1, 2) doesn't raise TypeError�%z#'%' % None doesn't raise ValueErrorZ534253Z534253xz%c�)rUre)r]r^)rr��splitr.rb�rindexr=�isdigit)r2r7r7r8�test_str_operations�
sl









z-ClassPropertiesAndMethods.test_str_operationscCs2Gdd�d�}|�}|�}||_||_t|�}dS)Nc@seZdZdS)z?ClassPropertiesAndMethods.test_deepcopy_recursive.<locals>.NodeN)ryrzr{r7r7r7r8r�
sr)rLr;r)r2rr;rLrcr7r7r8�test_deepcopy_recursive�
sz1ClassPropertiesAndMethods.test_deepcopy_recursivecCsjddlm}|j|�}t|�|j|d�|j|d�|j|d�|j|j�d|_|j|jddi�dS)Nr)rry�__file__r�r])	rrr�rr�r�rAr�r=)r2r>rGr7r7r8�test_uninitialized_modules�
s
z4ClassPropertiesAndMethods.test_uninitialized_modulescsRG�fdd�dt�}Gdd�d|��|j|d�dddg�|j�d�dddg��d�}|j|jd�|d�}|j|��|j|jd��d�}|j|��|j|jd�Gd	d�dt�}|j|dd�|ddf�Gd
d�d|��|j�dd��ddf�Gdd�dt�}|j|dd�||ddf�Gdd�d|��|j�dd���ddf�dS)
NcseZdZ�fdd�ZdS)z3ClassPropertiesAndMethods.test_funny_new.<locals>.Ccs6t|t�rdddgSt|t�r(tj��Stj|�SdS)Nr]r^r_)r�rr%r�r�)r�r�)r�r7r8r�
s




z;ClassPropertiesAndMethods.test_funny_new.<locals>.C.__new__N)ryrzr{r�r7)r�r7r8r|sr|c@seZdZdd�ZdS)z3ClassPropertiesAndMethods.test_funny_new.<locals>.DcSs
||_dS)N)r�)r2r�r7r7r8r,sz<ClassPropertiesAndMethods.test_funny_new.<locals>.D.__init__N)ryrzr{r,r7r7r7r8r�sr�rTr]r^r_c@seZdZedd��ZdS)z3ClassPropertiesAndMethods.test_funny_new.<locals>.CcWs|S)Nr7)r3r7r7r8r� sz;ClassPropertiesAndMethods.test_funny_new.<locals>.C.__new__N)ryrzr{r�r�r7r7r7r8r|sc@seZdZdS)z3ClassPropertiesAndMethods.test_funny_new.<locals>.DN)ryrzr{r7r7r7r8r�$sc@seZdZedd��ZdS)z3ClassPropertiesAndMethods.test_funny_new.<locals>.CcWs|S)Nr7)r3r7r7r8r�)sz;ClassPropertiesAndMethods.test_funny_new.<locals>.C.__new__N)ryrzr{r�r�r7r7r7r8r|(sc@seZdZdS)z3ClassPropertiesAndMethods.test_funny_new.<locals>.DN)ryrzr{r7r7r7r8r�-s)r�r=r�r�)r2r|rEr7)r�r8�test_funny_new
s(z(ClassPropertiesAndMethods.test_funny_newcCs�Gdd�dt�}|�}|}|d9}|j||df�|}|d9}|j||df�|}|d9}|j||df�|}|d	9}|j||d
f�|}|d9}|j||df�|}|d9}|j||df�dS)Nc@seZdZdd�ZdS)z2ClassPropertiesAndMethods.test_imul_bug.<locals>.CcSs||fS)Nr7)r2rxr7r7r8rb5sz;ClassPropertiesAndMethods.test_imul_bug.<locals>.C.__imul__N)ryrzr{rbr7r7r7r8r|4sr|g�?r^r_r]rvr�ll)r�r=)r2r|r�r�r7r7r8�
test_imul_bug1s(z'ClassPropertiesAndMethods.test_imul_bugcs�ddl}G�fdd�dt�}|d�}|jd��j|jd��j|j�d�|j|�}�j|jd��j|j�d�|j|�}�j|jd��j|j�d�dS)Nrcs<eZdZddd�Zd
dd�Zdd�Zdd	�Z�fd
d�ZdS)z7ClassPropertiesAndMethods.test_copy_setstate.<locals>.CNcSs||_||_dS)N)r��_C__foo)r2r�r7r7r8r,Osz@ClassPropertiesAndMethods.test_copy_setstate.<locals>.C.__init__cSs
||_dS)N)r�)r2r�r7r7r8�setfooRsz>ClassPropertiesAndMethods.test_copy_setstate.<locals>.C.setfoocSs|jS)N)r�)r2r7r7r8�getfooTsz>ClassPropertiesAndMethods.test_copy_setstate.<locals>.C.getfoocSs|jgS)N)r�)r2r7r7r8�__getstate__VszDClassPropertiesAndMethods.test_copy_setstate.<locals>.C.__getstate__cs$�jt|�d�|d|_|_dS)Nr]r)r=r�r�r�)r^Zlst)r2r7r8�__setstate__XszDClassPropertiesAndMethods.test_copy_setstate.<locals>.C.__setstate__)N)N)ryrzr{r,r�r�r�r�r7)r2r7r8r|Ns


r|r�r�)r�r�r�r=r�r�r)r2r�r|r;rLr7)r2r8�test_copy_setstateKs



z,ClassPropertiesAndMethods.test_copy_setstatecCs�|jddd�d�|jdtd�d�|jtjdtd��d�Gdd�dt�}|j|d�dd�d�|j|d�td�d�|j|d�jtd��d�|jddd�d�|jdtd�d�|jtjdtd��d�Gd	d
�d
t�}|j|d�dd�d�|j|d�td�d�|j|d�jtd��d�|jdddgdd�ddg�|jdddgtd�ddg�|jtjdddgtd��ddg�Gdd�dt�}|j|dddg�dd�ddg�|j|dddg�td�ddg�|j|dddg�jtd��ddg�|dddg�}ddg|tdd�<|j|dddg�ddg|td
dd�<|j|dddg�|jtdd�ddg�|j|dddg�|jtd
dd�ddg�|j|dddg�dS)NrraZhellc@seZdZdd�ZdS)z0ClassPropertiesAndMethods.test_slices.<locals>.ScSstj||�S)N)rrO)r2r�r7r7r8rOnsz<ClassPropertiesAndMethods.test_slices.<locals>.S.__getitem__N)ryrzr{rOr7r7r7r8r�msr�r]r^r_c@seZdZdd�ZdS)z0ClassPropertiesAndMethods.test_slices.<locals>.TcSstj||�S)N)rKrO)r2r�r7r7r8rOxsz<ClassPropertiesAndMethods.test_slices.<locals>.T.__getitem__N)ryrzr{rOr7r7r7r8r�wsr�c@seZdZdd�ZdS)z0ClassPropertiesAndMethods.test_slices.<locals>.LcSstj||�S)N)r.rO)r2r�r7r7r8rO�sz<ClassPropertiesAndMethods.test_slices.<locals>.L.__getitem__N)ryrzr{rOr7r7r7r8r��sr�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^)r=rQrrOrKr.rY)r2r�r�r�r;r7r7r8�test_slicesfs<"""$z%ClassPropertiesAndMethods.test_slicescsDG�fdd�dt����}d|_~tj�|jt�j�d��`dS)NcseZdZgZ�fdd�ZdS)z>ClassPropertiesAndMethods.test_subtype_resurrection.<locals>.Ccs�jj|�dS)N)�	containerri)r2)r|r7r8rZ�szFClassPropertiesAndMethods.test_subtype_resurrection.<locals>.C.__del__N)ryrzr{r�rZr7)r|r7r8r|�sr|r�r])r�r�rrbr=r�r�rZ)r2rPr7)r|r8�test_subtype_resurrection�sz3ClassPropertiesAndMethods.test_subtype_resurrectioncCs4Gdd�dt�}d}xtd�D]}||�}qW~dS)Nc@seZdZdgZdd�ZdS)z9ClassPropertiesAndMethods.test_slots_trash.<locals>.trashr�cSs
||_dS)N)r�)r2r�r7r7r8r,�szBClassPropertiesAndMethods.test_slots_trash.<locals>.trash.__init__N)ryrzr{r�r,r7r7r7r8�trash�sr�iP�)r�r�)r2r�r�rpr7r7r8�test_slots_trash�s
z*ClassPropertiesAndMethods.test_slots_trashcCsnGdd�dt�}Gdd�dt�}Gdd�d||�}tj�rJ|j|j|j�|j|d�|j|d�d	|�_dS)
Nc@seZdZfZdS)zDClassPropertiesAndMethods.test_slots_multiple_inheritance.<locals>.AN)ryrzr{r�r7r7r7r8r��sr�c@seZdZdS)zDClassPropertiesAndMethods.test_slots_multiple_inheritance.<locals>.BN)ryrzr{r7r7r7r8r��sr�c@seZdZfZdS)zDClassPropertiesAndMethods.test_slots_multiple_inheritance.<locals>.CN)ryrzr{r�r7r7r7r8r|�sr|rArjr^)r�rr1r=�
__basicsize__r�r�)r2r�r�r|r7r7r8�test_slots_multiple_inheritance�sz9ClassPropertiesAndMethods.test_slots_multiple_inheritancecCsZGdd�dt�}|�}|j|dd�|j|dd�|jd|d�|jd|d�dS)Nc@seZdZdd�Zdd�ZdS)z.ClassPropertiesAndMethods.test_rmul.<locals>.CcSsdS)Nrr7)r2rxr7r7r8rc�sz6ClassPropertiesAndMethods.test_rmul.<locals>.C.__mul__cSsdS)N�rmulr7)r2rxr7r7r8rd�sz7ClassPropertiesAndMethods.test_rmul.<locals>.C.__rmul__N)ryrzr{rcrdr7r7r7r8r|�sr|r^rg������@r�)r�r=)r2r|r;r7r7r8�	test_rmul�sz#ClassPropertiesAndMethods.test_rmulcCs"Gdd�dt�}|�}|dC}dS)Nc@seZdZdd�ZdS)z.ClassPropertiesAndMethods.test_ipow.<locals>.CcSsdS)Nr7)r2rxr7r7r8�__ipow__�sz7ClassPropertiesAndMethods.test_ipow.<locals>.C.__ipow__N)ryrzr{r�r7r7r7r8r|�sr|r^)r�)r2r|r;r7r7r8�	test_ipow�sz#ClassPropertiesAndMethods.test_ipowc1s�Gdd�dt�}G�fdd�dt��Gdd�d|�}Gdd�d|�}|�}|�}|f|_�f|_|j|j�d	�|j|j�d	�|j|jd
�|j|jd
�|j�j�|g�y|`Wnttfk
r�YnX|jd�y
f|_Wn<tk
�r }zt	|�dk�r|jd
�WYdd}~XnX|jd�y|f|_Wntk
�rNYnX|jd�y||f|_Wntk
�r~YnX|jd�y|f|_Wntk
�r�YnX|jd�dS)Nc@seZdZdS)z7ClassPropertiesAndMethods.test_mutable_bases.<locals>.CN)ryrzr{r7r7r7r8r|�sr|cs&eZdZ��fdd�Zdd�Z�ZS)z8ClassPropertiesAndMethods.test_mutable_bases.<locals>.C2cs |dkrdSt�|�j|�SdS)Nr;r^)r�r	)r2r�)r�r�r7r8r	�szIClassPropertiesAndMethods.test_mutable_bases.<locals>.C2.__getattribute__cSsdS)Nr]r7)r2r7r7r8rD�sz=ClassPropertiesAndMethods.test_mutable_bases.<locals>.C2.meth)ryrzr{r	rDr�r7)r�)r�r8r��sr�c@seZdZdS)z7ClassPropertiesAndMethods.test_mutable_bases.<locals>.DN)ryrzr{r7r7r7r8r��sr�c@seZdZdS)z7ClassPropertiesAndMethods.test_mutable_bases.<locals>.EN)ryrzr{r7r7r7r8r��sr�r]r^z&shouldn't be able to delete .__bases__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)
r�rBr=rDr;�__subclasses__rr?r�r)r2r|r�r�rEr[r5r7)r�r8�test_mutable_bases�sN




z,ClassPropertiesAndMethods.test_mutable_basescCs�dd�tjj�D�}x4|D],}tj|d�|tk	r|jt|j�d|�qWGdd�dt�}Gdd�dt�}Gd	d
�d
|�}yt	f|_Wnt
k
r�YnX|jd�yt	ft_Wnt
k
r�YnX|jd�y|tf|_Wnt
k
r�YnXdS)
NcSsg|]}t|t�r|�qSr7)r�r?)r(�tpr7r7r8r) sz@ClassPropertiesAndMethods.test_builtin_bases.<locals>.<listcomp>rBr]c@seZdZdS)z7ClassPropertiesAndMethods.test_builtin_bases.<locals>.LN)ryrzr{r7r7r7r8r�'sr�c@seZdZdS)z7ClassPropertiesAndMethods.test_builtin_bases.<locals>.CN)ryrzr{r7r7r7r8r|*sr|c@seZdZdS)z7ClassPropertiesAndMethods.test_builtin_bases.<locals>.DN)ryrzr{r7r7r7r8r�-sr�z/shouldn't turn list subclass into dict subclassz-shouldn't be able to assign to list.__bases__)�builtinsrA�valuesr�r	r=r�rBr.rlrr�)r2Z
builtin_typesr�r�r|r�r7r7r8�test_builtin_basess.


z,ClassPropertiesAndMethods.test_builtin_basescHCs�|jt��Gdd�dtd��}WdQRX|jt��Gdd�dttd��}WdQRX|jt��Gdd�dtd�t�}WdQRXGdd�dt�}|jt��Gdd�d|td��}WdQRX|jt��Gdd�dtd�|�}WdQRXGd	d�dt�}|jt��td�f|_WdQRX|jt��ttd�f|_WdQRX|jt��td�tf|_WdQRX|jt��|td�f|_WdQRX|jt��td�|f|_WdQRXdS)
Nc@seZdZdS)z>ClassPropertiesAndMethods.test_unsubclassable_types.<locals>.XN)ryrzr{r7r7r7r8r�Gsr�c@seZdZdS)z>ClassPropertiesAndMethods.test_unsubclassable_types.<locals>.XN)ryrzr{r7r7r7r8r�Jsc@seZdZdS)z>ClassPropertiesAndMethods.test_unsubclassable_types.<locals>.XN)ryrzr{r7r7r7r8r�Msc@seZdZdS)z>ClassPropertiesAndMethods.test_unsubclassable_types.<locals>.ON)ryrzr{r7r7r7r8r�Osr�c@seZdZdS)z>ClassPropertiesAndMethods.test_unsubclassable_types.<locals>.XN)ryrzr{r7r7r7r8r�Rsc@seZdZdS)z>ClassPropertiesAndMethods.test_unsubclassable_types.<locals>.XN)ryrzr{r7r7r7r8r�Usc@seZdZdS)z>ClassPropertiesAndMethods.test_unsubclassable_types.<locals>.XN)ryrzr{r7r7r7r8r�Xs)rrr?r�rB)r2r�r�r7r7r8�test_unsubclassable_typesEs,    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}	y|f|_Wn0tk
r�|j|j|�|j|j|	�YnX|jd�dS)Ncs&eZdZ��fdd�Zdd�Z�ZS)zOClassPropertiesAndMethods.test_mutable_bases_with_failing_mro.<locals>.WorkOncecsd|_t�|�j�|||�S)Nr)�flagr�r�)r2r5r�r�)�WorkOncer�r7r8r�hszWClassPropertiesAndMethods.test_mutable_bases_with_failing_mro.<locals>.WorkOnce.__new__cSs0|jdkrtd��n|jd7_tj|�SdS)NrZbozor])r�rr?r�)r2r7r7r8r�ks

zSClassPropertiesAndMethods.test_mutable_bases_with_failing_mro.<locals>.WorkOnce.mro)ryrzr{r�r�r�r7)r�)r�r8r�gsr�c@seZdZdd�ZdS)zQClassPropertiesAndMethods.test_mutable_bases_with_failing_mro.<locals>.WorkAlwayscSs
tj|�S)N)r?r�)r2r7r7r8r�sszUClassPropertiesAndMethods.test_mutable_bases_with_failing_mro.<locals>.WorkAlways.mroN)ryrzr{r�r7r7r7r8�
WorkAlwaysrsr�c@seZdZdS)zHClassPropertiesAndMethods.test_mutable_bases_with_failing_mro.<locals>.CN)ryrzr{r7r7r7r8r|zsr|c@seZdZdS)zIClassPropertiesAndMethods.test_mutable_bases_with_failing_mro.<locals>.C2N)ryrzr{r7r7r7r8r�}sr�c@seZdZdS)zHClassPropertiesAndMethods.test_mutable_bases_with_failing_mro.<locals>.DN)ryrzr{r7r7r7r8r��sr�c@seZdZdS)zHClassPropertiesAndMethods.test_mutable_bases_with_failing_mro.<locals>.EN)ryrzr{r7r7r7r8r��sr�c@seZdZdS)zHClassPropertiesAndMethods.test_mutable_bases_with_failing_mro.<locals>.FN)ryrzr{r7r7r7r8r�sr)r�c@seZdZdS)zHClassPropertiesAndMethods.test_mutable_bases_with_failing_mro.<locals>.GN)ryrzr{r7r7r7r8r�srzexception not propagated)r?r�rrBrr=r�)
r2r�r|r�r�r�rrZE_mro_beforeZD_mro_beforer7)r�r8�#test_mutable_bases_with_failing_mroes z=ClassPropertiesAndMethods.test_mutable_bases_with_failing_mrocCs�Gdd�dt�}Gdd�dt�}Gdd�d||�}Gdd�d||�}Gd	d
�d
||�}y||f|_Wntk
rxYnX|jd�dS)Nc@seZdZdS)zJClassPropertiesAndMethods.test_mutable_bases_catch_mro_conflict.<locals>.AN)ryrzr{r7r7r7r8r��sr�c@seZdZdS)zJClassPropertiesAndMethods.test_mutable_bases_catch_mro_conflict.<locals>.BN)ryrzr{r7r7r7r8r��sr�c@seZdZdS)zJClassPropertiesAndMethods.test_mutable_bases_catch_mro_conflict.<locals>.CN)ryrzr{r7r7r7r8r|�sr|c@seZdZdS)zJClassPropertiesAndMethods.test_mutable_bases_catch_mro_conflict.<locals>.DN)ryrzr{r7r7r7r8r��sr�c@seZdZdS)zJClassPropertiesAndMethods.test_mutable_bases_catch_mro_conflict.<locals>.EN)ryrzr{r7r7r7r8r��sr�zdidn't catch MRO conflict)r�rBrr�)r2r�r�r|r�r�r7r7r8�%test_mutable_bases_catch_mro_conflict�sz?ClassPropertiesAndMethods.test_mutable_bases_catch_mro_conflictcCsVGdd�dt�}|j}d|_|j|j|jf|df�d|_|j|j|jf|df�dS)Nc@seZdZdS)z7ClassPropertiesAndMethods.test_mutable_names.<locals>.CN)ryrzr{r7r7r7r8r|�sr|r�zD.E)r�rzryr=)r2r|r�r7r7r8�test_mutable_names�s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)Nrx)ry)r2)r|r7r8rZ�szDClassPropertiesAndMethods.test_evil_type_name.<locals>.Nasty.__del__N)ryrzr{rZr7)r|r7r8�Nasty�sr�c@seZdZdS)z8ClassPropertiesAndMethods.test_evil_type_name.<locals>.CN)ryrzr{r7r7r7r8r|�sr|rUZnormal)rry)r2r�r7)r|r8�test_evil_type_name�s
z-ClassPropertiesAndMethods.test_evil_type_namecCsGdd�dt�}|j|d�dd�|jd|d�d�Gdd�dt�}|j|�dd�|jd|�d	�Gd
d�d|�}|j|�|�d�|j|�|�d
�Gdd�d|�}|j|j|j�|j|�dd�|jd|�d	�|j|�|�d�|j|�|�d�dS)Nc@seZdZdd�Zdd�ZdS)z;ClassPropertiesAndMethods.test_subclass_right_op.<locals>.BcSsdS)NzB.__floordiv__r7)r2rxr7r7r8�__floordiv__�szHClassPropertiesAndMethods.test_subclass_right_op.<locals>.B.__floordiv__cSsdS)NzB.__rfloordiv__r7)r2rxr7r7r8�
__rfloordiv__�szIClassPropertiesAndMethods.test_subclass_right_op.<locals>.B.__rfloordiv__N)ryrzr{r�r�r7r7r7r8r��sr�r]zB.__floordiv__zB.__rfloordiv__c@seZdZdd�Zdd�ZdS)z;ClassPropertiesAndMethods.test_subclass_right_op.<locals>.CcSsdS)NzC.__floordiv__r7)r2rxr7r7r8r��szHClassPropertiesAndMethods.test_subclass_right_op.<locals>.C.__floordiv__cSsdS)NzC.__rfloordiv__r7)r2rxr7r7r8r��szIClassPropertiesAndMethods.test_subclass_right_op.<locals>.C.__rfloordiv__N)ryrzr{r�r�r7r7r7r8r|�sr|zC.__floordiv__zC.__rfloordiv__c@seZdZdd�Zdd�ZdS)z;ClassPropertiesAndMethods.test_subclass_right_op.<locals>.DcSsdS)NzD.__floordiv__r7)r2rxr7r7r8r��szHClassPropertiesAndMethods.test_subclass_right_op.<locals>.D.__floordiv__cSsdS)NzD.__rfloordiv__r7)r2rxr7r7r8r��szIClassPropertiesAndMethods.test_subclass_right_op.<locals>.D.__rfloordiv__N)ryrzr{r�r�r7r7r7r8r��sr�zD.__floordiv__zD.__rfloordiv__c@seZdZdS)z;ClassPropertiesAndMethods.test_subclass_right_op.<locals>.EN)ryrzr{r7r7r7r8r��sr�)r%r=r�r�)r2r�r|r�r�r7r7r8�test_subclass_right_op�sz0ClassPropertiesAndMethods.test_subclass_right_opz)testing an internal kind of method objectc#Cs6dddg}dddd�}|jtj|�|�|jij|�|�tjd}|j|jdt�|�|�|j|ji�|�|�y|jdd�Wntk
r�YnX|jd�y|jd�Wntk
r�YnX|jd�y|jdd�Wntk
r�YnX|jd	�y|jdt�Wntk
�r&YnX|jd
�dS)Nr]r^r_)r]r^r_�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))r=rlr�rAr�rr�r%)r2r�rCr�r7r7r8�test_meth_class_gets6




z-ClassPropertiesAndMethods.test_meth_class_getcCs�Gdd�dt�}Gdd�d�}|�}||�}|j||�|j||�Gdd�d|�}|�}||�}|j||�|j||�Gdd�dt�}|�}||�}|j||�|j||�Gdd�d|�}|�}||�}|j||�|j||�dS)	Nc@seZdZdd�Zdd�ZdS)z<ClassPropertiesAndMethods.test_isinst_isclass.<locals>.ProxycSs
||_dS)N)�_Proxy__obj)r2r�r7r7r8r,1szEClassPropertiesAndMethods.test_isinst_isclass.<locals>.Proxy.__init__cSs&|jd�rtj||�St|j|�SdS)N�_Proxy__)r�r�r	r@r)r2r5r7r7r8r	3s
zMClassPropertiesAndMethods.test_isinst_isclass.<locals>.Proxy.__getattribute__N)ryrzr{r,r	r7r7r7r8r�0sr�c@seZdZdS)z8ClassPropertiesAndMethods.test_isinst_isclass.<locals>.CN)ryrzr{r7r7r7r8r|9sr|c@seZdZdS)z8ClassPropertiesAndMethods.test_isinst_isclass.<locals>.DN)ryrzr{r7r7r7r8r�@sr�c@seZdZdS)z8ClassPropertiesAndMethods.test_isinst_isclass.<locals>.CN)ryrzr{r7r7r7r8r|Gsc@seZdZdS)z8ClassPropertiesAndMethods.test_isinst_isclass.<locals>.DN)ryrzr{r7r7r7r8r�Ns)r�r�)r2r�r|r;�par�r7r7r8�test_isinst_isclass.s*	z-ClassPropertiesAndMethods.test_isinst_isclasscs\Gdd�dt�}Gdd�dt�}G�fdd�d|����}||�}|j�jd|�d�dS)	Nc@seZdZdd�Zdd�ZdS)z9ClassPropertiesAndMethods.test_proxy_super.<locals>.ProxycSs
||_dS)N)r)r2r�r7r7r8r,XszBClassPropertiesAndMethods.test_proxy_super.<locals>.Proxy.__init__cSs&|jd�rtj||�St|j|�SdS)Nr)r�r�r	r@r)r2r5r7r7r8r	Zs
zJClassPropertiesAndMethods.test_proxy_super.<locals>.Proxy.__getattribute__N)ryrzr{r,r	r7r7r7r8r�Wsr�c@seZdZdd�ZdS)z5ClassPropertiesAndMethods.test_proxy_super.<locals>.BcSsdS)NzB.fr7)r2r7r7r8r�asz7ClassPropertiesAndMethods.test_proxy_super.<locals>.B.fN)ryrzr{r�r7r7r7r8r�`sr�cseZdZ��fdd�Z�ZS)z5ClassPropertiesAndMethods.test_proxy_super.<locals>.Ccst�|�j�dS)Nz->C.f)r�r�)r2)r|r�r7r8r�esz7ClassPropertiesAndMethods.test_proxy_super.<locals>.C.f)ryrzr{r�r�r7)r|)r�r8r|dsr|r�zB.f->C.f)r�r=rA)r2r�r�r�rr7)r|r8�test_proxy_superUs	z*ClassPropertiesAndMethods.test_proxy_supercCsfytjtdd�Wntk
r&YnX|jd�ytjtd�Wntk
rVYnX|jd�dS)Nr�r�z"Carlo Verre __setattr__ succeeded!ruz"Carlo Verre __delattr__ succeeded!)r�rrrr�r
)r2r7r7r8�test_carloverrels
z)ClassPropertiesAndMethods.test_carloverrecs@ddl�G�fdd�d�}Gdd�dt�}|�}||�|_~dS)Nrcs eZdZ�fdd�Zdd�ZdS)zAClassPropertiesAndMethods.test_weakref_segfault.<locals>.Provokercs�j|�|_dS)N)r)r2Z	referrent)rr7r8r,�szJClassPropertiesAndMethods.test_weakref_segfault.<locals>.Provoker.__init__cSs|j�}dS)N)r)r2r�r7r7r8rZ�szIClassPropertiesAndMethods.test_weakref_segfault.<locals>.Provoker.__del__N)ryrzr{r,rZr7)rr7r8�Provoker�src@seZdZdS)z=ClassPropertiesAndMethods.test_weakref_segfault.<locals>.OopsN)ryrzr{r7r7r7r8�Oops�sr)rr�Zwhatever)r2rrr�r7)rr8�test_weakref_segfault{s
z/ClassPropertiesAndMethods.test_weakref_segfaultcCs(dd�}xtd�D]
}|j}qWd}dS)NcSsdS)Nr7r7r7r7r8ru�szAClassPropertiesAndMethods.test_wrapper_segfault.<locals>.<lambda>i@B)r�r�)r2r�rpr7r7r8�test_wrapper_segfault�s
z/ClassPropertiesAndMethods.test_wrapper_segfaultcCsPtj}Gdd�d�}|�t_z&ytd�Wntk
r>YnXWd|t_XdS)Nc@seZdZdd�ZdS)z>ClassPropertiesAndMethods.test_file_fault.<locals>.StdoutGuardcSstjt_td|��dS)Nz!Premature access to sys.stdout.%s)r�
__stdout__�stdoutr)r2r�r7r7r8r|�szJClassPropertiesAndMethods.test_file_fault.<locals>.StdoutGuard.__getattr__N)ryrzr{r|r7r7r7r8�StdoutGuard�sr
zOops!)rrr�r)r2Ztest_stdoutr
r7r7r8�test_file_fault�s
z)ClassPropertiesAndMethods.test_file_faultcspG�fdd�dt�}Gdd�dt��G�fdd�dt����}d|j|�<|j|jd�tj�|j|d	�dS)
Ncs eZdZdd�Z�fdd�ZdS)zHClassPropertiesAndMethods.test_vicious_descriptor_nonsense.<locals>.EvilcSstd�S)Nr�)r�)r2r7r7r8r��szQClassPropertiesAndMethods.test_vicious_descriptor_nonsense.<locals>.Evil.__hash__cs�`dS)Nr)r�)r2rx)r|r7r8r]�szOClassPropertiesAndMethods.test_vicious_descriptor_nonsense.<locals>.Evil.__eq__N)ryrzr{r�r]r7)r|r7r8�Evil�src@seZdZddd�ZdS)zIClassPropertiesAndMethods.test_vicious_descriptor_nonsense.<locals>.DescrNcSsdS)Nr]r7)r2�obr?r7r7r8r��szQClassPropertiesAndMethods.test_vicious_descriptor_nonsense.<locals>.Descr.__get__)N)ryrzr{r�r7r7r7r8�Descr�srcseZdZ��ZdS)zEClassPropertiesAndMethods.test_vicious_descriptor_nonsense.<locals>.CN)ryrzr{r�r7)rr7r8r|�sr|rr]r�)r�rAr=r�rrbr�)r2rrPr7)r|rr8� test_vicious_descriptor_nonsense�sz:ClassPropertiesAndMethods.test_vicious_descriptor_nonsensecCs>Gdd�dt�}y
|�Wntk
r.YnX|jd�dS)Nc@seZdZdd�ZdS)z0ClassPropertiesAndMethods.test_init.<locals>.FoocSsdS)Nr�r7)r2r7r7r8r,�sz9ClassPropertiesAndMethods.test_init.<locals>.Foo.__init__N)ryrzr{r,r7r7r7r8�Foo�srz'did not test __init__() for None return)r�rr�)r2rr7r7r8�	test_init�s
z#ClassPropertiesAndMethods.test_initcCsg}|j|j|j�|j|jgj�|j|jdgj�|j|j|j�|j|jjd�t|jd�r�|j|jj|�|j|jjt	�n |j|jj
|�|j|jjt	�|j|jjt	jj�yt
|j�Wntk
r�YnX|jd�f}|d7}|j|jdj�|jt
|j�t
dj��dS)	NrerKr�z"no TypeError from hash([].__add__)rV)rV)rV)rV)r=rKr>rcryrsr�r��__objclass__r.Zim_selfZim_classr
r�rr�)r2rqrFr7r7r8�test_method_wrapper�s*
z-ClassPropertiesAndMethods.test_method_wrappercsddl�dd�}��fdd�}tjd}tj}�x�dCD]�\}}}d0|d1d�}td2f||i�}	|	�}
|||
|
�|||
|�|||
|�|r6|||
|
�|||
|�|||
|�d3|d1d�}td4f||i�}|�}
|||
|
�|||
|�|||
|�q6WdS)DNrcSstS)N)rw)r2rxr7r7r8�
specialmethod�szEClassPropertiesAndMethods.test_not_implemented.<locals>.specialmethodcs@yt|||�d��Wntk
r*YnX�jd|f�dS)N)r�r��operatorzno TypeError from %r)rUrr�)r6r�r�)rr2r7r8r��s
z=ClassPropertiesAndMethods.test_not_implemented.<locals>.checkr]rK�x + y�x += y�__sub__�x - y�x -= yrc�x * y�x *= y�
__matmul__�x @ y�x @= y�__truediv__�x / y�x /= yr��x // y�x //= y�__mod__�x % y�x %= y�
__divmod__�divmod(x, y)r��x ** y�x **= y�
__lshift__�x << y�x <<= y�
__rshift__�x >> y�x >>= y�__and__�x & y�x &= y�__or__�x | y�x |= y�__xor__�x ^ y�x ^= yZ__rr^r�Z__ir|�rKrr�rrr�rcrr�r r!r"�r#r$r%�r�r&r'�r(r)r*�r+r,N�r�r-r.�r/r0r1�r2r3r4�r5r6r7�r8r9r:�r;r<r=)r>r?r@rArBrCrDrErFrGrHrIrJrK)rr�maxsizer?)r2rr�ZN1ZN2r5r6ZiexprZrnamer�r;Zinamer|rPr7)rr2r8�test_not_implemented�sH
z.ClassPropertiesAndMethods.test_not_implementedcCs4Gdd�dt�}|�}d|dd�<|j|jd�dS)Nc@seZdZdd�ZdS)z6ClassPropertiesAndMethods.test_assign_slice.<locals>.CcSs
||_dS)N)r�)r2�idxr�r7r7r8rY(szBClassPropertiesAndMethods.test_assign_slice.<locals>.C.__setitem__N)ryrzr{rYr7r7r7r8r|'sr|r_r]r^)r�r=r�)r2r|rPr7r7r8�test_assign_slice"sz+ClassPropertiesAndMethods.test_assign_slicecs�Gdd�dt�}|d��G�fdd�dt�}|�}|j|j��d|_|j|jd�Gdd�dt�}Gd	d�d|d
�}d|_|d�|_|j|jd�dS)Nc@seZdZdd�Zdd�ZdS)z<ClassPropertiesAndMethods.test_set_and_no_get.<locals>.DescrcSs
||_dS)N)r5)r2r5r7r7r8r,4szEClassPropertiesAndMethods.test_set_and_no_get.<locals>.Descr.__init__cSs||j|j<dS)N)rAr5)r2r�r�r7r7r8rq7szDClassPropertiesAndMethods.test_set_and_no_get.<locals>.Descr.__set__N)ryrzr{r,rqr7r7r7r8r2srr;cseZdZ�ZdS)z8ClassPropertiesAndMethods.test_set_and_no_get.<locals>.XN)ryrzr{r;r7)r�r7r8r�;sr�r�c@seZdZdS)z;ClassPropertiesAndMethods.test_set_and_no_get.<locals>.MetaN)ryrzr{r7r7r7r8�MetaDsrPc@seZdZdS)z8ClassPropertiesAndMethods.test_set_and_no_get.<locals>.XN)ryrzr{r7r7r7r8r�Fs)r�)r�r�r;r=r?)r2rr�r�rPr7)r�r8�test_set_and_no_get/s
z-ClassPropertiesAndMethods.test_set_and_no_getcs�Gdd�dt�}|��G�fdd�dt�}G�fdd�dt�}G�fdd�dt�}|jtt|�d	�|j�jd
�|jtt|�d	�|j�jd�|jtt|�d	�|j�jd�G�fd
d�dt��|jtt��d	�dS)Nc@seZdZdZddd�ZdS)z@ClassPropertiesAndMethods.test_getattr_hooks.<locals>.DescriptorrNcs�fdd�}|S)Ncs�jd7_t|��dS)Nr])r�r?)r5)r2r7r8rRszXClassPropertiesAndMethods.test_getattr_hooks.<locals>.Descriptor.__get__.<locals>.getterr7)r2r�Zobjtyperr7)r2r8r�QszHClassPropertiesAndMethods.test_getattr_hooks.<locals>.Descriptor.__get__)N)ryrzr{r�r�r7r7r7r8�
DescriptorOsrRcseZdZ�ZdS)z7ClassPropertiesAndMethods.test_getattr_hooks.<locals>.AN)ryrzr{r	r7)r�r7r8r�Xsr�cseZdZ�ZdS)z7ClassPropertiesAndMethods.test_getattr_hooks.<locals>.BN)ryrzr{r|r7)r�r7r8r�Zsr�cseZdZ�Z�ZdS)z7ClassPropertiesAndMethods.test_getattr_hooks.<locals>.CN)ryrzr{r	r|r7)r�r7r8r|\sr|r�r]r^racs eZdZdd�Z�fdd�ZdS)zFClassPropertiesAndMethods.test_getattr_hooks.<locals>.EvilGetattributecSst|��dS)N)r?)r2r5r7r7r8r|iszRClassPropertiesAndMethods.test_getattr_hooks.<locals>.EvilGetattribute.__getattr__cs*�`xtd�D]}tj�qWt|��dS)Nre)r|r�rdZcollectr?)r2r5rp)�EvilGetattributer7r8r	kszWClassPropertiesAndMethods.test_getattr_hooks.<locals>.EvilGetattribute.__getattribute__N)ryrzr{r|r	r7)rSr7r8rSgsrS)r�rr?r@r=r�)r2rRr�r�r|r7)rSr�r8�test_getattr_hooksLs
z,ClassPropertiesAndMethods.test_getattr_hookscCs|jttjtt�dS)N)rrr?r	r.)r2r7r7r8�test_type___getattribute__ssz4ClassPropertiesAndMethods.test_type___getattribute__c	Cs^|jtttd�Gdd�dt�}|jtt|d�Gdd�dt�}|jt��
|`WdQRXdS)N�__abstractmethods__c@seZdZdS)z<ClassPropertiesAndMethods.test_abstractmethods.<locals>.metaN)ryrzr{r7r7r7r8�metaysrWc@seZdZdS)z9ClassPropertiesAndMethods.test_abstractmethods.<locals>.XN)ryrzr{r7r7r7r8r�|sr�)rr?r@r?r�rV)r2rWr�r7r7r8�test_abstractmethodsvsz.ClassPropertiesAndMethods.test_abstractmethodscCsfGdd�d�}|�}|j|t�|jt��tj|�WdQRX|jt��tj|d�WdQRXdS)Nc@seZdZeZdS)z:ClassPropertiesAndMethods.test_proxy_call.<locals>.FakeStrN)ryrzr{rr�r7r7r7r8�FakeStr�srYrU)r�rrrr�rK)r2rYZfake_strr7r7r8�test_proxy_call�sz)ClassPropertiesAndMethods.test_proxy_callcCs<Gdd�d�}|j|_|�}|jtt|�|jtt|�dS)Nc@seZdZdS)z7ClassPropertiesAndMethods.test_repr_as_str.<locals>.FooN)ryrzr{r7r7r7r8r�sr)r�rnrr�rrm)r2rr�r7r7r8�test_repr_as_str�s
z*ClassPropertiesAndMethods.test_repr_as_strcCs0Gdd�dt�}|�}d|_|j|dd�dS)Nc@seZdZejZdS)z>ClassPropertiesAndMethods.test_mixing_slot_wrappers.<locals>.XN)ryrzr{rlrYrr7r7r7r8r��sr�r�r�)rlr�r=)r2r�r�r7r7r8�test_mixing_slot_wrappers�sz3ClassPropertiesAndMethods.test_mixing_slot_wrappersc
Cs>|jt��}Gdd�d�}WdQRXt|j�}|jd|�dS)Nc@seZdZdgZdZdS)zEClassPropertiesAndMethods.test_slot_shadows_class_variable.<locals>.Xr�N)ryrzr{r�r�r7r7r7r8r��sr�z0'foo' in __slots__ conflicts with class variable)rr.r�	exceptionr=)r2r�r�rGr7r7r8� test_slot_shadows_class_variable�s
z:ClassPropertiesAndMethods.test_slot_shadows_class_variablecCs�Gdd�d�}d|_|j|jd�|jt��}tt�jdjtd�WdQRX|jdt	|j
��|jt��}t|�jdj|�WdQRX|jdt	|j
��|j|jd�dS)Nc@seZdZdS)z1ClassPropertiesAndMethods.test_set_doc.<locals>.XN)ryrzr{r7r7r7r8r��sr�Zbananar
Zblahzcan't set list.__doc__zcan't delete X.__doc__)r
r=rrr?r.rArqrrr]r�)r2r�r�r7r7r8�test_set_doc�s z&ClassPropertiesAndMethods.test_set_doccCs,tjtjtjtjg}ddddg}x,t||�D]\}}|jt	|�j
|d�q,Wx,|D]$}|jjd|j
}|j|j|�qTW|jtjjd�|jtjjd�|jtjjd	�|jtjjd
�Gdd�d�}|j
t��
|`WdQRX|j
tt	jd
jtd�Gdd�d�a|jtjd�|jtjjd�dS)Nr{�memberZgetset�wrapperZ_descriptor�.z	str.lowerzcomplex.realz
float.realzint.__add__c@seZdZdS)z2ClassPropertiesAndMethods.test_qualname.<locals>.XN)ryrzr{r7r7r7r8r��sr�r{ZOinkc@seZdZGdd�d�ZdS)r�c@seZdZdS)zY.InsideN)ryrzr{r7r7r7r8�Inside�srcN)ryrzr{rcr7r7r7r8r��sr�zY.Inside)rrur�r�r&r%rKr/r=r?ryrr{rrrArqr�rc)r2ZdescriptorsrrE�n�qualnamer�r7r7r8�
test_qualname�s&
z'ClassPropertiesAndMethods.test_qualnamecCs^ddi}tdf|�}|j|jd�|jd|j�|j|ddi�ddi}|jttdf|�dS)Nr{z	some.namerr])r?r=r{r�rArr)r2r�r�r7r7r8�test_qualname_dict�sz,ClassPropertiesAndMethods.test_qualname_dictcCsbGdd�dt�}|�}d|_tj|�}~tj�|j|��x tj�D]}|j	t
|�|�qFWdS)Nc@seZdZdd�ZdS)z<ClassPropertiesAndMethods.test_cycle_through_dict.<locals>.XcSstj|�||_dS)N)rlr,rA)r2r7r7r8r,�s
zEClassPropertiesAndMethods.test_cycle_through_dict.<locals>.X.__init__N)ryrzr{r,r7r7r7r8r��sr�r�)rlr�rrrrb�assertIsNonerdr\�assertIsNotr?)r2r�r��wrr�r7r7r8�test_cycle_through_dict�s
z1ClassPropertiesAndMethods.test_cycle_through_dictcCs�Gdd�d�}|jt|d�|jt|dd�Gdd�d�}Gdd�d�}Gd	d
�d
||�}xL|||fD]>}|d�|ddd�|jt|ddd�|jt|dddd
�qfWdS)Nc@seZdZdS)z[ClassPropertiesAndMethods.test_object_new_and_init_with_parameters.<locals>.OverrideNeitherN)ryrzr{r7r7r7r8�OverrideNeither�srlr])r�c@seZdZddd�ZdS)zWClassPropertiesAndMethods.test_object_new_and_init_with_parameters.<locals>.OverrideNewrc_stj|f|�|�S)N)r�r�)r�r�r�r3r�r7r7r8r��sz_ClassPropertiesAndMethods.test_object_new_and_init_with_parameters.<locals>.OverrideNew.__new__N)r)ryrzr{r�r7r7r7r8�OverrideNew�srmc@seZdZddd�ZdS)zXClassPropertiesAndMethods.test_object_new_and_init_with_parameters.<locals>.OverrideInitrc_stj|f|�|�S)N)r�r,)r2r�r�r3r4r7r7r8r,�szaClassPropertiesAndMethods.test_object_new_and_init_with_parameters.<locals>.OverrideInit.__init__N)r)ryrzr{r,r7r7r7r8�OverrideInit�srnc@seZdZdS)zXClassPropertiesAndMethods.test_object_new_and_init_with_parameters.<locals>.OverrideBothN)ryrzr{r7r7r7r8�OverrideBoth�sror^r_)r�)rr)r2rlrmrnroZcaser7r7r8�(test_object_new_and_init_with_parameters�szBClassPropertiesAndMethods.test_object_new_and_init_with_parameterscCs>Gdd�d�}Gdd�d|�}|jd|j�|jd|j�dS)Nc@seZdZdS)z\ClassPropertiesAndMethods.test_subclassing_does_not_duplicate_dict_descriptors.<locals>.BaseN)ryrzr{r7r7r7r8rOsrOc@seZdZdS)z[ClassPropertiesAndMethods.test_subclassing_does_not_duplicate_dict_descriptors.<locals>.SubN)ryrzr{r7r7r7r8rQsrQrA)rrAr�)r2rOrQr7r7r8�4test_subclassing_does_not_duplicate_dict_descriptorsszNClassPropertiesAndMethods.test_subclassing_does_not_duplicate_dict_descriptorscsRGdd�d�}|jt|�j�d�Gdd�d�}Gdd�d|�}Gdd	�d	|�}|�}|�}|�}t||�}|jt|j�d
�|jt|j�d�|jt|j�d�|jt|j�d
�Gdd�d�}|�}	|jt|	j�d�|jt|j�d�Gdd�d�}
|
�}t�}tj||�}
|jt|
�d�d|_|jt|
�d�d|_|jt|
�d�dS)Nc@seZdZdd�ZdS)z=ClassPropertiesAndMethods.test_bound_method_repr.<locals>.FoocSsdS)Nr7)r2r7r7r8r{szDClassPropertiesAndMethods.test_bound_method_repr.<locals>.Foo.methodN)ryrzr{r{r7r7r7r8r
srz4<bound method .*Foo\.method of <.*Foo object at .*>>c@seZdZdd�ZdS)z>ClassPropertiesAndMethods.test_bound_method_repr.<locals>.BasecSsdS)Nr7)r2r7r7r8r{szEClassPropertiesAndMethods.test_bound_method_repr.<locals>.Base.methodN)ryrzr{r{r7r7r7r8rOsrOc@seZdZdS)zBClassPropertiesAndMethods.test_bound_method_repr.<locals>.Derived1N)ryrzr{r7r7r7r8�Derived1srrc@seZdZdd�ZdS)zBClassPropertiesAndMethods.test_bound_method_repr.<locals>.Derived2cSsdS)Nr7)r2r7r7r8r{szIClassPropertiesAndMethods.test_bound_method_repr.<locals>.Derived2.methodN)ryrzr{r{r7r7r7r8�Derived2srsz6<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)z=ClassPropertiesAndMethods.test_bound_method_repr.<locals>.FoocSsdS)Nr7)r�r7r7r8r{*szDClassPropertiesAndMethods.test_bound_method_repr.<locals>.Foo.methodN)ryrzr{r�r{r7r7r7r8r)sz/<bound method .*Foo\.method of <class '.*Foo'>>c@seZdZdd�ZdS)zDClassPropertiesAndMethods.test_bound_method_repr.<locals>.MyCallablecSsdS)Nr7)r2r�r7r7r8r�5szMClassPropertiesAndMethods.test_bound_method_repr.<locals>.MyCallable.__call__N)ryrzr{r�r7r7r7r8�
MyCallable4srtz*<bound method \? of <object object at .*>>r5z,<bound method name of <object object at .*>>rez0<bound method qualname of <object object at .*>>)	ZassertRegexrmr{r�r�r�
MethodTyperyr{)r2rrOrrrsryZderived1Zderived2Zsuper_d2r�rtr��instancer{)r�r7r8�test_bound_method_reprsH



z0ClassPropertiesAndMethods.test_bound_method_repr)zryrzr{r�r�r�r�rrrrr r)r0r<r@rMrirlrsr~r�r�rZ
refcount_testr�r�r�r�r�r�r�r�r�r*ZexpectedFailurer�r�r�r�r�r�r�r�rr�skipIfr�flags�optimizer�cpython_onlyrrr0rGrSrzr�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�r�r�r�r�rrrrr	r
rrrrrMrOrQrTrUrXrZr[r\r^r_rfrgrkrprqrwr�r7r7)r�r8r��s�4X")%
%=K&F<2		"
"A1ib?CS^tN @OYYM
.
',	A( 63,'!4
'

 
r�c@s�eZdZdd�Zejeed�o$ej�d�dd��Z	ejeed�oFej�d�dd��Z
ejeed�ohej�d�d	d
��Zdd�Zd
d�Z
dS)�DictProxyTestscCsGdd�dt�}||_dS)Nc@seZdZdd�ZdS)zDictProxyTests.setUp.<locals>.CcSsdS)Nr7)r2r7r7r8rDGsz$DictProxyTests.setUp.<locals>.C.methN)ryrzr{rDr7r7r7r8r|Fsr|)r�r|)r2r|r7r7r8�setUpEszDictProxyTests.setUp�gettracez#trace function introduces __local__cCsB|jjj�}|j|t�t|�}|j�|j|dddddg�dS)NrAr
rzrjrD)r|rArh�assertNotIsInstancer.�sortr=)r2r�rhr7r7r8�test_iter_keysKszDictProxyTests.test_iter_keyscCs4|jjj�}|j|t�t|�}|jt|�d�dS)Nre)r|rAr�rr.r=r�)r2r�r�r7r7r8�test_iter_valuesVszDictProxyTests.test_iter_valuescCsH|jjj�}|j|t�dd�|D�}|j�|j|dddddg�dS)NcSsg|]}|d�qS)rr7)r(�itemr7r7r8r)esz2DictProxyTests.test_iter_items.<locals>.<listcomp>rAr
rzrjrD)r|rAr/rr.r�r=)r2r�rhr7r7r8�test_iter_items_szDictProxyTests.test_iter_itemscCsNGdd�dt�}Gdd�dt�}Gdd�d|d�}|jt|j�t|j��dS)Nc@seZdZdS)z7DictProxyTests.test_dict_type_with_metaclass.<locals>.BN)ryrzr{r7r7r7r8r�lsr�c@seZdZdS)z7DictProxyTests.test_dict_type_with_metaclass.<locals>.MN)ryrzr{r7r7r7r8r>nsr>c@seZdZdS)z7DictProxyTests.test_dict_type_with_metaclass.<locals>.CN)ryrzr{r7r7r7r8r|psr|)r�)r�r?r=rA)r2r�r>r|r7r7r8�test_dict_type_with_metaclassjsz,DictProxyTests.test_dict_type_with_metaclasscCsbt|jj�}|j|jd�|�|j|jd�|�x,|jjj�D]\}}|jdj||�|�q>WdS)Nz
mappingproxy(�)z
{!r}: {!r})	rmr|rAr�r��endswithr/rr�)r2rr�r�r7r7r8�	test_reprus
zDictProxyTests.test_reprN)ryrzr{r}r*rxrsrr~r�r�r�r�r�r7r7r7r8r|Ds

r|c@seZdZdd�ZdS)�PTypesLongInitTestc
Cs>Gdd�dt�}ytd|�d�WnYnXtjt�dS)Nc@seZdZdd�ZdS)z;PTypesLongInitTest.test_pytype_long_ready.<locals>.UserLongcWsdS)Nr7)r2r3r7r7r8r��szCPTypesLongInitTest.test_pytype_long_ready.<locals>.UserLong.__pow__N)ryrzr{r�r7r7r7r8�UserLong�sr�r)r�rr?r�rK)r2r�r7r7r8�test_pytype_long_ready�sz)PTypesLongInitTest.test_pytype_long_readyN)ryrzr{r�r7r7r7r8r��sr�c@seZdZdd�ZdS)�	MiscTestscsjG��fdd�dt�}Gdd�dt�}Gdd�dt��td|f|�di��|j�jd	�|j�jd
�dS)Ncs"eZdZdd�Z��fdd�ZdS)z7MiscTests.test_type_lookup_mro_reference.<locals>.MyKeycSstd�S)N�mykey)r�)r2r7r7r8r��sz@MiscTests.test_type_lookup_mro_reference.<locals>.MyKey.__hash__cs�f�_dS)N)rB)r2rx)�Base2r�r7r8r]�sz>MiscTests.test_type_lookup_mro_reference.<locals>.MyKey.__eq__N)ryrzr{r�r]r7)r�r�r7r8�MyKey�sr�c@seZdZdZdZdS)z6MiscTests.test_type_lookup_mro_reference.<locals>.Basez	from BaseN)ryrzr{r��mykey2r7r7r7r8rO�srOc@seZdZdZdZdS)z7MiscTests.test_type_lookup_mro_reference.<locals>.Base2z
from Base2N)ryrzr{r�r�r7r7r7r8r��sr�r�rez	from Basez
from Base2)r�r?r=r�r�)r2r�rOr7)r�r�r8�test_type_lookup_mro_reference�sz(MiscTests.test_type_lookup_mro_referenceN)ryrzr{r�r7r7r7r8r��sr�c@s^eZdZfidddfdd�Zdd�Zdd�Zddd	�Zed
d��Zdd
�Z	dd�Z
dd�ZdS)�
PicklingTestsNc
CsB|dkr�|j|�}|rD|j|dtj�|j|dt|�||f�n,|j|dtj�|j|dt|�f|�|j|d|�|dk	r�|jt|d�|�n|j|d�|dk	r�|j	t
|d�|�n|j|d�ndt|�j}	tjt|�|	|	t
kr�dn|	|�ff}|dk	�r||f7}|j|j|�|�|j|j�|�dS)Nr^rr]r_ra)�
__reduce_ex__r=�copyreg�
__newobj_ex__r?�
__newobj__�assertListEqualr.rh�assertDictEqualrl�__base__�_reconstructorr��
__reduce__)
r2�protor�r3r4r��	listitems�	dictitemsZreduce_valueZ	base_typer7r7r8�
_check_reduce�s.



zPicklingTests._check_reducecs(ttjd�}d0�d1d2d��dd3i�G�fd	d
�d
�}|�}x|D]}|j||��qBWx �j�D]\}}t|||�qbWx|D]}|j||��d�q�WGdd
�d
�}|�}x4|D],}|dkr�|jt��|j|�WdQRXq�WG��fdd�d�}|�}x(|D] }|dk�r|j||����qWG�fdd�d�}	G�fdd�d�}
Gdd�d�}Gdd�d�}xZ|D]R}xJ|	|
||fD]:}
|
�}|dk�r�|jtt	f��|j|�WdQRX�q�W�qnWG�fdd�d�}|�}x|D]}|j||���q�WGdd�d�}|�}x8|D]0}|dk�r|jt
��|j|�WdQRX�qWG�fdd�d�}|�}x|D]}|j||�d��qfWGdd �d �}|�}x|D]}|j||d!d��q�WGd"d#�d#�}|�}xV|D]N}|jt
��|j|�WdQRX|dk�r�|jt
��|j�WdQRX�q�WG�fd$d%�d%�}|�}xl|D]d}|dk�rb|j||d�fd�n>|jt��|j|�WdQRX|jt��|j�WdQRX�q>WGd&d'�d't�}|d(d4i�}x"|D]}|j||t|�d*��q�WGd+d,�d,t
�}|d-g�}x"|D]}|j||t
|�d.��qWdS)5Nr]r�r���i-)ZbaconZfish�cheesei�cseZdZ�fdd�ZdS)z%PicklingTests.test_reduce.<locals>.C1cs�S)Nr7)r2)r3r7r8�__getnewargs__�sz4PicklingTests.test_reduce.<locals>.C1.__getnewargs__N)ryrzr{r�r7)r3r7r8rO�srO)r�c@seZdZdd�ZdS)z%PicklingTests.test_reduce.<locals>.C2cSsdS)Nzbad argsr7)r2r7r7r8r��sz4PicklingTests.test_reduce.<locals>.C2.__getnewargs__N)ryrzr{r�r7r7r7r8r��sr�r^cseZdZ��fdd�ZdS)z%PicklingTests.test_reduce.<locals>.C3cs��fS)Nr7)r2)r3r4r7r8�__getnewargs_ex__�sz7PicklingTests.test_reduce.<locals>.C3.__getnewargs_ex__N)ryrzr{r�r7)r3r4r7r8rP�srPcseZdZ�fdd�ZdS)z%PicklingTests.test_reduce.<locals>.C4cs�dfS)Nzbad dictr7)r2)r3r7r8r��sz7PicklingTests.test_reduce.<locals>.C4.__getnewargs_ex__N)ryrzr{r�r7)r3r7r8rS�srScseZdZ�fdd�ZdS)z%PicklingTests.test_reduce.<locals>.C5csd�fS)Nz	bad tupler7)r2)r4r7r8r��sz7PicklingTests.test_reduce.<locals>.C5.__getnewargs_ex__N)ryrzr{r�r7)r4r7r8�C5�sr�c@seZdZdd�ZdS)z%PicklingTests.test_reduce.<locals>.C6cSsfS)Nr7)r2r7r7r8r��sz7PicklingTests.test_reduce.<locals>.C6.__getnewargs_ex__N)ryrzr{r�r7r7r7r8�C6�sr�c@seZdZdd�ZdS)z%PicklingTests.test_reduce.<locals>.C7cSsdS)Nzbad argsr7)r2r7r7r8r��sz7PicklingTests.test_reduce.<locals>.C7.__getnewargs_ex__N)ryrzr{r�r7r7r7r8�C7�sr�cseZdZ�fdd�ZdS)z%PicklingTests.test_reduce.<locals>.C9cs�ifS)Nr7)r2)r3r7r8r�sz7PicklingTests.test_reduce.<locals>.C9.__getnewargs_ex__N)ryrzr{r�r7)r3r7r8�C9sr�c@seZdZdd�ZdS)z&PicklingTests.test_reduce.<locals>.C10cSst�dS)N)r�)r2r7r7r8r�sz8PicklingTests.test_reduce.<locals>.C10.__getnewargs_ex__N)ryrzr{r�r7r7r7r8�C10sr�cseZdZ�fdd�ZdS)z&PicklingTests.test_reduce.<locals>.C11cs�S)Nr7)r2)r�r7r8r�sz3PicklingTests.test_reduce.<locals>.C11.__getstate__N)ryrzr{r�r7)r�r7r8�C11sr�c@seZdZdd�ZdS)z&PicklingTests.test_reduce.<locals>.C12cSsdS)Nznot dictr7)r2r7r7r8r�sz3PicklingTests.test_reduce.<locals>.C12.__getstate__N)ryrzr{r�r7r7r7r8�C12sr�znot dictc@seZdZdd�ZdS)z&PicklingTests.test_reduce.<locals>.C13cSst�dS)N)r�)r2r7r7r8r�&sz3PicklingTests.test_reduce.<locals>.C13.__getstate__N)ryrzr{r�r7r7r7r8�C13%sr�cs eZdZe��Z�fdd�ZdS)z&PicklingTests.test_reduce.<locals>.C14cs&x �j�D]\}}t|||�q
WdS)N)r/r�)r2r5r�)r�r7r8r,2sz/PicklingTests.test_reduce.<locals>.C14.__init__N)ryrzr{rKr�r,r7)r�r7r8�C140sr�c@seZdZdS)z&PicklingTests.test_reduce.<locals>.C15N)ryrzr{r7r7r7r8�C15@sr�ZquebeciY)r�c@seZdZdS)z&PicklingTests.test_reduce.<locals>.C16N)ryrzr{r7r7r7r8�C16Fsr�Zyukon)r����)r�r�i7���i���io���i����)r��pickle�HIGHEST_PROTOCOLr�r/r�rrr�r.r�r�rlr.)r2�	protocolsrOr�r�r5r�r�rPrSr�r�r�r�r�r�r�r�r�r�r�r�r7)r3r4r�r8�test_reduce�s�







 











zPicklingTests.test_reducecCsPttjd�}Gdd�d�}x.|D]&}|dkr2ind}|j||�|d�q"WdS)Nr]c@seZdZdd�Zdd�ZdS)z7PicklingTests.test_special_method_lookup.<locals>.PickycSsiS)Nr7)r2r7r7r8r�OszDPicklingTests.test_special_method_lookup.<locals>.Picky.__getstate__cSs|dkrt|��dS)Nr�r�)r�r�)r�)r2r�r7r7r8r|RszCPicklingTests.test_special_method_lookup.<locals>.Picky.__getattr__N)ryrzr{r�r|r7r7r7r8�PickyNsr�r^)r�)r�r�r�r�)r2r�r�Zprotocolr�r7r7r8r�Ls

z(PicklingTests.test_special_method_lookupcCs|dkrdj||�}t|�jtjkr,td��|j|||d�|jt|�t|�|d�t|d�r�|j|j	|j	|d�|j|j	|j	|d�t|d�r�|j
|j|j|d�xJ|jD]@}|jt||�t||�|d�|jt
||d�t
||d�|d�q�W|jt|�t|�|d�dS)Nz{!r} is not a copy of {!r}z&object passed to _assert_is_copy must zoverride the __repr__ method.)r5rAr�zCobject passed to _assert_is_copy must override the __repr__ method.)r�r?rnr�r.rir�rsr�rAr�r�r=r@rm)r2r��objcopyr5�slotr7r7r8�_assert_is_copyZs$

zPicklingTests._assert_is_copycsDGdd�d���fdd�tjttjd�tjtjhtjtjh�D�S)Nc@s$eZdZdd�Zdd�Zdd�ZdS)z<PicklingTests._generate_pickle_copiers.<locals>.PickleCopiercSs||_||_||_dS)N)r��dumps�loads)r2r�r�r�r7r7r8r,zszEPicklingTests._generate_pickle_copiers.<locals>.PickleCopier.__init__cSs|j|j||j��S)N)r�r�r�)r2r�r7r7r8r�~szAPicklingTests._generate_pickle_copiers.<locals>.PickleCopier.copycSs$dj|j|jj|jj|jj|jj�S)Nz0PickleCopier(proto={}, dumps={}.{}, loads={}.{}))r�r�r�rzr{r�)r2r7r7r8rn�szEPicklingTests._generate_pickle_copiers.<locals>.PickleCopier.__repr__N)ryrzr{r,r�rnr7r7r7r8�PickleCopierxsr�c3s|]}�|�VqdS)Nr7)r(r3)r�r7r8�	<genexpr>�sz9PicklingTests._generate_pickle_copiers.<locals>.<genexpr>r])	�	itertools�productr�r�r�r�Z_dumpsr�Z_loadsr7r7)r�r8�_generate_pickle_copiersts


z&PicklingTests._generate_pickle_copierscCsJGdd�d�a|jt��tjt�d�WdQRXGdd�dt�a|jt��tjt�d�WdQRXGdd�d�aGdd�dt�aGdd	�d	t�ax�|j�D]�}|j|d
���t�}|j	|�}|j
||�d|_|j	|�}|j
||�t�}d|_d|_|j	|�}|j
||�t�}d|_d
|_|j	|�}|j
||�WdQRXq�WdS)Nc@seZdZdgZdS)r|r;N)ryrzr{r�r7r7r7r8r|�sr|rc@seZdZdS)r�N)ryrzr{r7r7r7r8r��sr�c@s*eZdZdgZdd�Zdd�Zdd�ZdS)	r|r;c
Ssht|di�j�}xRt|�jD]D}x>|jjdf�D],}yt||�||<Wq0tk
rZYq0Xq0WqW|S)NrAr�)r@r�r?rrAr�r?)r2r�r�r�r7r7r8r��szC.__getstate__cSs&x |j�D]\}}t|||�q
WdS)N)r/r�)r2r�r�r�r7r7r8r��szC.__setstate__cSsdt|�j|j�fS)Nz%s()<%r>)r?ryr�)r2r7r7r8rn�sz
C.__repr__N)ryrzr{r�r�r�rnr7r7r7r8r|�s	c@seZdZdS)r�N)ryrzr{r7r7r7r8r��sc@seZdZdgZdS)r�rLN)ryrzr{r�r7r7r7r8r��sr�)�
pickle_copierr�rvr�)
r|rrr�r�r�r�r��subTestr�r�r;rL)r2r�r�r�r7r7r8�test_pickle_slots�s6



zPicklingTests.test_pickle_slotsc
CszGdd�d�aGdd�dt�aGdd�dt�aGdd�dt�aGd	d
�d
t�atttttf}|j�}x�tj	||�D]�\}}|j
||d��jt|di�}||j|�}|j
}|j|�}|j||�|d
kr�|jr�|jj�|j|�}	|j||	�WdQRXqrWxx|D]p}|j
|d��Xt|di�}||j|�}t|�}|j||�|j�sf|jj�t|�}	|j||	�WdQRX�qWdS)Ncs,eZdZdZdZ�fdd�Zdd�Z�ZS)	rOr]r^Tcst�j�||_||_dS)N)r�r,r;rL)r2r;rL)r�r7r8r,�s
zC1.__init__cSsd|j|jfS)Nz
C1(%r, %r))r;rL)r2r7r7r8rn�szC1.__repr__)r]r^)ryrzr{�ARGS�NEED_DICT_COPYINGr,rnr�r7r7)r�r8rO�srOcsDeZdZdZdZ�fdd�Z�fdd�Zedd	��Zd
d�Z	�Z
S)
r�r]r^Fcst�j|�}||_||_|S)N)r�r�r;rL)r�r;rLr2)r�r7r8r��sz
C2.__new__cst�j�|jd�dS)Nr�)r�r,ri)r2r3)r�r7r8r,�s
zC2.__init__cSs|jS)N)r�)r�r7r7r8r��szC2.__getnewargs__cSsd|j|jt|�fS)NzC2(%r, %r)<%r>)r;rLr.)r2r7r7r8rn�szC2.__repr__)r]r^)ryrzr{r�r�r�r,r�r�rnr�r7r7)r�r8r��sr�c@s8eZdZd
ZdZdd�Zedd��Zdd	�Zd
d�Z	dS)rPr]r^FcSs||_||_|jd�dS)Nr�)r;rLri)r2r;rLr7r7r8r,�szC3.__init__cSs|jS)N)r�)r�r7r7r8r��szC3.__getstate__cSs|\}}||_||_dS)N)r;rL)r2r�r;rLr7r7r8r�szC3.__setstate__cSsd|j|jt|�fS)NzC3(%r, %r)<%r>)r;rLr.)r2r7r7r8rnszC3.__repr__N)r]r^)
ryrzr{r�r�r,r�r�r�rnr7r7r7r8rP�srPcs8eZdZdZdZ�fdd�Zedd��Zd	d
�Z�Z	S)rSrrr]Fcst�j||�}||_||_|S)N)r�r�r;rL)r�r;rLr�r2)r�r7r8r�
sz
C4.__new__cSs|jS)N)r�)r�r7r7r8r�szC4.__getnewargs__cSsd|j|jt|�fS)NzC4(%r, %r)<%r>)r;rLr%)r2r7r7r8rnszC4.__repr__)rrr])
ryrzr{r�r�r�r�r�rnr�r7r7)r�r8rS	s
rScsFeZdZdZddiZdZdd��fdd	�
Zed
d��Zdd
�Z	�Z
S)r�r]r^r�r_Fr)r�cst�j||�}||_||_|S)N)r�r�r;rL)r�r;rLr�r2)r�r7r8r�sz
C5.__new__cSs|j|jfS)N)r��KWARGS)r�r7r7r8r�#szC5.__getnewargs_ex__cSsd|j|jt|�fS)NzC5(%r, %r)<%r>)r;rLr%)r2r7r7r8rn&szC5.__repr__)r]r^)ryrzr{r�r�r�r�r�r�rnr�r7r7)r�r8r�sr�)r�r�r�r^)r�)rOr.r�rPr%rSr�r�r�r�r�r@r�r�r�r�r�rArr)
r2Ztest_classesZpickle_copiersr�r�r4r�r�r�Zobjcopy2r7r7r8�test_reduce_copying�s8




z!PicklingTests.test_reduce_copyingcs^Gdd�dt��G��fdd�d��ddl}|j�fdddifddf}|j��jd�|�dS)	Nc@seZdZdS)z(PicklingTests.test_issue24097.<locals>.SN)ryrzr{r7r7r7r8r�Nsr�cs$eZdZ�d�gZ��fdd�ZdS)z(PicklingTests.test_issue24097.<locals>.Ar�cs(|dkr �d�g�jdd�<dSt�dS)Nr�r�)�
__slotnames__r?)r2r�)r�r�r7r8r|Rsz4PicklingTests.test_issue24097.<locals>.A.__getattr__N)ryrzr{r�r|r7)r�r�r7r8r�Ps
r�rr�r�r^)rr�r�r=r�)r2r�r3r7)r�r�r8�test_issue24097Ls
	zPicklingTests.test_issue24097)N)ryrzr{r�r�r�r�r�r�r�r�r�r7r7r7r8r��s{
C|r�c@seZdZejdd��ZdS)�SharedKeyTestscCs*Gdd�d�}Gdd�d|�}|�|�}}|jtjt|��tjt|���|jtjt|��tji��td�\|_|_|_|_	|_
|_|jtjt|��tjt|���|�}|jtjt|��tjt|���|jtjt|��tji��td�\|_|_
|_	|_
|_|_|jtjt|��tji��dS)Nc@seZdZdS)z)SharedKeyTests.test_subclasses.<locals>.AN)ryrzr{r7r7r7r8r�csr�c@seZdZdS)z)SharedKeyTests.test_subclasses.<locals>.BN)ryrzr{r7r7r7r8r�esr�rf)r=rr��varsZ
assertLessr�r�r�rc�wr�rrr>rFrfr)r2r�r�r;rLr�r7r7r8�test_subclasses`s     zSharedKeyTests.test_subclassesN)ryrzr{rr{r�r7r7r7r8r�^sr�c@seZdZdd�Zdd�ZdS)�DebugHelperMetacCs&|jd�dkr||d<tj||||�S)Nr
)r�r?r�)r�r5r�rr7r7r8r�zszDebugHelperMeta.__new__cCs
t|j�S)N)rmry)r�r7r7r8rn~szDebugHelperMeta.__repr__N)ryrzr{r�rnr7r7r7r8r�vsr�c@s\eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�ZdS)�MroTestcCsd|_d|_dS)NrF)�step�ready)r2r7r7r8r}�sz
MroTest.setUpcCs |j|k}|r|jd7_|S)Nr])r�)r2�limit�retr7r7r8�
step_until�s
zMroTest.step_untilcs*G�fdd�dt�}Gdd�d|d�}dS)NcseZdZ�fdd�ZdS)z4MroTest.test_incomplete_set_bases_on_self.<locals>.Mcs"�jd�r|jf7_tj|�S)Nr])r�rBr?r�)r�)r2r7r8r��s
z8MroTest.test_incomplete_set_bases_on_self.<locals>.M.mroN)ryrzr{r�r7)r2r7r8r>�sr>c@seZdZdS)z4MroTest.test_incomplete_set_bases_on_self.<locals>.AN)ryrzr{r7r7r7r8r��sr�)r�)r�)r2r>r�r7)r2r8�!test_incomplete_set_bases_on_self�sz)MroTest.test_incomplete_set_bases_on_selfcsJG��fdd�dt�}Gdd�d|d��Gdd�d��}|jf7_dS)NcseZdZ��fdd�ZdS)z/MroTest.test_reent_set_bases_on_base.<locals>.Mcs6|jdk	r,|jdkr,�jd�r,�jf7_tj|�S)Nr�r�)rryr�rBr?r�)r�)r�r2r7r8r��s
z3MroTest.test_reent_set_bases_on_base.<locals>.M.mroN)ryrzr{r�r7)r�r2r7r8r>�sr>c@seZdZdS)z/MroTest.test_reent_set_bases_on_base.<locals>.AN)ryrzr{r7r7r7r8r��sr�)r�c@seZdZdS)z/MroTest.test_reent_set_bases_on_base.<locals>.BN)ryrzr{r7r7r7r8r��sr�)r�rB)r2r>r�r7)r�r2r8�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}|tk	r*�jd�r*|jf7_tj|�S)Nrre)rBr�r�r?r�)r�ry)r2r7r8r��s


z:MroTest.test_reent_set_bases_on_direct_base.<locals>.M.mroN)ryrzr{r�r7)r2r7r8r>�sr>c@seZdZdS)z6MroTest.test_reent_set_bases_on_direct_base.<locals>.AN)ryrzr{r7r7r7r8r��sr�)r�c@seZdZdS)z6MroTest.test_reent_set_bases_on_direct_base.<locals>.BN)ryrzr{r7r7r7r8r��sr�c@seZdZdS)z6MroTest.test_reent_set_bases_on_direct_base.<locals>.CN)ryrzr{r7r7r7r8r|�sr|)r�)r2r>r�r�r|r7)r2r8�#test_reent_set_bases_on_direct_base�s	z+MroTest.test_reent_set_bases_on_direct_basec
sxG���fdd�dt�}Gdd�d|d�}Gdd�d|��Gdd	�d	|��d
�_�jt���jf7_WdQRXdS)NcseZdZ���fdd�ZdS)z5MroTest.test_reent_set_bases_tp_base_cycle.<locals>.Mcs4�jr*|jdkr�f�_|jdkr*�f�_tj|�S)N�B1�B2)r�ryrBr?r�)r�)r�r�r2r7r8r��s

z9MroTest.test_reent_set_bases_tp_base_cycle.<locals>.M.mroN)ryrzr{r�r7)r�r�r2r7r8r>�sr>c@seZdZdS)z5MroTest.test_reent_set_bases_tp_base_cycle.<locals>.AN)ryrzr{r7r7r7r8r��sr�)r�c@seZdZdS)z6MroTest.test_reent_set_bases_tp_base_cycle.<locals>.B1N)ryrzr{r7r7r7r8r��sr�c@seZdZdS)z6MroTest.test_reent_set_bases_tp_base_cycle.<locals>.B2N)ryrzr{r7r7r7r8r��sr�T)r�r�rrrB)r2r>r�r7)r�r�r2r8�"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�j�f��j�j��g��j|j�g��j|j�f��j�j�|g�dS)
NcseZdZ���fdd�ZdS)z;MroTest.test_tp_subclasses_cycle_in_update_slots.<locals>.Mcs(�jr|jdkrd�_�f�_tj|�S)Nr|F)r�ryrBr?r�)r�)r�r|r2r7r8r��sz?MroTest.test_tp_subclasses_cycle_in_update_slots.<locals>.M.mroN)ryrzr{r�r7)r�r|r2r7r8r>�sr>c@seZdZdS)z;MroTest.test_tp_subclasses_cycle_in_update_slots.<locals>.AN)ryrzr{r7r7r7r8r��sr�)r�c@seZdZdS)z<MroTest.test_tp_subclasses_cycle_in_update_slots.<locals>.B1N)ryrzr{r7r7r7r8r��sr�c@seZdZdS)z<MroTest.test_tp_subclasses_cycle_in_update_slots.<locals>.B2N)ryrzr{r7r7r7r8r�sr�c@seZdZdS)z;MroTest.test_tp_subclasses_cycle_in_update_slots.<locals>.CN)ryrzr{r7r7r7r8r|sr|T)r�r�rBr=r�)r2r>r�r�r7)r�r|r2r8�(test_tp_subclasses_cycle_in_update_slots�s	z0MroTest.test_tp_subclasses_cycle_in_update_slotscs�Gdd�dt��G����fdd�dt�}Gdd�d|d�}Gdd	�d	|�}Gd
d�d|��Gdd
�d
|��d�_�j���|f�_WdQRX�f|_�j�j�f��j�jttj	����dS)Nc@seZdZdS)z=MroTest.test_tp_subclasses_cycle_error_return_path.<locals>.EN)ryrzr{r7r7r7r8r�sr�cseZdZ����fdd�ZdS)z=MroTest.test_tp_subclasses_cycle_error_return_path.<locals>.Mcs:�jr0|jdkr0�j�fkr$d�_n�f�_��tj|�S)Nr|F)r�ryrBr?r�)r�)r�r|r�r2r7r8r�szAMroTest.test_tp_subclasses_cycle_error_return_path.<locals>.M.mroN)ryrzr{r�r7)r�r|r�r2r7r8r>sr>c@seZdZdS)z=MroTest.test_tp_subclasses_cycle_error_return_path.<locals>.AN)ryrzr{r7r7r7r8r�"sr�)r�c@seZdZdS)z>MroTest.test_tp_subclasses_cycle_error_return_path.<locals>.B1N)ryrzr{r7r7r7r8r�$sr�c@seZdZdS)z>MroTest.test_tp_subclasses_cycle_error_return_path.<locals>.B2N)ryrzr{r7r7r7r8r�&sr�c@seZdZdS)z=MroTest.test_tp_subclasses_cycle_error_return_path.<locals>.CN)ryrzr{r7r7r7r8r|(sr|T)
r�r�r�rrBr=rrKr?r�)r2r>r�r�r7)r�r|r�r2r8�*test_tp_subclasses_cycle_error_return_paths
z2MroTest.test_tp_subclasses_cycle_error_return_pathcs*G�fdd�dt�}Gdd�d|d�}dS)NcseZdZ�fdd�ZdS)z)MroTest.test_incomplete_extend.<locals>.McsD|jdkr:|jdkr:�jt��Gdd�d|�}WdQRXtj|�S)Nr�c@seZdZdS)z8MroTest.test_incomplete_extend.<locals>.M.mro.<locals>.XN)ryrzr{r7r7r7r8r�=s)rryrrr?r�)r�r�)r2r7r8r�:sz-MroTest.test_incomplete_extend.<locals>.M.mroN)ryrzr{r�r7)r2r7r8r>9sr>c@seZdZdS)z)MroTest.test_incomplete_extend.<locals>.AN)ryrzr{r7r7r7r8r�Bsr�)r�)r�)r2r>r�r7)r2r8�test_incomplete_extend3s	zMroTest.test_incomplete_extendcs*G�fdd�dt�}Gdd�d|d�}dS)NcseZdZ��fdd�Z�ZS)z(MroTest.test_incomplete_super.<locals>.Mc
s6|jdkr,�jt��t||�jWdQRXtj|�S)N)rrr?r�Zxxxr?r�)r�)r�r2r7r8r�Ks
z,MroTest.test_incomplete_super.<locals>.M.mro)ryrzr{r�r�r7)r2)r�r8r>Jsr>c@seZdZdS)z(MroTest.test_incomplete_super.<locals>.AN)ryrzr{r7r7r7r8r�Rsr�)r�)r�)r2r>r�r7)r2r8�test_incomplete_superEszMroTest.test_incomplete_superN)
ryrzr{r}r�r�r�r�r�r�r�r�r�r7r7r7r8r��s$$"r�c	Cstjtttttttt	�dS)N)
rZrun_unittestr�rr�r|r�r�r�r�r7r7r7r8�	test_mainVsr��__main__)r�r�rdr�r�r�rrr*r�rr�rr�rr+rr�r|r�r�r�r�r?r�r�r�ryr7r7r7r8�<module>s~tb<0U