
    daf                    l   d dl Z d dlZd dlZd dlZd dlZd dlZd dlZd dlZd dlZd dl	Z	d dl
Z
d dlZd dlZd dlmZ d dlmZ d dlmZ 	 d dlZ	 d dlZ G d de
j,                        Z G d de
j,                        Z G d	 d
e
j,                        Z G d de
j,                        Z G d de
j,                        Z G d de
j,                        Z G d de
j,                        Z G d de      Z G d de
j,                        Z e!dk(  r e
jD                          yy# e$ r dZY w xY w# e$ r dZY w xY w)    N)deepcopy)redirect_stdout)supportc                   6   e Zd Zd ZddZddZddZddZddZddZ	d Z
d	 Zg fd
Zd Zd Zd Zd Z ej$                  d       ej(                  edu d      d               Z ej$                  d       ej(                  edu d      d               Zd Zy)OperatorsTestc                 :   t        j                  j                  | g|i | i ddddddddd	d
dddddddddddddddddddddddd d!d"d#d$| _        t	        | j                  j                               D ]/  \  }}|j                         r|d%z   }nd&|z  }|| j                  |<   1 ddd'd(d)d*d+| _        t	        | j                  j                               D ]/  \  }}|j                         r|d,z   }nd-|z  }|| j                  |<   1 y ).Nadd+sub-mul*matmul@truediv/floordivz//divmodpowz**lshiftz<<rshiftz>>and&xor^or|cmplt<le<=eq==!=>>=)negtgez(a, b)za %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exprs        */root/Python-3.12.4/Lib/test/test_descr.pyr4   zOperatorsTest.__init__    s   ""49$9&9
3
3
 3
 c	

 s
 
 h
 4
 d
 d
 3
 3
 #
 5
 #
  $!
" $#
$ )
. t{{0023 	%JD$||~h$ $DKK	% 

 tzz//12 	$JD$||~e|}#DJJt	$    c                    d|i}| j                  t        ||      |       t        |      }t        ||      }||j                  vr|j
                  d   }||j                  vr| j                  t        |d|      |j                  |          | j                   ||      |       t        ||      }| j                   |       |       y )Nar   im_funcassertEqualevaltypegetattr__dict__	__bases__)	r:   rB   resr>   methdtmbms	            r?   	unop_testzOperatorsTest.unop_testP   s    !HdA,GAt !**$AA !**$ 	Iq11::d3CD1s#Qs#r@   c                    ||d}| j                  t        ||      |       t        |      }t        ||      }||j                  vr|j
                  d   }||j                  vr| j                  t        |d|      |j                  |          | j                   |||      |       t        ||      }	| j                   |	|      |       y )NrB   br   rC   rD   )
r:   rB   rT   rK   r>   rL   rM   rN   rO   rP   s
             r?   
binop_testzOperatorsTest.binop_test`   s    !dA,GAt!**$AA !**$ 	Iq11::d3CD1a#&QA$r@   c           	         |||d}| j                  t        ||      |       t        |      }t        ||      }	||j                  vr|j
                  d   }||j                  vr| j                  t        |	d|	      |j                  |          | j                   |	|t        ||            |       t        ||      }
| j                   |
t        ||            |       y )NrB   rT   cr   rC   )rE   rF   rG   rH   rI   rJ   slice)r:   rB   rT   rX   rK   r>   rL   rM   rN   rO   rP   s              r?   sliceop_testzOperatorsTest.sliceop_testo   s    !!$dA,GAt!**$AA !**$ 	Iq11::d3CD1eAqk*C0QE!QK#.r@   c                    t        |      |d}t        ||       | j                  |d   |       t        |      }t	        ||      }||j
                  vr|j                  d   }||j
                  vr| j                  t	        |d|      |j
                  |          t        |      |d<    ||d   |       | j                  |d   |       t        |      |d<   t	        |d   |      }	 |	|       | j                  |d   |       y )NrS   rB   r   rC   r   execrE   rG   rH   rI   rJ   )
r:   rB   rT   rK   stmtrL   rM   rN   rO   rP   s
             r?   
setop_testzOperatorsTest.setop_test}   s    1+A&T13%GAt!**$AA !**$ 	Iq11::d3CD!#	!C&!3%!#QsVT"
13%r@   c                    t        |      ||d}t        ||       | j                  |d   |       t        |      }t	        ||      }	||j
                  vr|j                  d   }||j
                  vr| j                  t	        |	d|	      |j
                  |          t        |      |d<    |	|d   ||       | j                  |d   |       t        |      |d<   t	        |d   |      }
 |
||       | j                  |d   |       y )NrW   rB   r   rC   r\   )r:   rB   rT   rX   rK   r^   rL   rM   rN   rO   rP   s              r?   set2op_testzOperatorsTest.set2op_test   s    1+AA.T13%GAt!**$AA !**$ 	Iq11::d3CD!#	!C&!Q3%!#QsVT"
1a3%r@   c                 >   t        |      |||d}t        ||       | j                  |d   |       t        |      }	||	j                  vr|	j
                  d   }	||	j                  vrt        |	|      }
| j                  t        |
d|
      |	j                  |          t        |      |d<    |
|d   t        ||      |       | j                  |d   |       t        |      |d<   t        |d   |      } |t        ||      |       | j                  |d   |       y )N)rB   rT   rX   rM   rB   r   rC   )r   r]   rE   rG   rI   rJ   rH   rY   )r:   rB   rT   rX   rM   rK   r^   rL   
dictionaryrN   rO   rP   s               r?   setsliceop_testzOperatorsTest.setsliceop_test   s
   #A;QQQ?
T:C#.G!**$AA !**$At 	Iq11::d3CD"1+
3	*S/5A;*C#."1+
3Z_d+
5A;C#.r@   c           	      V   | j                  dgdgddgdd       | j                  g ddddd       | j                  g ddd	dd       | j                  g dddd
d       | j                  g dd	dddgdd       | j                  dgdgddgdd       | j                  ddgdg ddd       | j                  g dddd       | j                  ddgdg ddd       | j                  ddgdg ddd       | j	                  ddgddddgdd       | j                  g dddddgg ddd       y ) N      a+b__add__rf   rg      b in a__contains__   r   a[b]__getitem__a[b:c]a+=b__iadd__rk   rf   rg   rf   rg   rf   rg   a*=b__imul__len(a)__len__a*b__mul__b*a__rmul__a[b]=c__setitem__rf   rg   rk   rn         rf   r   r   rn   a[b:c]=d)rU   rZ   r_   rQ   ra   rd   r:   s    r?   
test_listszOperatorsTest.test_lists   s/    	aS1Q%	:Ax@Ax@Av}='1a!A-HaS1Q%<1q-Dw8Y71q-	B1q-
C!A1qeX}EY1qeY
%	'r@   c           	      f   | j                  ddddddd       | j                  ddddddd       | j                  ddddddd	       ddd}g }t        |j                               D ]  }|j                  |        g }t	        |      D ]  }|j                  |        | j                  ||       g }|j                         D ]  }|j                  |        | j                  ||       g }t        j                  |      D ]  }|j                  |        | j                  ||       ddd}| j                  |dd
d       | j                  t        t        |      i       |       | j                  t        |j                         i       |       | j                  ddddddddddd       y )Nrg   rn   rf   rk   rf   rl   rm   r   ro   rp   rw   rx   rk   rj   r}   r~   )rU   r6   keysappenditerrE   __iter__dictrQ   rF   repr__repr__ra   )r:   rM   l1ils        r?   
test_dictszOperatorsTest.test_dicts   s   1q	1a>B1q	1a>B1q	1a?AJaffh 	AIIaL	a 	AHHQK	B 	AHHQK	Bq! 	AHHQK	BAJq!Xy1d1gr*A.ajjlB/3AAqQQ-%	'r@   c                    ||d}| j                   j                         D ]=  \  }}||vsd|z  }t        ||      st        ||      }| j	                  |||||       ? t        | j                  j                               D ]<  \  }}||vsd|z  }t        ||      st        ||      }| j                  ||||       > y )NrS   z__%s__)r5   r7   hasattrrF   rU   r6   r9   rQ   )r:   rB   rT   skipr   r=   r>   rK   s           r?   number_operatorszOperatorsTest.number_operators   s    Q++++- 	;JD$4$1d#tT*COOAq#tT:	; tzz//12 	7JD$4$1d#tT*CNN1c46	7r@   c                 L   | j                  dd       | j                  dj                         d       | j                  dj                         d        G d dt              }| j                   |d      d       	  |       dz    | j	                  d	       y # t
        $ r Y y w xY w)
Nd   rk   rf   r   c                       e Zd Zd Zy)"OperatorsTest.test_ints.<locals>.Cc                     t         S NNotImplementedr:   others     r?   ri   z*OperatorsTest.test_ints.<locals>.C.__add__       %%r@   N)__name__
__module____qualname__ri    r@   r?   Cr          &r@   r   r    z+NotImplemented should have caused TypeError)r   rE   __bool__r-   fail	TypeErrorr:   r   s     r?   	test_intszOperatorsTest.test_ints   s    c1%!+!+	& 	& 	1q!	EC"H IICD  		s   ;
B 	B#"B#c                 (    | j                  dd       y )Ng      Y@      @)r   r   s    r?   test_floatszOperatorsTest.test_floats  s    eS)r@   c                    | j                  ddg d        G d dt              } |dd	      }| j                  t        |      d
       | j                  |j                  d        ||d	      }| j                  t        |      d       | j                  |j                  d        |d      }| j                  t        |      d       | j                  |j                  d       y )Ny              Y@              @)	r   r!   r)   r*   r-   r.   r   r   mod)r   c                   "    e Zd ZdgZd Zd ZeZy),OperatorsTest.test_complexes.<locals>.Numberprecc                 `    t        j                  | g| }|j                  dd      |_        |S )Nr      )complex__new__getr   )clsr;   kwdsresults       r?   r   z4OperatorsTest.test_complexes.<locals>.Number.__new__  s,     4t4"hhvr2r@   c                     | j                   }| j                  dk(  rd|| j                  fz  S | j                  dk(  rd|| j                  fz  S d|| j                  || j                  fz  S )N        %.*gz%.*gjz(%.*g+%.*gj))r   imagreal)r:   r   s     r?   r   z5OperatorsTest.test_complexes.<locals>.Number.__repr__  sg    yy99#!T499$55599#"dDII%666%tyy$		(JJJr@   N)r   r   r   	__slots__r   r   __str__r   r@   r?   Numberr     s    IK Gr@   r   gQ	@r   r   z3.14rg   z3.1g     Pm@z234.5r   )r   r   rE   r   r   )r:   r   rB   s      r?   test_complexeszOperatorsTest.test_complexes  s    fd 2O 	P	W 	 4a a&)#11a%(#5Ma'*$r@   c                     | j                  t        j                  dd      t        dd             | j                  t        j	                  dd      d       y )Nr   g      @r   rf   g       )rE   r   __radd__r.   __rsub__r   s    r?   test_explicit_reverse_methodsz+OperatorsTest.test_explicit_reverse_methods-  sA    ))"c2GC4EFQ/6r@   "the module 'xxsubtype' is internalNrequires xxsubtype modulec           
      :   dd l }dd l}d%d}||j                  |j                  <   | j	                   |dg       |dg       |ddg      dd       | j	                   |g d      dddd	       | j	                   |g d      d
ddd	       | j	                   |g d      dddd       | j                   |g d      dd |ddg      dd       | j                   |dg       |dg       |ddg      dd       | j                   |ddg      d |g d      dd       | j                   |g d      ddd       | j	                   |ddg      d |g d      dd       | j	                   |ddg      d |g d      dd       | j                   |ddg      dd |ddg      dd       | j                   |g d      dd |ddg       |g d      d d        G d! d"|j                        } |       }| j                  |g        | j                  |j                         d       |j                  d#       | j                  |d#g       | j                  |j                         d       |j                  d$       | j                  |j                         d$       y )&Nr   c                 ,    dd l }|j                  |       S Nr   )	xxsubtypespamlist)r   memospams      r?   r   z/OperatorsTest.test_spam_lists.<locals>.spamlist8  s    $==##r@   rf   rg   rh   ri   rj   rl   rm   rn   ro   rp   rq   rr   rs   rk   rt   ru   rv   rw   rx   ry   rz   r{   r|   r}   r~   r   r   r   r   r   c                       e Zd Zd Zy)(OperatorsTest.test_spam_lists.<locals>.Cc                      yNrf   r   r   s    r?   fooz,OperatorsTest.test_spam_lists.<locals>.C.fooU      !r@   Nr   r   r   r   r   r@   r?   r   r   T      #r@   r   r   *   r   )copyr   _deepcopy_dispatchr   rU   rZ   r_   rQ   ra   rd   rE   r   r   getstatesetstate)r:   r   r   r   r   rB   s         r?   test_spam_listszOperatorsTest.test_spam_lists2  sZ    	'	$
 2:.!x}h!uou 	")1a>J)1a>J)1aG(7+Q8QqE?H'	)!x}h!uov"	$!AH],CV"	$x(!XyA!AH],CU!	#!AH],CU"	$1Q%!Q!A&	(Xi0!Q!A%i0*m	M	$ 	$CB!$	SE"q)	

2r*r@   c                    dd l }dd l}dd}||j                  |j                  <   | j	                   |ddd      dddd       | j	                   |ddd      dddd       | j	                   |ddd      ddd	d
        |ddd      }g }t        |j                               D ]  }|j                  |        g }t        |      D ]  }|j                  |        | j                  ||       g }|j                         D ]  }|j                  |        | j                  ||       g }t         |i             j                  |      D ]  }|j                  |        | j                  ||       ddd} ||      }	| j                  |	ddd       | j                  |	t        |      dd       | j                   |ddd      dd |dddd      dd        G d d|j                        }
 |
       }| j                  t        |j                               g        | j                  |j!                         d       d|d<   | j                  t        |j                               dg       | j                  |j#                         d       |j%                  d       | j                  |j#                         d       y )Nr   c                 z    dd l }|j                         }t        | j                               D ]
  \  }}|||<    |S r   )r   spamdictr6   r7   )rM   r   r   sdkvs         r?   r   z/OperatorsTest.test_spam_dicts.<locals>.spamdictd  s;    $BQWWY 11Ir@   rg   rn   r   rf   rl   rm   ro   rp   rw   rx   zrepr(a)r   rk   rj   r}   r~   c                       e Zd Zd Zy)(OperatorsTest.test_spam_dicts.<locals>.Cc                      yr   r   r   s    r?   r   z,OperatorsTest.test_spam_dicts.<locals>.C.foo  r   r@   Nr   r   r@   r?   r   r     r   r@   r   barr   r   r   r   r   )r   r   r   r   rU   r6   r   r   r   rE   r   rG   rQ   r   ra   r7   r   r   r   )r:   r   r   r   rM   r   r   r   	straightdspamdr   rB   s               r?   test_spam_dictszOperatorsTest.test_spam_dicts_  si    	'	 2:.A+Q8^LA+Q8^LA+Q6=IAYaffh 	AIIaL	a 	AHHQK	B 	AHHQK	Bhrl#,,Q/ 	AHHQK	BAJ	#ua95ud9oy*EQ),aHA]4K]	,	$ 	$Caggi"-!$%aggi>*:;q)	

3s+r@   c                     | j                  t        t        j                        j	                         t        j                         y r   )rE   rangesysmaxsizerx   r   s    r?   test_wrap_lenfunc_bad_castz(OperatorsTest.test_wrap_lenfunc_bad_cast  s(    s{{+335s{{Cr@   )rw   rx   )rh   ri   )rq   rp   )rr   rs   )r}   r~   )r   r~   )r   r   r   r4   rQ   rU   rZ   r_   ra   rd   r   r   r   r   r   r   r   r   impl_detailr2   skipIfr   r   r   r   r   r@   r?   r   r      s    .$`$ %/&&&&/&'"'< +- 7"E$*%B7
 W=>X__Y$&(CD)+ E ?)+V W=>X__Y$&(CD/, E ?/,bDr@   r   c                   `    e Zd Zd Zd Zd Zd Zd Zd Zd Z	d Z
d	 Zd
 Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Z fdZej2                  d        Z ej6                  d       ej:                  edu d      d               Zd Z ej2                  d        Z! ej6                  d       ej:                  edu d      d               Z"d Z#d Z$d  Z%ejL                  d!        Z'd" Z(ejL                  d#        Z)d$ Z*d% Z+d& Z,d' Z- ej6                  d(      d)        Z.d* Z/d+ Z0d, Z1d- Z2 ej:                  e3jh                  jj                  d.k\  d/      d0        Z6ejn                  d1        Z8d2 Z9d3 Z:d4 Z; fd5Z<d6 Z=d7 Z>d8 Z?d9 Z@d: ZAd; ZBd< ZCd= ZDd> ZEd? ZFd@ ZGdA ZHdB ZIdC ZJdD ZKdE ZLdF ZMdG ZNdH ZOdI ZPdJ ZQdK ZRdL ZSdM ZTdN ZUdO ZVdP ZWdQ ZXdR ZYdS ZZdT Z[dU Z\dV Z]dW Z^dX Z_dY Z`dZ Zad[ Zbd\ Zcd] Zdd^ Ze ej6                  d_      d`        Zfda Zgdb Zhdc Zidd Zjde Zkdf Zl ej                  dg      dh        Zndi Zodj Zpdk Zqdl Zrdm Zsdn Ztdo Zudp Zvdq Zwdr Zxds Zydt Zzdu Z{dv Z|dw Z}dx Z~dy Zdz Zd{ Zd| Zd} Zd~ Zd Zd Zd Z fdZ ej:                  edu d      d        Zd Zd Z xZS )ClassPropertiesAndMethodsc                 F    | j                  t        ||      |d|       y )Nz has no attribute )
assertTruer   r:   objr=   s      r?   assertHasAttrz'ClassPropertiesAndMethods.assertHasAttr  s     T*47>	@r@   c                 F    | j                  t        ||      |d|       y )Nz has unexpected attribute )assertFalser   r   s      r?   assertNotHasAttrz*ClassPropertiesAndMethods.assertNotHasAttr  s"    d+=@$G	Ir@   c                      j                  t        t        t                      j                  i t               t               } j	                  |i         j                  |j                  t                j                  |t                G  fddt              } j                  t        |t                      |d      } j	                  |j                  d        |dd      } j	                  |d   dk(  xr |d   d        |       } j	                  |j                  d	        j	                  |j                         d	       |j                  d
        j	                  |j                  d
        j	                  |j                         d
       |j                  d        j	                  |j                  d        j	                  |j                         d        j	                  |d   d
       d|d<    j	                  |d   d       d}t        |      D ]'  } |       ||<   t        |      D ]  }||z  ||   |<    ) t        |      D ]-  }t        |      D ]  } j	                  ||   |   ||z          / y )Nc                   8    e Zd ZdZ fdZd Z fdZd Zd Zy)6ClassPropertiesAndMethods.test_python_dicts.<locals>.Cc                     |r%j                  t        |      d       |d   | _        |r't        |j	                               D ]
  \  }}|| |<    y y Nrf   r   )rE   lenstater6   r7   )
self_localrB   kwr   r   r:   s        r?   r4   z?ClassPropertiesAndMethods.test_python_dicts.<locals>.C.__init__  sU    $$SVQ/'(tJ$ $RXXZ 0 *1()
1* r@   c                 &    | j                  |d      S r   )r   r:   keys     r?   rp   zBClassPropertiesAndMethods.test_python_dicts.<locals>.C.__getitem__  s    xxQ''r@   c                 `    j                  |t               t        j                  | ||       y r   )assertIsInstancer-   r   r~   )r  r  valuer:   s      r?   r~   zBClassPropertiesAndMethods.test_python_dicts.<locals>.C.__setitem__  s%    %%c3/  S%8r@   c                     || _         y r   r
  r:   r
  s     r?   r   z?ClassPropertiesAndMethods.test_python_dicts.<locals>.C.setstate  	    "
r@   c                     | j                   S r   r  r   s    r?   r   z?ClassPropertiesAndMethods.test_python_dicts.<locals>.C.getstate      zz!r@   N)	r   r   r   r
  r4   rp   r~   r   r   r   s   r?   r   r    s!    E*(9#"r@   r   r   rf   rg   r   r   r   r  r   
   r      2   )r   
issubclassr   r  rE   assertIs	__class__r
  r   r   r   )	r:   rM   r   a1a2rB   Nr   js	   `        r?   test_python_dictsz+ClassPropertiesAndMethods.test_python_dicts  s    
4./b$'FBakk4(a&	" 	"$ 	
1d+,rU2&1!_A%1BqE59C"%r*	

1!$q)	

2"%r*2""2#q 	A3AaD1X A#!Q	 q 	/A1X /  1a!A#./	/r@   c                      G d dt               } |       }|j                  g d       | j                  |d   d       | j                  |d   d       | j                  |d   d	       | j                  |dd
 d       y )Nc                       e Zd Zd Zy)6ClassPropertiesAndMethods.test_python_lists.<locals>.Cc                     t        |t              r|j                  |j                  fS t        j                  | |      dz   S Nr   )
isinstancerY   startstopr6   rp   r:   r   s     r?   rp   zBClassPropertiesAndMethods.test_python_lists.<locals>.C.__getitem__  s6    a'77AFF?*''a0366r@   Nr   r   r   rp   r   r@   r?   r   r&    s    7r@   r   r   rf   rg   r   r   rf   e   rg   f      )r   r1  )r6   extendrE   r:   r   rB   s      r?   test_python_listsz+ClassPropertiesAndMethods.test_python_lists  su    	7 	7
 C	1s#1s#1s#3sY/r@   c                     G d dt               } |       }| j                  |j                         d       |j                  d       | j                  |j                         d        G d dt               } G d d	|      }| j                  |j	                         |        |       }| j                  |j
                  |        G d
 dt               } G d d|      }| j                  |j                  d        |       }| j                  |j                  d        G d dt               G fddt              } G d d|      }| j                  |j                  d       | j                  |j                  d       | j                  d|j                          |       }| j                  |j                         d        G fddt                G d d      }	 G d d|	      }
 G d d|	      } G d d	||
      }| j                   |       j                         d        G d d |
|      }| j                   |       j                         d!        G fd"d#t                G d$ d      }	 |	       }| j                  |d%       d&|_        | j                  |j                  d&       | j                  |j                   d'        G d( d)      } G d* d|      }	 G d+ d|	      }
 G d, d|	      } G d- d	||
      }| j                   |       j                  d        G fd.d/t                G d0 d      }| j                  j"                  d        |       }| j                  t        |      |       | j                  j"                  d        G d1 dt              } |       } |        | j%                  d2        G d3 dt               }	 G d4 dt              }
 G d5 dt        |	      } G d6 d	|
|      }| j)                  |	t        |             g  G fd7d8t               } G fd9d:|      } G d; d|      }	| j                  d8g       j+                           G d< d|      }
| j                  d:d8g       j+                           G d= d|	|
      }| j                  d:d8g       j+                          | j                  d>|j,                          G d? d@|
|	      }| j                  d:d8g       j+                          | j                  d>|j,                          G dA d	|t               }| j                  d:d8g       j+                          | j                  d>|j,                          G dB d ||      }| j                  d:d8g       j+                          | j                  d>|j,                         t               fdC} G dD dE|      } G dF dGt        |      } G dH dI||      }| j)                  |       | j)                  |       | j)                  |       g  G fdJdK      } G fdLdM|      } G dN d|      }	| j)                  |t        |	             | j                  dKg       j+                          | j                  dKg       j+                           G dO d|      }
| j)                  |t        |
             | j                  dMdKg       j+                          | j                  dMdKg       j+                           G dP d|	|
      }| j)                  |t        |             | j                  dMdKg       j+                          | j                  dMdKg       j+                           G dQ d@|
|	      }| j)                  |t        |             | j                  dMdKg       j+                          | j                  dMdKg       j+                          | j/                  t&              5   G dR d	|t               }d d d         G dS d ||      }| j)                  |t        |             | j                  dMdKg       j+                          | j                  dMdKg       j+                           G dT dUt               |      }| j)                  |t        |             | j                  dMdKg       j+                          | j                  dMdKg       j+                           G dV dW|t                     }| j)                  |t        |             | j                  dMdKg       j+                          | j                  dMdKg       j+                          | j/                  t&              5   G dX dE|t1                     }d d d        | j/                  t&              5   G dY dEt1               |      }d d d        y # t&        $ r Y Ow xY w# 1 sw Y   xY w# 1 sw Y   YxY w# 1 sw Y   y xY w)ZNc                       e Zd Zd Zd Zd Zy)3ClassPropertiesAndMethods.test_metaclass.<locals>.Cc                     d| _         y r   	_C__stater   s    r?   r4   z<ClassPropertiesAndMethods.test_metaclass.<locals>.C.__init__  	     r@   c                     | j                   S r   r9  r   s    r?   r   z<ClassPropertiesAndMethods.test_metaclass.<locals>.C.getstate      ||#r@   c                     || _         y r   r9  r  s     r?   r   z<ClassPropertiesAndMethods.test_metaclass.<locals>.C.setstate  	    $r@   Nr   r   r   r4   r   r   r   r@   r?   r   r7        !$%r@   r   	metaclassr   r  c                       e Zd Zd Zy)<ClassPropertiesAndMethods.test_metaclass.<locals>._metaclassc                     | S r   r   r   s    r?   myselfzCClassPropertiesAndMethods.test_metaclass.<locals>._metaclass.myself  s    CZr@   N)r   r   r   rH  r   r@   r?   
_metaclassrE    s    'r@   rI  c                       e Zd Zy3ClassPropertiesAndMethods.test_metaclass.<locals>.DNr   r   r   r   r@   r?   DrL        r@   rN  c                       e Zd Zd Zy)4ClassPropertiesAndMethods.test_metaclass.<locals>.M1c                 <    d|d<   t         j                  | |||      S )Nrf   __spam__rG   r   )r   r=   basesr   s       r?   r   z<ClassPropertiesAndMethods.test_metaclass.<locals>.M1.__new__  s!    #$Z ||Cud;;r@   Nr   r   r   r   r   r@   r?   M1rQ    s    <r@   rW  c                       e Zd Zyr7  NrM  r   r@   r?   r   z3ClassPropertiesAndMethods.test_metaclass.<locals>.C  rO  r@   rf   c                       e Zd Zy);ClassPropertiesAndMethods.test_metaclass.<locals>._instanceNrM  r   r@   r?   	_instancer[     rO  r@   r\  c                   (    e Zd Zed        Z fdZy)4ClassPropertiesAndMethods.test_metaclass.<locals>.M2c                 Z    t         j                  |       }||_        ||_        ||_        |S r   )objectr   r=   rU  r   )r   r=   rU  r   r:   s        r?   r   z<ClassPropertiesAndMethods.test_metaclass.<locals>.M2.__new__  s*    ~~c* 	"
 	r@   c           	                  }| j                   D ]>  }|j                  d      rt        ||| j                   |   j                  ||              @ |S )N__)r   
startswithsetattr__get__)r:   itr  r\  s      r?   __call__z=ClassPropertiesAndMethods.test_metaclass.<locals>.M2.__call__
  sV    [99 GC~~d+ BTYYs^%;%;B%EFG 	r@   N)r   r   r   staticmethodr   rg  )r\  s   r?   M2r^    s     r@   ri  c                       e Zd Zd Zy)r7  c                      yNr   r   r   s    r?   r   z8ClassPropertiesAndMethods.test_metaclass.<locals>.C.spam      r@   Nr   r   r   r   r   r@   r?   r   z3ClassPropertiesAndMethods.test_metaclass.<locals>.C      r@   r   r   r   c                   "     e Zd Z fdZ xZS );ClassPropertiesAndMethods.test_metaclass.<locals>.autosuperc                     t         |   | |||      }|d d dk(  r|dd  }|d d dk(  r|rd|z  }nd}t        ||t        |             |S )Nrf   _z
_%s__super__super)superr   rd  )rC  r=   rU  r   r   r  	autosupers        r?   r   zCClassPropertiesAndMethods.test_metaclass.<locals>.autosuper.__new__   sn    Iy9):>tM 2Ah#o8D 2Ah#o'$.D$DT5:.
r@   r   r   r   r   __classcell__)r  rv  s   @r?   rv  rq    s     r@   rv  c                       e Zd Zd Zy)3ClassPropertiesAndMethods.test_metaclass.<locals>.Ac                      yNAr   r   s    r?   rL   z8ClassPropertiesAndMethods.test_metaclass.<locals>.A.meth-      r@   Nr   r   r   rL   r   r@   r?   r}  rz  ,      r@   r}  c                       e Zd Zd Zy)3ClassPropertiesAndMethods.test_metaclass.<locals>.Bc                 <    d| j                   j                         z   S NB	_B__superrL   r   s    r?   rL   z8ClassPropertiesAndMethods.test_metaclass.<locals>.B.meth0      T\\..000r@   Nr  r   r@   r?   r  r  /      1r@   r  c                       e Zd Zd Zy)r7  c                 <    d| j                   j                         z   S Nr   	_C__superrL   r   s    r?   rL   z8ClassPropertiesAndMethods.test_metaclass.<locals>.C.meth3  r  r@   Nr  r   r@   r?   r   z3ClassPropertiesAndMethods.test_metaclass.<locals>.C2  r  r@   c                       e Zd Zd Zy)rL  c                 <    d| j                   j                         z   S NrN  )	_D__superrL   r   s    r?   rL   z8ClassPropertiesAndMethods.test_metaclass.<locals>.D.meth6  r  r@   Nr  r   r@   r?   rN  z3ClassPropertiesAndMethods.test_metaclass.<locals>.D5  r  r@   DCBAc                       e Zd Zd Zy)3ClassPropertiesAndMethods.test_metaclass.<locals>.Ec                 <    d| j                   j                         z   S )NE)	_E__superrL   r   s    r?   rL   z8ClassPropertiesAndMethods.test_metaclass.<locals>.E.meth:  r  r@   Nr  r   r@   r?   r  r  9  r  r@   r  EBCAc                   "     e Zd Z fdZ xZS )>ClassPropertiesAndMethods.test_metaclass.<locals>.autopropertyc                    i }|j                         D ]o  \  }}|j                  d      r$|dd  }|j                  |d      \  }}|}||f||<   ;|j                  d      sM|dd  }|j                  |d      \  }}|}||f||<   q |j                         D ]  \  }\  }}t        ||      ||<    t        
|   | |||      S )N_get_r   NN_set_)r7   rc  r   propertyru  r   )rC  r=   rU  r   hitsr  valr   setr  autopropertys            r?   r   zFClassPropertiesAndMethods.test_metaclass.<locals>.autoproperty.__new__A  s     $

 
-HC~~g.!!"g#'88C#>S!$'HS	0!!"g#'88C#>S!$'HS	
- (,zz| 3OC#s (c 2DI3\9=i<@%O Or@   rw  )r  r  s   @r?   r  r  >  s    O Or@   r  c                       e Zd Zd Zd Zy)rz  c                     | j                    S r   _A__xr   s    r?   _get_xz:ClassPropertiesAndMethods.test_metaclass.<locals>.A._get_xS  s    y r@   c                     | | _         y r   r  r:   xs     r?   _set_xz:ClassPropertiesAndMethods.test_metaclass.<locals>.A._set_xU  s    2r@   N)r   r   r   r  r  r   r@   r?   r}  z3ClassPropertiesAndMethods.test_metaclass.<locals>.AR  s    !r@   r  r   ic                       e Zd Zy)@ClassPropertiesAndMethods.test_metaclass.<locals>.multimetaclassNrM  r   r@   r?   multimetaclassr  ]      r@   r  c                       e Zd Zd Zy)rz  c                      yr|  r   r   s    r?   r  z:ClassPropertiesAndMethods.test_metaclass.<locals>.A._get_xa  r~  r@   Nr   r   r   r  r   r@   r?   r}  z3ClassPropertiesAndMethods.test_metaclass.<locals>.A`  r  r@   c                       e Zd Zd Zy)r  c                 <    d| j                   j                         z   S r  )r  r  r   s    r?   r  z:ClassPropertiesAndMethods.test_metaclass.<locals>.B._get_xd      T\\00222r@   Nr  r   r@   r?   r  z3ClassPropertiesAndMethods.test_metaclass.<locals>.Bc      3r@   c                       e Zd Zd Zy)r7  c                 <    d| j                   j                         z   S r  )r  r  r   s    r?   r  z:ClassPropertiesAndMethods.test_metaclass.<locals>.C._get_xg  r  r@   Nr  r   r@   r?   r   z3ClassPropertiesAndMethods.test_metaclass.<locals>.Cf  r  r@   c                       e Zd Zd Zy)rL  c                 <    d| j                   j                         z   S r  )r  r  r   s    r?   r  z:ClassPropertiesAndMethods.test_metaclass.<locals>.D._get_xj  r  r@   Nr  r   r@   r?   rN  z3ClassPropertiesAndMethods.test_metaclass.<locals>.Di  r  r@   c                       e Zd ZdZ fdZy)3ClassPropertiesAndMethods.test_metaclass.<locals>.Tr   c                 0    xj                   dz  c_         y r   counter)r:   r;   Ts     r?   r4   z<ClassPropertiesAndMethods.test_metaclass.<locals>.T.__init__q  s    		Q	r@   N)r   r   r   r  r4   )r  s   r?   r  r  o  s    Gr@   r  c                       e Zd ZyrY  rM  r   r@   r?   r   z3ClassPropertiesAndMethods.test_metaclass.<locals>.Cs  rO  r@   c                       e Zd ZyrY  rM  r   r@   r?   r   z3ClassPropertiesAndMethods.test_metaclass.<locals>.Cz      r@   z5calling object w/o call method should raise TypeErrorc                       e Zd Zd Zy)rz  c                  ,    t        j                  | i |S r   rT  r;   r<   s     r?   r   z;ClassPropertiesAndMethods.test_metaclass.<locals>.A.__new__  s    ||T4V44r@   NrV  r   r@   r?   r}  z3ClassPropertiesAndMethods.test_metaclass.<locals>.A      5r@   c                       e Zd Zyr  NrM  r   r@   r?   r  z3ClassPropertiesAndMethods.test_metaclass.<locals>.B  rO  r@   c                       e Zd ZyrY  rM  r   r@   r?   r   z3ClassPropertiesAndMethods.test_metaclass.<locals>.C  rO  r@   c                       e Zd ZyrK  rM  r   r@   r?   rN  z3ClassPropertiesAndMethods.test_metaclass.<locals>.D  rO  r@   c                   <     e Zd Ze fd       Zed        Z xZS )7ClassPropertiesAndMethods.test_metaclass.<locals>.AMetac                 J    j                  d       t        | 	  | |||      S )NAMetar   ru  r   mclsr=   rU  nsr  	new_callss       r?   r   z?ClassPropertiesAndMethods.test_metaclass.<locals>.AMeta.__new__  &      )wtT5"==r@   c                     i S r   r   )r  r=   rU  s      r?   __prepare__zCClassPropertiesAndMethods.test_metaclass.<locals>.AMeta.__prepare__  s    	r@   r   r   r   rh  r   classmethodr  rx  r  r  s   @r?   r  r    s)    > >  r@   r  c                   @     e Zd Ze fd       Ze fd       Z xZS )7ClassPropertiesAndMethods.test_metaclass.<locals>.BMetac                 J    j                  d       t        | 	  | |||      S )NBMetar  r  s       r?   r   z?ClassPropertiesAndMethods.test_metaclass.<locals>.BMeta.__new__  r  r@   c                 2    t         |   ||      }d|d<   |S )NTBMeta_was_here)ru  r  )r  r=   rU  r  r  s       r?   r  zCClassPropertiesAndMethods.test_metaclass.<locals>.BMeta.__prepare__  s$    W(u5'+#$	r@   r  r  s   @r?   r  r    s)    > >  r@   r  c                       e Zd Zyrz  NrM  r   r@   r?   r}  z3ClassPropertiesAndMethods.test_metaclass.<locals>.A  rO  r@   c                       e Zd Zyr  rM  r   r@   r?   r  z3ClassPropertiesAndMethods.test_metaclass.<locals>.B  rO  r@   c                       e Zd ZyrY  rM  r   r@   r?   r   z3ClassPropertiesAndMethods.test_metaclass.<locals>.C  rO  r@   r  c                       e Zd Zy4ClassPropertiesAndMethods.test_metaclass.<locals>.C2NrM  r   r@   r?   C2r    rO  r@   r  c                       e Zd ZyrK  rM  r   r@   r?   rN  z3ClassPropertiesAndMethods.test_metaclass.<locals>.D  rO  r@   c                       e Zd Zyr  NrM  r   r@   r?   r  z3ClassPropertiesAndMethods.test_metaclass.<locals>.E  rO  r@   c                      S r   r   )r;   r<   markers     r?   funcz6ClassPropertiesAndMethods.test_metaclass.<locals>.func  s    Mr@   c                       e Zd Zy3ClassPropertiesAndMethods.test_metaclass.<locals>.XNrM  r   r@   r?   Xr    rO  r@   r  c                       e Zd Zy)3ClassPropertiesAndMethods.test_metaclass.<locals>.YNrM  r   r@   r?   Yr    rO  r@   r  c                       e Zd Zy)3ClassPropertiesAndMethods.test_metaclass.<locals>.ZNrM  r   r@   r?   Zr    rO  r@   r  c                   6     e Zd Z fdZefd       Z xZS ):ClassPropertiesAndMethods.test_metaclass.<locals>.ANotMetac                 D    j                  d       t        | 	  |       S NANotMetar  r  r;   r<   r  r  s      r?   r   zBClassPropertiesAndMethods.test_metaclass.<locals>.ANotMeta.__new__         ,wt,,r@   c                 *    j                  d       i S r  r   )r  r=   rU  prepare_callss      r?   r  zFClassPropertiesAndMethods.test_metaclass.<locals>.ANotMeta.__prepare__  s    $$Z0	r@   r   r   r   r   r  r  rx  r  r  r  s   @r?   r  r    s    -  r@   r  c                   8     e Zd Z fdZe fd       Z xZS ):ClassPropertiesAndMethods.test_metaclass.<locals>.BNotMetac                 D    j                  d       t        | 	  |       S NBNotMetar  r   s      r?   r   zBClassPropertiesAndMethods.test_metaclass.<locals>.BNotMeta.__new__  r  r@   c                 F    j                  d       t        | 	  ||      S r
  )r   ru  r  )r  r=   rU  r  r  s      r?   r  zFClassPropertiesAndMethods.test_metaclass.<locals>.BNotMeta.__prepare__  s#    $$Z0w*477r@   r  r  s   @r?   r  r    s    - 8 8r@   r  c                       e Zd Zyr  rM  r   r@   r?   r}  z3ClassPropertiesAndMethods.test_metaclass.<locals>.A  rO  r@   c                       e Zd Zyr  rM  r   r@   r?   r  z3ClassPropertiesAndMethods.test_metaclass.<locals>.B  rO  r@   c                       e Zd ZyrY  rM  r   r@   r?   r   z3ClassPropertiesAndMethods.test_metaclass.<locals>.C  rO  r@   c                       e Zd Zyr  rM  r   r@   r?   r  z4ClassPropertiesAndMethods.test_metaclass.<locals>.C2	  rO  r@   c                       e Zd ZyrK  rM  r   r@   r?   rN  z3ClassPropertiesAndMethods.test_metaclass.<locals>.D      r@   c                       e Zd Zyr  rM  r   r@   r?   r  z3ClassPropertiesAndMethods.test_metaclass.<locals>.E  rO  r@   c                       e Zd Zy)3ClassPropertiesAndMethods.test_metaclass.<locals>.FNrM  r   r@   r?   Fr    rO  r@   r  c                       e Zd Zy)4ClassPropertiesAndMethods.test_metaclass.<locals>.F2NrM  r   r@   r?   F2r  '  rO  r@   r  c                       e Zd Zyr  rM  r   r@   r?   r  z3ClassPropertiesAndMethods.test_metaclass.<locals>.X2  r  r@   c                       e Zd Zyr  rM  r   r@   r?   r  z3ClassPropertiesAndMethods.test_metaclass.<locals>.X5  r  r@   )rG   rE   r   r   rH  r  rS  r`  r=   rU  assertInr   r   rL   r  r  r  r  r   r   r  clearrI   assertRaisesr-   )r:   r   rB   rI  rN  rM   rW  rX   ri  r}  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r\  r  rv  r  r  r  s                           @@@@@@@r?   test_metaclassz(ClassPropertiesAndMethods.test_metaclass  s   	%$ 	% Cq)	

2r*	( 	(	* 	Q'Ca(	< 	<	" 	Q'CQ'	 		 	 	" 	 	%"%faff%C2&	 		) 		1 	1	1 	1	11 	1 	V,	11 	1 	V,	O4 	O(	, 	
 Ca%b!#&	\9 		. 		3 	3	3 	3	31 	3 	'	 		! 	A&Ca!$A&CSii $ %	5 	5	 		! 		1 	aa! 		D 			E 			% 	'I.	% 	 	'7+Y7	1 	 	'7+Y7&

3	A 	'7+Y7&4	T 	'7+Y7&

3	U 	'7+Y7&

3 		$ 		$ 		T 	fa fa fa  	 		8x 	8	( 	hQ(*}5*y1	( 	hQ(*j1=A*j19=	1 	hQ(*j19=*j1=A	A 	hR)*j19=*j1=A y) 	A 		X 	hQ(*j19=*j1=A	! 	hQ(*j19=*j1=A	FH 	hR)*j19=*j1=A y) 	Asu 	 y) 	CE1 	 	o $l	 	<	 		 	s6   h ?h,h9>i	h)(h),h69iic                   	
 g 
t        t              	 G 	
fdd	      } |d      }d|_        |j                  }|`| j                  
g d       	  G d dt        j
                  t              }| j                  d       d	 } G d
 d      }t        d      D cg c]  }t         |       |fi        }}| j                  |j                         |       y # t        $ r Y bw xY wc c}w )Nc                   <    e Zd Z fdZ fdZ fdZ fdZy)<ClassPropertiesAndMethods.test_module_subclasses.<locals>.MMc                 *    j                  | |       y r   )r4   )r:   r=   MTs     r?   r4   zEClassPropertiesAndMethods.test_module_subclasses.<locals>.MM.__init__=  s    D$'r@   c                 N    j                  d|f       j                  | |      S )NrH   )r   __getattribute__r:   r=   r$  logs     r?   r&  zMClassPropertiesAndMethods.test_module_subclasses.<locals>.MM.__getattribute__?  s'    

It,-**466r@   c                 T    j                  d||f       j                  | ||       y )Nrd  )r   __setattr__)r:   r=   r  r$  r(  s      r?   r*  zHClassPropertiesAndMethods.test_module_subclasses.<locals>.MM.__setattr__B  s&    

ItU34tT51r@   c                 P    j                  d|f       j                  | |       y )Ndelattr)r   __delattr__r'  s     r?   r-  zHClassPropertiesAndMethods.test_module_subclasses.<locals>.MM.__delattr__E  s"    

It,-tT*r@   N)r   r   r   r4   r&  r*  r-  )r$  r(  s   r?   MMr"  <  s    (72+r@   r.  rB   r   ))rd  r   r   rH   r   )r,  r   c                       e Zd Zy)@ClassPropertiesAndMethods.test_module_subclasses.<locals>.ModuleNrM  r   r@   r?   Moduler1  R  r  r@   r2  z?inheriting from ModuleType and str at the same time should failc                  j    dj                  t        j                  t        j                  d            S )Nr   r  )r   )joinrandomchoicesstringascii_lettersr   r@   r?   random_namezEClassPropertiesAndMethods.test_module_subclasses.<locals>.random_name[  s"    776>>&*>*>"EFFr@   c                       e Zd Zy);ClassPropertiesAndMethods.test_module_subclasses.<locals>.ANrM  r   r@   r?   r}  r;  ]  rO  r@   r}  r   )rG   r   r   rE   types
ModuleTypestrr   r   r   __subclasses__)r:   r.  rB   r  r2  r9  r}  r   
subclassesr$  r(  s            @@r?   test_module_subclassesz0ClassPropertiesAndMethods.test_module_subclasses8  s    #Y	+ 	+ sGEEE 3 	4
	%))3 
 II $ %	G	 	=B3ZHd;=1$3H
H))+Z8  		 Is   C C)	C&%C&c                 $    G d dt                       }| j                  |j                         d       |j                  d       | j                  |j                         d        G fddt              } |       }| j                  t        |j                               g        d|d<   | j                  t        |j                               d	g       | j                  |d   d       | j                  |j                         d       |j                  d       | j                  |j                         d       | j                  |j                  |t        t         f        G d
 dt               } G d d|t
              }| j                   |       j                         d       | j                  t         |             d       | j                   |       j                         d       | j                  t         |             d       y )Nc                       e Zd Zd Zd Zd Zy)>ClassPropertiesAndMethods.test_multiple_inheritance.<locals>.Cc                     d| _         y r   r9  r   s    r?   r4   zGClassPropertiesAndMethods.test_multiple_inheritance.<locals>.C.__init__e  r;  r@   c                     | j                   S r   r9  r   s    r?   r   zGClassPropertiesAndMethods.test_multiple_inheritance.<locals>.C.getstateg  r=  r@   c                     || _         y r   r9  r  s     r?   r   zGClassPropertiesAndMethods.test_multiple_inheritance.<locals>.C.setstatei  r?  r@   Nr@  r   r@   r?   r   rD  d  rA  r@   r   r   r  c                       e Zd Z fdZy)>ClassPropertiesAndMethods.test_multiple_inheritance.<locals>.Dc                 R    t         j                  |        j                  |        y r   )r   r4   r   s    r?   r4   zGClassPropertiesAndMethods.test_multiple_inheritance.<locals>.D.__init__p  s    d#

4 r@   Nr   r   r   r4   r   s   r?   rN  rI  o  s    !r@   rN  worldhello)rN  rM  c                       e Zd Zd Zd Zy)AClassPropertiesAndMethods.test_multiple_inheritance.<locals>.Nodec                 4    t        | j                               S r   )r-   r   r   s    r?   __int__zIClassPropertiesAndMethods.test_multiple_inheritance.<locals>.Node.__int__  s    488:&r@   c                      y)N23r   r   s    r?   r   zEClassPropertiesAndMethods.test_multiple_inheritance.<locals>.Node.foo      r@   N)r   r   r   rR  r   r   r@   r?   NoderP  ~  s    'r@   rV  c                       e Zd Zd Zy)AClassPropertiesAndMethods.test_multiple_inheritance.<locals>.Fragc                      y)N42r   r   s    r?   r   zEClassPropertiesAndMethods.test_multiple_inheritance.<locals>.Frag.foo  rU  r@   Nr   r   r@   r?   FragrX        r@   r[     r   )r`  rE   r   r   r   r6   r   r7   __mro__rR  r-   )r:   rB   rN  rM   rV  r[  r   s         @r?   test_multiple_inheritancez3ClassPropertiesAndMethods.test_multiple_inheritanceb  s   	% 	% Cq)	

2r*	!a 	! Caffh,'
aggi+=*>?7W-q)	

2r*Qa$89	6 	
	4 	 	)2.TVb))2.TVb)r@   c                 `    G d dt               }| j                   |       j                         d        G d d|      }| j                   |       j                         d       | j                   |       j                         d        G d d|      }| j                   |       j                         d       | j                   |       j                         d        G d d||      }| j                   |       j                         d       | j                   |       j                         d       | j                  |j                  ||||t         f        G d	 d
||      }| j                   |       j                         d       | j                   |       j                         d       | j                  |j                  ||||t         f       	  G d d||      }| j                  d       	  G d d||      }| j                  d       y # t        $ r Y *w xY w# t        $ r Y y w xY w)Nc                       e Zd Zd Zy)=ClassPropertiesAndMethods.test_diamond_inheritance.<locals>.Ac                      yr|  r   r   s    r?   r   zBClassPropertiesAndMethods.test_diamond_inheritance.<locals>.A.spam      3r@   Nrn  r   r@   r?   r}  rb    s    &r@   r}  c                       e Zd Zd Zd Zy)=ClassPropertiesAndMethods.test_diamond_inheritance.<locals>.Bc                      yr  r   r   s    r?   boozAClassPropertiesAndMethods.test_diamond_inheritance.<locals>.B.boo      #r@   c                      yr  r   r   s    r?   r   zBClassPropertiesAndMethods.test_diamond_inheritance.<locals>.B.spam  rd  r@   N)r   r   r   rh  r   r   r@   r?   r  rf    s    %&r@   r  c                       e Zd Zd Zy)=ClassPropertiesAndMethods.test_diamond_inheritance.<locals>.Cc                      yr  r   r   s    r?   rh  zAClassPropertiesAndMethods.test_diamond_inheritance.<locals>.C.boo  ri  r@   N)r   r   r   rh  r   r@   r?   r   rl    s    %r@   r   c                       e Zd Zy)=ClassPropertiesAndMethods.test_diamond_inheritance.<locals>.DNrM  r   r@   r?   rN  ro    r  r@   rN  c                       e Zd Zy)=ClassPropertiesAndMethods.test_diamond_inheritance.<locals>.ENrM  r   r@   r?   r  rq    r  r@   r  c                       e Zd Zy)=ClassPropertiesAndMethods.test_diamond_inheritance.<locals>.FNrM  r   r@   r?   r  rs    r  r@   r  z#expected MRO order disagreement (F)c                       e Zd Zy)=ClassPropertiesAndMethods.test_diamond_inheritance.<locals>.GNrM  r   r@   r?   Gru    r  r@   rv  z#expected MRO order disagreement (G))r`  rE   r   rh  r^  r   r   )r:   r}  r  r   rN  r  r  rv  s           r?   test_diamond_inheritancez2ClassPropertiesAndMethods.test_diamond_inheritance  s   	' 	'S)	' 	' 	S)C(	& 	&S)C(1S)C(Q1a$891S)C(Q1a$89	=Aq II;<	=Aq II;<  		  		s$   H 4H! 	HH!	H-,H-c           
           G d dt               } G d dt               } G d dt               } G d d|      } G d	 d
|      } G d d||||      }| j                  |j                  ||||||t         f       y )Nc                       e Zd Zy)<ClassPropertiesAndMethods.test_ex5_from_c3_switch.<locals>.ANrM  r   r@   r?   r}  rz    r  r@   r}  c                       e Zd Zy)<ClassPropertiesAndMethods.test_ex5_from_c3_switch.<locals>.BNrM  r   r@   r?   r  r|    r  r@   r  c                       e Zd Zy)<ClassPropertiesAndMethods.test_ex5_from_c3_switch.<locals>.CNrM  r   r@   r?   r   r~    r  r@   r   c                       e Zd Zy)<ClassPropertiesAndMethods.test_ex5_from_c3_switch.<locals>.XNrM  r   r@   r?   r  r    r  r@   r  c                       e Zd Zy)<ClassPropertiesAndMethods.test_ex5_from_c3_switch.<locals>.YNrM  r   r@   r?   r  r    r  r@   r  c                       e Zd Zy)<ClassPropertiesAndMethods.test_ex5_from_c3_switch.<locals>.ZNrM  r   r@   r?   r  r    r  r@   r  r`  rE   r^  )r:   r}  r  r   r  r  r  s          r?   test_ex5_from_c3_switchz1ClassPropertiesAndMethods.test_ex5_from_c3_switch  s[    !AaQ1aAv$>?r@   c                     G d dt               } G d d|      } G d d|      } G d d|      } G d	 d
|      } G d d||      } G d d|      } G d d||      }| j                  |j                  |||||t         f       | j                  |j                  ||||t         f       | j                  |j                  ||||||||t         f	       y )Nc                       e Zd Zy)9ClassPropertiesAndMethods.test_monotonicity.<locals>.BoatNrM  r   r@   r?   Boatr    r  r@   r  c                       e Zd Zy)<ClassPropertiesAndMethods.test_monotonicity.<locals>.DayBoatNrM  r   r@   r?   DayBoatr    r  r@   r  c                       e Zd Zy)>ClassPropertiesAndMethods.test_monotonicity.<locals>.WheelBoatNrM  r   r@   r?   	WheelBoatr    r  r@   r  c                       e Zd Zy)?ClassPropertiesAndMethods.test_monotonicity.<locals>.EngineLessNrM  r   r@   r?   
EngineLessr    r  r@   r  c                       e Zd Zy)CClassPropertiesAndMethods.test_monotonicity.<locals>.SmallMultihullNrM  r   r@   r?   SmallMultihullr    r  r@   r  c                       e Zd Zy)CClassPropertiesAndMethods.test_monotonicity.<locals>.PedalWheelBoatNrM  r   r@   r?   PedalWheelBoatr    r  r@   r  c                       e Zd Zy)CClassPropertiesAndMethods.test_monotonicity.<locals>.SmallCatamaranNrM  r   r@   r?   SmallCatamaranr    r  r@   r  c                       e Zd Zy);ClassPropertiesAndMethods.test_monotonicity.<locals>.PedaloNrM  r   r@   r?   Pedalor    r  r@   r  r  )	r:   r  r  r  r  r  r  r  r  s	            r?   test_monotonicityz+ClassPropertiesAndMethods.test_monotonicity  s     6 !d!##''+W+8Z	82^29^N9//z7ItVL	N//~wfE	G~z>w	4A	Br@   c           
           G d dt               } G d dt               } G d dt               } G d d||      } G d	 d
||      } G d d||      }| j                  |j                  ||||||t         f       y )Nc                       e Zd Zy)AClassPropertiesAndMethods.test_consistency_with_epg.<locals>.PaneNrM  r   r@   r?   Paner    r  r@   r  c                       e Zd Zy)KClassPropertiesAndMethods.test_consistency_with_epg.<locals>.ScrollingMixinNrM  r   r@   r?   ScrollingMixinr    r  r@   r  c                       e Zd Zy)IClassPropertiesAndMethods.test_consistency_with_epg.<locals>.EditingMixinNrM  r   r@   r?   EditingMixinr    r  r@   r  c                       e Zd Zy)KClassPropertiesAndMethods.test_consistency_with_epg.<locals>.ScrollablePaneNrM  r   r@   r?   ScrollablePaner    r  r@   r  c                       e Zd Zy)IClassPropertiesAndMethods.test_consistency_with_epg.<locals>.EditablePaneNrM  r   r@   r?   EditablePaner    r  r@   r  c                       e Zd Zy)SClassPropertiesAndMethods.test_consistency_with_epg.<locals>.EditableScrollablePaneNrM  r   r@   r?   EditableScrollablePaner    r  r@   r  r  )r:   r  r  r  r  r  r  s          r?   test_consistency_with_epgz3ClassPropertiesAndMethods.test_consistency_with_epg  sd     6 *V*(6(7T.7343G^LG/77%~|Tf6	7r@   c           	          d} fd} G d dt               } G d d|      } G d dt               } |t        d	t        d
||fi         |t        |t        d
||fi         |t        |t        d
|||fi         G d dt               } G d d|      } G d d|      } G d d||      }	 G d d||      }
 |t        |t        d|	|
fi        y )NzCCannot create a consistent method resolution
order (MRO) for bases c                    	  ||  j                  d| z         y # | $ rb}t        j                         rDt        |      j	                  |      s%j                  dt        |      d|       Y d }~y Y d }~y Y d }~y d }~ww xY w)NzExpected %szMessage z, expected )r   r   check_impl_detailr>  rc  )excexpectedcallabler;   msgr:   s        r?   raisesz?ClassPropertiesAndMethods.test_mro_disagreement.<locals>.raises  s{    	/$ 		-#-.  8,,.s8..x8		#&s8X#7 8 8 9 /8s    BAA??Bc                       e Zd Zy):ClassPropertiesAndMethods.test_mro_disagreement.<locals>.ANrM  r   r@   r?   r}  r    r  r@   r}  c                       e Zd Zy):ClassPropertiesAndMethods.test_mro_disagreement.<locals>.BNrM  r   r@   r?   r  r    r  r@   r  c                       e Zd Zy):ClassPropertiesAndMethods.test_mro_disagreement.<locals>.CNrM  r   r@   r?   r   r    r  r@   r   zduplicate base class Ar  c                       e Zd Zy)CClassPropertiesAndMethods.test_mro_disagreement.<locals>.GridLayoutNrM  r   r@   r?   
GridLayoutr    r  r@   r  c                       e Zd Zy)GClassPropertiesAndMethods.test_mro_disagreement.<locals>.HorizontalGridNrM  r   r@   r?   HorizontalGridr    r  r@   r  c                       e Zd Zy)EClassPropertiesAndMethods.test_mro_disagreement.<locals>.VerticalGridNrM  r   r@   r?   VerticalGridr    r  r@   r  c                       e Zd Zy)?ClassPropertiesAndMethods.test_mro_disagreement.<locals>.HVGridNrM  r   r@   r?   HVGridr    r  r@   r  c                       e Zd Zy)?ClassPropertiesAndMethods.test_mro_disagreement.<locals>.VHGridNrM  r   r@   r?   VHGridr    r  r@   r  ConfusedGrid)r`  r   rG   )r:   mro_err_msgr  r}  r  r   r  r  r  r  r  s   `          r?   test_mro_disagreementz/ClassPropertiesAndMethods.test_mro_disagreement  s    
	/ 	 	y2S1a&"	&y+S1a&"	&y+S1a)R	) 	'&.Z.,:,8^\88\>8y+^ff%5r	;r@   c                 h   t               }| j                  |j                  t                | j                  t        |      t                t               }| j	                  ||       | j                  |d       	 d|_        | j                  d       | j                  t               d        G d dt               } |       }| j                  |j                  i        d|_        | j                  |j                  d       | j                  |j                  ddi       y # t        t        f$ r Y w xY w)Nr   r   z1object() should not allow setting a foo attributerI   c                       e Zd Zy):ClassPropertiesAndMethods.test_object_class.<locals>.CdictNrM  r   r@   r?   Cdictr    rO  r@   r  rf   )r`  rE   r  rG   assertNotEqualr  r   r   AttributeErrorr   rI   )r:   rB   rT   r  r  s        r?   test_object_classz+ClassPropertiesAndMethods.test_object_class  s    Hf-a&)HAq!a'	KAE IIIJfh
3	F 	GR("eQZ0 	* 		s   9D D10D1c                     G d dt         j                        }t        j                  d      }| j                  |j                  t         j                  u        | j	                  t        |d             ||_        | j                  |j                  |u        | j                  t        |d             t         j                  |_        | j                  |j                  t         j                  u        | j	                  t        |d              G d dt              }| j                  t              5  |d_        d d d         G d d	t              }| j                  t              5  |d
_        d d d         G d dt              }| j                  t              5  |d_        d d d         G d dt              }| j                  t              5  |d_        d d d         G d dt              }| j                  t              5  |d_        d d d         G d dt              }| j                  t              5  |d_        d d d         G d dt              }	| j                  t              5  |	t               _        d d d        y # 1 sw Y   KxY w# 1 sw Y   $xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   y xY w)Nc                       e Zd ZdZy)jClassPropertiesAndMethods.test_object_class_assignment_between_heaptypes_and_nonheaptypes.<locals>.SubTyperf   Nr   r   r   rB   r   r@   r?   SubTyper    s    Ar@   r  rO   rB   c                       e Zd ZdZy)hClassPropertiesAndMethods.test_object_class_assignment_between_heaptypes_and_nonheaptypes.<locals>.MyIntr   Nr   r   r   r   r   r@   r?   MyIntr  5      Ir@   r  rf   c                       e Zd ZdZy)jClassPropertiesAndMethods.test_object_class_assignment_between_heaptypes_and_nonheaptypes.<locals>.MyFloatr   Nr  r   r@   r?   MyFloatr  :  r  r@   r        ?c                       e Zd ZdZy)lClassPropertiesAndMethods.test_object_class_assignment_between_heaptypes_and_nonheaptypes.<locals>.MyComplexr   Nr  r   r@   r?   	MyComplexr  ?  r  r@   r  y      ?       @c                       e Zd ZdZy)hClassPropertiesAndMethods.test_object_class_assignment_between_heaptypes_and_nonheaptypes.<locals>.MyStrr   Nr  r   r@   r?   MyStrr  D  r  r@   r  c                       e Zd ZdZy)jClassPropertiesAndMethods.test_object_class_assignment_between_heaptypes_and_nonheaptypes.<locals>.MyBytesr   Nr  r   r@   r?   MyBytesr  I  r  r@   r     ac                       e Zd ZdZy)jClassPropertiesAndMethods.test_object_class_assignment_between_heaptypes_and_nonheaptypes.<locals>.MyTupler   Nr  r   r@   r?   MyTupler  N  r  r@   r  r   c                       e Zd ZdZy)nClassPropertiesAndMethods.test_object_class_assignment_between_heaptypes_and_nonheaptypes.<locals>.MyFrozenSetr   Nr  r   r@   r?   MyFrozenSetr  S  r  r@   r  )r<  r=  r   r  r  r   r-   r  r   r.   r   r>  bytestuple	frozenset)
r:   r  rO   r  r  r  r  r  r  r  s
             r?   ?test_object_class_assignment_between_heaptypes_and_nonheaptypeszYClassPropertiesAndMethods.test_object_class_assignment_between_heaptypes_and_nonheaptypes  sB   	e&& 	 S!u'7'778C)w./3(&&u'7'778C)	C 	y) 	"!QM	"	e 	y) 	&%SO	&	 	y) 	+!*V	+	C 	y) 	"!CM	"	e 	y) 	%$DN	%	e 	y) 	#"BL	#	) 	y) 	0$/IK!	0 	0=	" 	"
	& 	&
	+ 	+
	" 	"
	% 	%
	# 	#
	0 	0sT   3J'JJJ*J67K+KJJJ'*J36J?KKc                      G d dt               } |       } j                  |d        j                  |d        G d dt               } |       } j                  |d        j                  |d       d|_         j                  |j                  d       d |_         j                  |j                  d        |` j                  |d        G d	 d
t               } |       } j                  |d        j                  |d        j                  |d        j                  |d       d|_        d|_        d|_         j                  |j                  d        j                  |j                  d        j                  |j
                  d        G d dt               } |d      } j                  |d        j                  |d        j                  |j                         d       	 d|_         j                  d       	  G d dt               } j                  d       	  G d dt               } j                  d       	  G d dt               } j                  d       	  G d dt               } j                  d       	  G d dt               } j                  d        G d  dt               } G d! dt               } |       }d|_         j                  |j                  d        G d" dt               } |       }d|_         j                  |j                  d       d# G fd$dt               } |       }d|_         j                  |j                  d        j                  t        d%         t               	  G d& dt               } j                  d'        G fd(d)t                G d* dt               } |       }        |_                |_                |_         j                  j"                  d       ~t%        j&                           j                  j"                  d%        G d+ d,|      } |       }        |_                |_         j                  j"                  d       ~t%        j&                           j                  j"                  d%        G d- d.|      }	 |	       }        |_                |_                |_         j                  j"                  d       ~t%        j&                           j                  j"                  d%        G d/ d0t               }
 |
       }        |g|_         j                  j"                  d       d }t%        j&                           j                  j"                  d%       t-        t.        d1      rw G d2 d3t               } |       }t1        t/        j2                               }t5        d4      D ]  }||k(   	 t1        t/        j2                               } j                  ||        G  fd5d6t               }t%        j6                  d7      5 } |       }~d d d         j                  |j9                         d8        G d9 d:t               } j;                  t              5   |       `d d d         G d; d:t               } j=                  t        d<      5   |       j                   d d d         G d= d>t               G fd?d:t               }d |       _         j=                  t        d<      5   |       j                   d d d        y # t        $ r Y dw xY w# t        $ r Y Sw xY w# t        $ r Y Bw xY w# t        $ r Y 1w xY w# t        $ r Y  w xY w# t        $ r Y w xY w# t        t         f$ r Y $w xY w# 1 sw Y   pxY w# 1 sw Y   )xY w# 1 sw Y   xY w# 1 sw Y   y xY w)@Nc                       e Zd Zg Zy)0ClassPropertiesAndMethods.test_slots.<locals>.C0Nr  r   r@   r?   C0r   Z  r  r@   r  rI   r   c                       e Zd ZdgZy)0ClassPropertiesAndMethods.test_slots.<locals>.C1rB   Nr  r   r@   r?   C1r  `  	    Ir@   r  rB   rf   c                       e Zd Zg dZy)0ClassPropertiesAndMethods.test_slots.<locals>.C3rW   Nr  r   r@   r?   C3r  l      'Ir@   r  rT   rX   rg   rk   c                   "    e Zd ZdZdgZd Zd Zy)0ClassPropertiesAndMethods.test_slots.<locals>.C4zValidate name mangling__ac                     || _         y r   _C4__ar:   r  s     r?   r4   z9ClassPropertiesAndMethods.test_slots.<locals>.C4.__init__}  	     r@   c                     | j                   S r   r  r   s    r?   r   z4ClassPropertiesAndMethods.test_slots.<locals>.C4.get      xxr@   N)r   r   r   __doc__r   r4   r   r   r@   r?   C4r  z  s    (I! r@   r  r   r  r   z$Double underscored names not mangledc                       e Zd ZdgZy/ClassPropertiesAndMethods.test_slots.<locals>.CNr  r   r@   r?   r   r    s	    !F	r@   r   z[None] slots not caughtc                       e Zd ZdgZy)r  zfoo barNr  r   r@   r?   r   z/ClassPropertiesAndMethods.test_slots.<locals>.C  s	    &K	r@   z['foo bar'] slots not caughtc                       e Zd ZdgZy)r  zfoo barNr  r   r@   r?   r   z/ClassPropertiesAndMethods.test_slots.<locals>.C  s	    'L	r@   z['foo\0bar'] slots not caughtc                       e Zd ZdgZy)r  1Nr  r   r@   r?   r   z/ClassPropertiesAndMethods.test_slots.<locals>.C  s	     E	r@   z['1'] slots not caughtc                       e Zd ZdgZy)r  r   Nr  r   r@   r?   r   z/ClassPropertiesAndMethods.test_slots.<locals>.C  s	    D	r@   z[''] slots not caughtc                       e Zd Zg dZy)r  )rB   a_b_aA0123456789ZNr  r   r@   r?   r   z/ClassPropertiesAndMethods.test_slots.<locals>.C  s    :Ir@   c                       e Zd ZdZyr  abcNr  r   r@   r?   r   z/ClassPropertiesAndMethods.test_slots.<locals>.C      Ir@   c                       e Zd ZdZyr#  r  r   r@   r?   r   z/ClassPropertiesAndMethods.test_slots.<locals>.C  r%  r@   r   c                       e Zd ZW  Zyr  r  )slotss   r?   r   z/ClassPropertiesAndMethods.test_slots.<locals>.C  s    Ir@   r   c                       e Zd Z ed      gZy)r     N)r   r   r   chrr   r   r@   r?   r   z/ClassPropertiesAndMethods.test_slots.<locals>.C  s     XJ	r@   z[chr(128)] slots not caughtc                   &    e Zd ZdZ fdZ fdZy)5ClassPropertiesAndMethods.test_slots.<locals>.Countedr   c                 0    xj                   dz  c_         y r   r  r:   Counteds    r?   r4   z>ClassPropertiesAndMethods.test_slots.<locals>.Counted.__init__      1$r@   c                 0    xj                   dz  c_         y r   r  r/  s    r?   __del__z=ClassPropertiesAndMethods.test_slots.<locals>.Counted.__del__  r1  r@   N)r   r   r   r  r4   r3  )r0  s   r?   r0  r-    s    G%%r@   r0  c                       e Zd Zg dZy)r  rW   Nr  r   r@   r?   r   z/ClassPropertiesAndMethods.test_slots.<locals>.C  r	  r@   c                       e Zd Zy)/ClassPropertiesAndMethods.test_slots.<locals>.DNrM  r   r@   r?   rN  r6    rO  r@   rN  c                       e Zd ZdgZy)/ClassPropertiesAndMethods.test_slots.<locals>.EeNr  r   r@   r?   r  r8    r  r@   r  c                       e Zd ZddgZy)/ClassPropertiesAndMethods.test_slots.<locals>.FrB   rT   Nr  r   r@   r?   r  r;        c
Ir@   r  get_objectsc                       e Zd Zd Zy)/ClassPropertiesAndMethods.test_slots.<locals>.Gc                      y)NFr   r   s     r?   __eq__z6ClassPropertiesAndMethods.test_slots.<locals>.G.__eq__  s     r@   Nr   r   r   rA  r   r@   r?   rv  r?    s    !r@   rv  r  c                   &    e Zd ZddgZd Z fdZy)/ClassPropertiesAndMethods.test_slots.<locals>.HrB   rT   c                      d| _         d| _        y Nrf   rg   rS   r   s    r?   r4   z8ClassPropertiesAndMethods.test_slots.<locals>.H.__init__  s    r@   c                 v    j                  | j                  d       j                  | j                  d       y rF  )rE   rB   rT   )self_r:   s    r?   r3  z7ClassPropertiesAndMethods.test_slots.<locals>.H.__del__  s+      !,  !,r@   N)r   r   r   r   r4   r3  r   s   r?   HrD    s    c
I-r@   rI  stderrr   c                       e Zd ZdZy/ClassPropertiesAndMethods.test_slots.<locals>.XrB   Nr  r   r@   r?   r  rM        Ir@   r  c                       e Zd ZdZyrL  r  r   r@   r?   r  z/ClassPropertiesAndMethods.test_slots.<locals>.X#  rN  r@   z'X' object has no attribute 'a'c                       e Zd Zy)4ClassPropertiesAndMethods.test_slots.<locals>.SubStrNrM  r   r@   r?   SubStrrQ  )  rO  r@   rR  c                   "    e Zd Z W  d      fZy)rM  r  Nr  )rR  s   r?   r  z/ClassPropertiesAndMethods.test_slots.<locals>.X+  s    Ir@   ) r`  r  rB   rE   rT   rX   r   _ClassPropertiesAndMethods__ar   r  r   r$  r   r  rG   r>  UnicodeEncodeErrorr  r   
gc_collectzr9  r   gcr	  r=  r   captured_outputgetvaluer  assertRaisesRegexr  )r:   r  r  r  r  r  r   rX   rN  r  r  srv  gorig_objectsr   new_objectsrI  hr  r0  rR  r(  s   `                   @@@r?   
test_slotsz$ClassPropertiesAndMethods.test_slotsX  s   	 	Da,a'	 	Da,a%a d#Ca%	( 	(Da,a%a%a%a a a 	  	  qEa,a'!$	>AE II<=	1#F #
 II/0	6(F (
 II45	8)F )
 II67	0"F "
 II./	/!F !
 II-.	; 	;	 	C"	 	C" 	 	C"d58nc*	5'F '
 II34	%f 	%	( 	(Ciii!,!,	 	Cii!,!,	 	Ciii!,!,	# 	#Cy!n!,!, 2}%!F ! Ar~~/0L2Y 1bnn./K\;7	- 	- $$X. 	!A	 	r*	 	~. 			 	##N4UV 	CEE		S 		' 	'##N4UV 	CEE	 	O  		  		  		  		  		  		H -. 		P	 		 		 		 	s   6]& ]6 0^ ^ 2^& ^6 _ %	_:_)/_6`&	]32]36	^^	^^	^#"^#&	^32^36	_____&)_36_?`c                     G d dt               } |       }| j                  |d       | j                  |d       d|_        | j	                  |j
                  ddi        G d dt               } |       }| j                  |d       | j                  |d       	 d|_        | j                  d	        G d
 d||      } |       }| j                  |d       | j                  |d       d|_        | j	                  |j
                  ddi        G d d||      } |       }| j                  |d       | j                  |d       d|_        | j	                  |j
                  ddi       y # t        $ r Y w xY w)Nc                       e Zd ZdgZy)7ClassPropertiesAndMethods.test_slots_special.<locals>.DrI   Nr  r   r@   r?   rN  rd  3  	    #Ir@   rN  rI   __weakref__r   r   c                       e Zd ZdgZy)7ClassPropertiesAndMethods.test_slots_special.<locals>.Wrf  Nr  r   r@   r?   Wrh  ;  	    &Ir@   ri  z!shouldn't be allowed to set a.fooc                       e Zd Zg Zy)8ClassPropertiesAndMethods.test_slots_special.<locals>.C1Nr  r   r@   r?   r  rl  G  r  r@   r  c                       e Zd Zg Zy)8ClassPropertiesAndMethods.test_slots_special.<locals>.C2Nr  r   r@   r?   r  rn  O  r  r@   r  )r`  r   r  r   rE   rI   r   r  )r:   rN  rB   ri  r  r  s         r?   test_slots_specialz,ClassPropertiesAndMethods.test_slots_special1  s^   	% 	%C1j)a/eR[1	( 	(C1m,a,	;AE II9:	A 	D1j)1m,eR[1	A 	D1j)1m,eR[1'  		s   E, ,	E87E8c                 v     G  fddt               } G d d      } G d d||d      } j                  |j                  d   t        j                          |       } j                  |j                  d	        j                  |d       d	|_         j                  |j                  d	        j                  t              5   G d
 d      }d d d         G d d|d      } j                  |j                  |j                  d d dz           j                  |j                  d   t        j                          |       } j                  |d       d|_         j                  |j                  d        j                  t              5   G d d      }d d d        y # 1 sw Y   xY w# 1 sw Y   y xY w)Nc                   "     e Zd Z fdZ xZS );ClassPropertiesAndMethods.test_slots_special2.<locals>.Metac                 L    j                  ||       t        | 	  | |||      S r   )r  ru  r   )r   r=   rU  	namespaceattrr  r:   s        r?   r   zCClassPropertiesAndMethods.test_slots_special2.<locals>.Meta.__new__Z  s&    dI.wsD%CCr@   rw  r  r:   s   @r?   Metarr  Y  s    D Dr@   rw  c                       e Zd Zd Zy)9ClassPropertiesAndMethods.test_slots_special2.<locals>.C1c                     d| _         y rl  )rT   r   s    r?   r4   zBClassPropertiesAndMethods.test_slots_special2.<locals>.C1.__init___  s	    r@   NrK  r   r@   r?   r  ry  ^  r\  r@   r  c                   $     e Zd ZdgZ fdZ xZS )9ClassPropertiesAndMethods.test_slots_special2.<locals>.C2rx  c                 "    t         |           y r   ru  r4   )r:   r  s    r?   r4   zBClassPropertiesAndMethods.test_slots_special2.<locals>.C2.__init__c  s     "r@   )r   r   r   r   r4   rx  r  s   @r?   r  r|  a  s    ()I# #r@   r  rx  )rC  ru  r   c                       e Zd ZdZdgZy)9ClassPropertiesAndMethods.test_slots_special2.<locals>.C3r   rx  N)r   r   r   rx  r   r   r@   r?   r  r  m  s     ",-	r@   r  c                       e Zd ZdgZy)9ClassPropertiesAndMethods.test_slots_special2.<locals>.Q1r   Nr  r   r@   r?   Q1r  q  s
    '(Ir@   r  r   qc                        e Zd Z e       ZdgZy)9ClassPropertiesAndMethods.test_slots_special2.<locals>.Q2r   N)r   r   r   r`  r   r   r@   r?   Q2r  {  s    %x+,	r@   r  )rG   r  rI   r<  MemberDescriptorTyperE   rT   r  rx  r  r   r   )	r:   rw  r  r  rX   r  r  r  r  s	   `        r?   test_slots_special2z-ClassPropertiesAndMethods.test_slots_special2W  sz   	D4 	D
	 		#t/ 	# 	bkk/:#88	:Db!a1"-y) 	.. .	.
	)4n 	)"//#2*>*EFbkk.9#88	:Da0-y) 	-- -	- 	-	. 	.	- 	-s   F#F/#F,/F8c                    dd l } G d d|j                        } G d dt              }|j                  |        |       }| j	                  ||       | j                  t        |j                  j                  |d       y )Nr   c                       e Zd ZdZy)>ClassPropertiesAndMethods.test_slots_descriptor.<locals>.MyABCrB   Nr  r   r@   r?   MyABCr    rN  r@   r  rB  c                       e Zd Zy)BClassPropertiesAndMethods.test_slots_descriptor.<locals>.UnrelatedNrM  r   r@   r?   	Unrelatedr    rO  r@   r  rk   )	r$  ABCMetar`  registerr  r  r   rB   __set__)r:   r$  r  r  us        r?   test_slots_descriptorz/ClassPropertiesAndMethods.test_slots_descriptor  sd     		ckk 		 	y!Ka' 	)UWW__a;r@   c                     G d dt               } G d d|      } G d d|      }d|_        | j                  |j                  d       | j                  |j                  d       | j                  |j                  d        G d d	t               } |       }| j                  |d
       d|_        | j                  |j                  d       d |_        | j                  |j                         d       d |_        | j                  t        |      d       d |_        | j                  t        |      d       | j                  |j                  d       | j                  |d       d }||_
        | j                  |j                  d       d|_        | j                  |j                  d       d }||_        | j                  t              5  d|_        d d d        | j                  |j                  d        G d d|      } |       }d|_        | j                  |j                  d        G d dt              }	| j                  d |	d      z  d       | j                   |	d      dz  d       | j                  d |	d      z  d       | j                   |	d      dz  d       | j                   |	d       |	d      z  d        G d dt               }
 G d  d!|
"      }| j#                  |t                y # 1 sw Y   )xY w)#Nc                       e Zd Zy2ClassPropertiesAndMethods.test_dynamics.<locals>.DNrM  r   r@   r?   rN  r    rO  r@   rN  c                       e Zd Zy)2ClassPropertiesAndMethods.test_dynamics.<locals>.ENrM  r   r@   r?   r  r    rO  r@   r  c                       e Zd Zy)2ClassPropertiesAndMethods.test_dynamics.<locals>.FNrM  r   r@   r?   r  r    rO  r@   r  rf   c                       e Zd Zy)2ClassPropertiesAndMethods.test_dynamics.<locals>.CNrM  r   r@   r?   r   r    rO  r@   r   foobarrg   c                      yrl  r   r   s    r?   <lambda>z9ClassPropertiesAndMethods.test_dynamics.<locals>.<lambda>      r@   r   c                      y)NC()r   r   s    r?   r  z9ClassPropertiesAndMethods.test_dynamics.<locals>.<lambda>  r  r@   r  c                      yr(  r   r   s    r?   r  z9ClassPropertiesAndMethods.test_dynamics.<locals>.<lambda>  r  r@   r   r   c                     |dk(  ryt         Nr   r  r:   r=   s     r?   	mygetattrz:ClassPropertiesAndMethods.test_dynamics.<locals>.mygetattr  s    v~  r@   r   c                 F    |dk(  rt         t        j                  | ||      S r  )r  r`  r*  )r:   r=   r  s      r?   	mysetattrz:ClassPropertiesAndMethods.test_dynamics.<locals>.mysetattr  s$    v~$$%%dD%88r@   znot spamc                       e Zd Zyr  rM  r   r@   r?   rN  z2ClassPropertiesAndMethods.test_dynamics.<locals>.D  rO  r@   c                       e Zd Zy)2ClassPropertiesAndMethods.test_dynamics.<locals>.INrM  r   r@   r?   Ir    rO  r@   r  rB   aark   r   c                       e Zd Zy)AClassPropertiesAndMethods.test_dynamics.<locals>.dynamicmetaclassNrM  r   r@   r?   dynamicmetaclassr    rO  r@   r  c                       e Zd Zy):ClassPropertiesAndMethods.test_dynamics.<locals>.someclassNrM  r   r@   r?   	someclassr    rO  r@   r  rB  )r`  r   rE   r  r  methodr   r   rR  r-   __getattr__r   newr*  r  r  rG   r  )r:   rN  r  r  r   rB   r  r  rM   r  r  r  s               r?   test_dynamicsz'ClassPropertiesAndMethods.test_dynamics  s   	 		 		 	"""	 	Ca*1%"R('
a%($	Q%1%a(	! "(#	9 "~. 	 AF	  	(	 	C"	 	QqT4(1c4(1Q4#1a#1adA&	t 		"2 	Iv.1	  	 s   K??L	c                    	  G d dt         t              }| j                  d       	  G d dt        d       }| j                  d        G d d      }	  G d dt        t                    }| j                  d	       	  G d
 dt              }| j                  d       	  G d dt              }| j                  d        G d dt
              } G d dt
              } G d dt        |      } G d dt        |      }	  G d d||      }| j                  d       y # t        $ r Y w xY w# t        $ r Y w xY w# t        $ r Y w xY w# t        $ r Y w xY w# t        $ r Y w xY w# t        $ r Y y w xY w)Nc                       e Zd Zy0ClassPropertiesAndMethods.test_errors.<locals>.CNrM  r   r@   r?   r   r    r  r@   r   z5inheritance from both list and dict should be illegalc                       e Zd Zyr  rM  r   r@   r?   r   z0ClassPropertiesAndMethods.test_errors.<locals>.C  r  r@   z+inheritance from non-type should be illegalc                       e Zd Zy)6ClassPropertiesAndMethods.test_errors.<locals>.ClassicNrM  r   r@   r?   Classicr    rO  r@   r  c                       e Zd Zyr  rM  r   r@   r?   r   z0ClassPropertiesAndMethods.test_errors.<locals>.C  r  r@   z,inheritance from CFunction should be illegalc                       e Zd ZdZyr  rf   Nr  r   r@   r?   r   z0ClassPropertiesAndMethods.test_errors.<locals>.C  s    	r@   z__slots__ = 1 should be illegalc                       e Zd ZdgZyr  r  r   r@   r?   r   z0ClassPropertiesAndMethods.test_errors.<locals>.C  s	    C	r@   z!__slots__ = [1] should be illegalc                       e Zd Zy)1ClassPropertiesAndMethods.test_errors.<locals>.M1NrM  r   r@   r?   rW  r    rO  r@   rW  c                       e Zd Zy)1ClassPropertiesAndMethods.test_errors.<locals>.M2NrM  r   r@   r?   ri  r    rO  r@   ri  c                       e Zd Zy)1ClassPropertiesAndMethods.test_errors.<locals>.A1NrM  r   r@   r?   A1r    rO  r@   r  rB  c                       e Zd Zy)1ClassPropertiesAndMethods.test_errors.<locals>.A2NrM  r   r@   r?   A2r    rO  r@   r  c                       e Zd Zy)0ClassPropertiesAndMethods.test_errors.<locals>.BNrM  r   r@   r?   r  r    r  r@   r  z5finding the most derived metaclass should have failed)r6   r   r   r   r`  rG   r	  )r:   r   r  rW  ri  r  r  r  s           r?   test_errorsz%ClassPropertiesAndMethods.test_errors  s   	OD$ 
 IIMN	EFD 
 IICD	 		FDI 
 IIDE	9F 
 II78	; F  
 II9:	 		 		2 		2 		OB 
 IIMNk  		  		  		  		  		   		sj   D D. D= >E E  E* 	D+*D+.	D:9D:=	E	E		EE	E'&E'*	E65E6c                     G d dt               } |       }| j                  |j                  d      |df       | j                  |j                  d      |df       | j                  |j                  d      |df        G d d|      } |       }| j                  |j                  d      |df       | j                  |j                  d      |df       | j                  |j                  d      |df       | j                  |j                  |d      |df       d }t	        |      }| j                   |j                  dt              d      t        df       | j                   |j                  d      d      t        df       | j                  |j                  j                  |       | j                  |j                  j                  |       | j                  t        ||
  j                  |       | j                  t        ||
  j                  |       | j                  t        ||         |f       | j                  t        ||         |f       t	        d      j                  d      }| j                  t        |       	 t	        |d	       | j                  d
       t	        |      }i t        j                  rdnd t        d|j                  d}	| j                  |j                   |	       d|_        | j                  |j"                  d       | j                  |j                   ddi|	       |`| j%                  |d       y # t        $ r Y w xY w)Nc                   "    e Zd Zd Z ee      Zy)6ClassPropertiesAndMethods.test_classmethods.<locals>.Cc                      | S r   r   rB   s    r?   r   z:ClassPropertiesAndMethods.test_classmethods.<locals>.C.foo      r@   Nr   r   r   r   r  goor   r@   r?   r   r        !c"Cr@   r   rf   c                       e Zd Zy)6ClassPropertiesAndMethods.test_classmethods.<locals>.DNrM  r   r@   r?   rN  r    rO  r@   rN  c                 
    | |fS )f docstringr   )r   args     r?   fz6ClassPropertiesAndMethods.test_classmethods.<locals>.f   s    :r@   r   r   r  z)classmethod shouldn't accept keyword argsr  r  )__annotations__r  r   r   r   r  )r`  rE   r  r   r  re  r-   __self__ru  r  r   r   r   HAVE_DOCSTRINGSr   r   rI   r  r  )r:   r   rX   rN  rM   r  ffrL   cmcm_dictr  s             r?   test_classmethodsz+ClassPropertiesAndMethods.test_classmethods  s   	# 	# CqAq6*qAq6*qAq6*	 	CqAq6*qAq6*qAq6*q!q!f-	 ^+As+B/#r;Ar*S"I6 	++q00!4q00!4q)A40q)A40 1~%%a()T*	Ca  IIAB^&( "11 % !)"#$>>3 	g.r"sR&;7&;<Db#&+  		s   M 	M! M!c                     t        j                  t        d      }t        d       } |       }t	        d      D ]  }|j                  d         | j                   |       |z
  dd       y Ngettotalrefcountr   r   r  )delta)r   get_attributer   r  r   r4   assertAlmostEqual)r:   r  r  refs_beforer   s        r?   %test_refleaks_in_classmethod___init__z?ClassPropertiesAndMethods.test_refleaks_in_classmethod___init__M  se    "006HI&(s 	AKK	/1K?"Mr@   r   Nr   c                 8   dd l }d}ddi} |j                  j                  |i |\  }}}| j                  ||j                         | j                  ||       | j                  ||        |j                         j                  |i |\  }}}| j                  ||j                         | j                  ||       | j                  ||       |j                  j                  d   } ||j                  g|i |\  }}	}
| j                  ||j                         | j                  |	|       | j                  |
|        G d d|j                        } ||g|i |\  }}	}
| j                  ||       | j                  |	|       | j                  |
|       | j                  t              5 } |        d d d        | j                  t        j                        d       | j                  t              5 } ||j                                d d d        | j                  t        |j                        d	       | j                  t              5 } |t               d d d        d
}| j                  t        |j                        |       | j                  t              5 }|j                  d t               d d d        | j                  t        |j                        |       y # 1 sw Y   3xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   TxY w)Nr   rj   r$  {   	classmethc                       e Zd Zy)AClassPropertiesAndMethods.test_classmethods_in_c.<locals>.SubSpamNrM  r   r@   r?   SubSpamr  j  r  r@   r  zGdescriptor 'classmeth' of 'xxsubtype.spamlist' object needs an argumentzfdescriptor 'classmeth' for type 'xxsubtype.spamlist' needs a type, not a 'xxsubtype.spamlist' as arg 2zUdescriptor 'classmeth' requires a subtype of 'xxsubtype.spamlist' but received 'list')r   r   r  rE   rI   r  r   r>  	exceptionr6   re  )r:   r   rB   rM   r  r  d1spam_cmx2r   d2r  r  expected_errmsgs                 r?   test_classmethods_in_cz0ClassPropertiesAndMethods.test_classmethods_in_cV  s    	!CL+DMM++Q4!4	2rDMM*BB-DMMO--q6A6	2rDMM*BB--((5T]]4Q4!4
BT]]+R R *dmm*W.q.A.
BW%R R y) 	RI	'	(
 y) 	%RDMMO$	%@	A
 y) 	RDM	" 	 	R\\*O<y) 	(ROOD$'	(R\\*O</	 		% 	%	 		( 	(s0   2K+<K8L&L+K58LLLc                 .    G d dt               } |       }| j                  |j                  d      d       | j                  |j                  d      d       | j                  |j                  d      |df        G d d|      } |       }| j                  |j                  d      d       | j                  |j                  d      d       | j                  |j                  d      |df       | j                  |j                  |d      |df       t	        d       }| j                  |j
                  dd i       d|_        | j                  |j                  d       | j                  |j
                  dd d	       |`| j                  |d
       y )Nc                   "    e Zd Zd Z ee      Zy)7ClassPropertiesAndMethods.test_staticmethods.<locals>.Cc                      | S r   r   r  s    r?   r   z;ClassPropertiesAndMethods.test_staticmethods.<locals>.C.foo  r  r@   N)r   r   r   r   rh  r  r   r@   r?   r   r    s    !s#Cr@   r   rf   )rf   c                       e Zd Zy)7ClassPropertiesAndMethods.test_staticmethods.<locals>.DNrM  r   r@   r?   rN  r	    rO  r@   rN  r  r   )r  r  r  )r`  rE   r  r   rh  rI   r  r  )r:   r   rX   rN  rM   sms         r?   test_staticmethodsz,ClassPropertiesAndMethods.test_staticmethods  sL   	$ 	$ Cq4(q4(qAq7+	 	Cq4(q4(qAq6*q!q!f-$y$&78r"RD&ABDb#&r@   c                     t        j                  t        d      }t        d       } |       }t	        d      D ]  }|j                  d         | j                   |       |z
  dd       y r  )r   r  r   rh  r   r4   r  )r:   r  r
  r  r   s        r?   &test_refleaks_in_staticmethod___init__z@ClassPropertiesAndMethods.test_refleaks_in_staticmethod___init__  se    "006HI$&(s 	AKK	/1K?"Mr@   c                 x   dd l }d}ddi} |j                  j                  |i |\  }}}| j                  |d        | j                  ||       | j                  ||        |j                         j                  |i |\  }}}| j                  |d        | j                  ||       | j                  ||       y )Nr   rj   r$  r  )r   r   
staticmethrE   )r:   r   rB   rM   r  r  r  r  s           r?   test_staticmethods_in_cz1ClassPropertiesAndMethods.test_staticmethods_in_c  s     	!CL,DMM,,a515	2rD!BB.DMMO..7Q7	2rD!BBr@   c                 H    G d d              }| j                  j                  d      df       | j                  |j                  d      df       | j                  |j                  d      |df        G d d      } |       }| j                  |j                  d      |df       | j                  |j                  d      |df       | j                  |j                  d      |df       | j                  |j                  |d      |df        G fdd      }| j                   |       j                  j                  j                         | j	                  t        j                  j                                      j                  d             y )	Nc                   "    e Zd Zd Z ee      Zy)1ClassPropertiesAndMethods.test_classic.<locals>.Cc                      | S r   r   r  s    r?   r   z5ClassPropertiesAndMethods.test_classic.<locals>.C.foo  r  r@   Nr  r   r@   r?   r   r    r  r@   r   rf   c                       e Zd Zy)1ClassPropertiesAndMethods.test_classic.<locals>.DNrM  r   r@   r?   rN  r    rO  r@   rN  c                   (    e Zd ZW  j                  Zy)1ClassPropertiesAndMethods.test_classic.<locals>.ENr   rL  s   r?   r  r        %%Cr@   r  <bound method )rE   r  r   __func__r   r   re  rc  )r:   rX   rN  rM   r  r   s        @r?   test_classicz&ClassPropertiesAndMethods.test_classic  sE   	# 	# CqAq6*qAq6*qAq6*	 	CqAq6*qAq6*qAq6*q!q!f-	 	))1551QUU]]13/0;;<LMNr@   c                 F    G d dt               } |       }| j                  |j                  d       | j                  |j                  d       d|_        | j                  |j                  d       | j                  |j                  d       |`| j                  |d       y )Nc                   N    e Zd Z G d de      Zd Zd Zd Zd Z eeee      Z	y)2ClassPropertiesAndMethods.test_compattr.<locals>.Cc                   (    e Zd ZddZddZd Zd Zy)EClassPropertiesAndMethods.test_compattr.<locals>.C.computed_attributeNc                 .    || _         || _        || _        y r   )_computed_attribute__get_computed_attribute__set_computed_attribute__delete)r:   r   r  deletes       r?   r4   zNClassPropertiesAndMethods.test_compattr.<locals>.C.computed_attribute.__init__  s    !$DJ!$DJ$*DMr@   c                 $    | j                  |      S r   )r#  )r:   r   rG   s      r?   re  zMClassPropertiesAndMethods.test_compattr.<locals>.C.computed_attribute.__get__  s    ::c?*r@   c                 &    | j                  ||      S r   )r$  r:   r   r  s      r?   r  zMClassPropertiesAndMethods.test_compattr.<locals>.C.computed_attribute.__set__  s    ::c511r@   c                 $    | j                  |      S r   )r%  r:   r   s     r?   
__delete__zPClassPropertiesAndMethods.test_compattr.<locals>.C.computed_attribute.__delete__  s    ==--r@   r  r   )r   r   r   r4   re  r  r,  r   r@   r?   computed_attributer!    s    ++2.r@   r-  c                     d| _         y r   _C__xr   s    r?   r4   z;ClassPropertiesAndMethods.test_compattr.<locals>.C.__init__  	    r@   c                 2    | j                   }|dz   | _         |S r   r/  r  s     r?   __get_xz:ClassPropertiesAndMethods.test_compattr.<locals>.C.__get_x  s    HHQ3r@   c                     || _         y r   r/  r  s     r?   __set_xz:ClassPropertiesAndMethods.test_compattr.<locals>.C.__set_x  r1  r@   c                     | ` y r   r/  r   s    r?   
__delete_xz=ClassPropertiesAndMethods.test_compattr.<locals>.C.__delete_x      Hr@   N)
r   r   r   r`  r-  r4   	_C__get_x	_C__set_x_C__delete_xr  r   r@   r?   r   r    s0    
.V 
."7GZ@Ar@   r   r   rf   r     r  )r`  rE   r  r  r3  s      r?   test_compattrz'ClassPropertiesAndMethods.test_compattr  s    	A 	A. Ca a b!b!Ca%r@   c                 4    G d dt               } |       }| j                  |j                  d       | j                  |j                  |        G d d|      } |       }| j                  |j                  d       | j                  |j                  |       y )Nc                       e Zd Zd Zd Zy)2ClassPropertiesAndMethods.test_newslots.<locals>.Cc                 >    t         j                  |       }d|_        |S r   )r6   r   r   r   r:   s     r?   r   z:ClassPropertiesAndMethods.test_newslots.<locals>.C.__new__  s    ||C(r@   c                 ,    | j                   dz   | _         y Nrg   r   r   s    r?   r4   z;ClassPropertiesAndMethods.test_newslots.<locals>.C.__init__  s    88a<r@   Nr   r   r   r   r4   r   r@   r?   r   r@    s    (r@   r   rk   c                       e Zd Zy)2ClassPropertiesAndMethods.test_newslots.<locals>.DNrM  r   r@   r?   rN  rH    rO  r@   rN  )r6   rE   r   r  )r:   r   rB   rN  rT   s        r?   test_newslotsz'ClassPropertiesAndMethods.test_newslots  sz    	( 	( C"a(	 	C"a(r@   c                    | j                  t        t        j                         | j                  t        t        j                  d       | j                  t        t        j                  t               | j                  t        t        j                  t                G d dt              }| j                  t        |        G d dt              }| j                  t        |       y )Nr   c                   $    e Zd Zej                  Zy1ClassPropertiesAndMethods.test_bad_new.<locals>.CN)r   r   r   r6   r   r   r@   r?   r   rM  	  s    llGr@   r   c                   $    e Zd Zej                  ZyrL  )r   r   r   r`  r   r   r@   r?   r   z1ClassPropertiesAndMethods.test_bad_new.<locals>.C  s    nnGr@   )r  r   r`  r   r6   r   s     r?   test_bad_newz&ClassPropertiesAndMethods.test_bad_new  s    )V^^4)V^^R8)T\\6:)V^^T:	# 	#)Q'	% 	%)Q'r@   c                 H    G d dt               }t         j                  |       | j                  t        t         j                  |d       t         j	                   |              | j                  t        t         j                   |       d        G d dt               }t         j                  |       t         j                  |d       t         j	                   |d             | j                  t        t         j                   |d      d        G d dt               }t         j                  |       | j                  t        t         j                  |d       t         j	                   |d             t         j	                   |d      d        G d dt               }t         j                  |       | j                  t        t         j                  |d       t         j	                   |d             | j                  t        t         j                   |d      d       y )Nc                       e Zd Zy)4ClassPropertiesAndMethods.test_object_new.<locals>.ANrM  r   r@   r?   r}  rR    rO  r@   r}  r   c                       e Zd Zd Zy)rR  c                     || _         y r   rE  r:   r   s     r?   r4   z=ClassPropertiesAndMethods.test_object_new.<locals>.A.__init__  	    r@   NrK  r   r@   r?   r}  z4ClassPropertiesAndMethods.test_object_new.<locals>.A      r@   rk   c                       e Zd Zd Zy)rR  c                 ,    t         j                  |       S r   r`  r   r   r   s     r?   r   z<ClassPropertiesAndMethods.test_object_new.<locals>.A.__new__!      ~~c**r@   NrV  r   r@   r?   r}  z4ClassPropertiesAndMethods.test_object_new.<locals>.A   s    +r@   c                       e Zd Zd Zd Zy)rR  c                 ,    t         j                  |       S r   rZ  r[  s     r?   r   z<ClassPropertiesAndMethods.test_object_new.<locals>.A.__new__)  r\  r@   c                     || _         y r   rE  rU  s     r?   r4   z=ClassPropertiesAndMethods.test_object_new.<locals>.A.__init__+  rV  r@   NrF  r   r@   r?   r}  z4ClassPropertiesAndMethods.test_object_new.<locals>.A(  s    +r@   )r`  r   r  r   r4   r:   r}  s     r?   test_object_newz)ClassPropertiesAndMethods.test_object_new  s`   	 	q)V^^Q:)V__ac1=	 	 	qq!!)V__adA>	+ 	+ 	q)V^^Q:!!a 	 	
 	q)V^^Q:!)V__adA>r@   c                     G d dt               }| j                  t        |        G d d|      }t        j                         5  t        j
                  dt                |d      }d d d        | j                  j                  d       | j                  |j                  |       |`
| j                  t        |       |`
t        j                         5  t        j
                  dt                |d      }d d d        | j                  |j                  d       | j                  |j                  |       y # 1 sw Y   xY w# 1 sw Y   NxY w)Nc                       e Zd Zd Zy)=ClassPropertiesAndMethods.test_restored_object_new.<locals>.Ac                     t         r   AssertionError)r   r;   r<   s      r?   r   zEClassPropertiesAndMethods.test_restored_object_new.<locals>.A.__new__5  s    $$r@   NrV  r   r@   r?   r}  rd  4      %r@   r}  c                   *    e Zd Zej                  Zd Zy)=ClassPropertiesAndMethods.test_restored_object_new.<locals>.Bc                     || _         y r   rE  rU  s     r?   r4   zFClassPropertiesAndMethods.test_restored_object_new.<locals>.B.__init__:  rV  r@   N)r   r   r   r`  r   r4   r   r@   r?   r  rj  8  s    nnGr@   r  errorrk   )r`  r  rg  warningscatch_warningssimplefilterDeprecationWarningrE   r   r  r   )r:   r}  r  rT   s       r?   test_restored_object_newz2ClassPropertiesAndMethods.test_restored_object_new2  s   	% 	% 	.!,	 	 $$& 	!!'+=>!A	 	"a(I.!,I$$& 	!!'+=>!A	 	"a(	 		 	s   #D:#E:EEc           	          G d dt               } G d d|      } G d d|      } G d d||      }| j                  |j                         |t         g       | j                  |j                  |t         f       | j                  |j                         ||t         g       | j                  |j                  ||t         f       | j                  |j                         ||t         g       | j                  |j                  ||t         f       | j                  |j                         ||||t         g       | j                  |j                  ||||t         f       | j                   |       j	                         d        G d	 d
t
              } G d d|||||      }| j                  |j                  t         |||||f       | j                   |       j	                         d       	  G d dt
              } G d dt         |      }t         j                  |      }d|d<   | j                  d       	  G d dt
              } G d dt         |      }| j                  d       	  G d dt
              } G d dt         |      }| j                  d       y # t        $ r Y pw xY w# t        $ r Y Mw xY w# t        $ r Y y w xY w)Nc                       e Zd Zd Zy)0ClassPropertiesAndMethods.test_altmro.<locals>.Ac                      yr|  r   r   s    r?   r  z2ClassPropertiesAndMethods.test_altmro.<locals>.A.fM      r@   Nr   r   r   r  r   r@   r?   r}  rt  L  r   r@   r}  c                       e Zd Zy)0ClassPropertiesAndMethods.test_altmro.<locals>.BNrM  r   r@   r?   r  ry  N  rO  r@   r  c                       e Zd Zd Zy)0ClassPropertiesAndMethods.test_altmro.<locals>.Cc                      yr  r   r   s    r?   r  z2ClassPropertiesAndMethods.test_altmro.<locals>.C.fQ  rv  r@   Nrw  r   r@   r?   r   r{  P  r   r@   r   c                       e Zd Zy)0ClassPropertiesAndMethods.test_altmro.<locals>.DNrM  r   r@   r?   rN  r~  R  rO  r@   rN  c                       e Zd Zd Zy)?ClassPropertiesAndMethods.test_altmro.<locals>.PerverseMetaTypec                 P    t         j                  |       }|j                          |S r   )rG   mroreverse)r   Ls     r?   r  zCClassPropertiesAndMethods.test_altmro.<locals>.PerverseMetaType.mro_  s    HHSM		r@   Nr   r   r   r  r   r@   r?   PerverseMetaTyper  ^  s    r@   r  c                       e Zd Zy0ClassPropertiesAndMethods.test_altmro.<locals>.XNrM  r   r@   r?   r  r  c  rO  r@   r  rB  c                       e Zd Zd Zy)9ClassPropertiesAndMethods.test_altmro.<locals>._metaclassc                     | t         t        gS r   )r   r`  r   s    r?   r  z=ClassPropertiesAndMethods.test_altmro.<locals>._metaclass.mroj  s     $//r@   Nr  r   r@   r?   rI  r  i  s    0r@   rI  c                       e Zd Zyr  rM  r   r@   r?   r  z0ClassPropertiesAndMethods.test_altmro.<locals>.Xl  r  r@   r   r   zdevious mro() return not caughtc                       e Zd Zd Zy)r  c                     dgS r   r   r   s    r?   r  z=ClassPropertiesAndMethods.test_altmro.<locals>._metaclass.mro}  s	    3Jr@   Nr  r   r@   r?   rI  z9ClassPropertiesAndMethods.test_altmro.<locals>._metaclass|  s    r@   c                       e Zd Zyr  rM  r   r@   r?   r  z0ClassPropertiesAndMethods.test_altmro.<locals>.X  r  r@   z!non-class mro() return not caughtc                       e Zd Zd Zy)r  c                      yr   r   r   s    r?   r  z=ClassPropertiesAndMethods.test_altmro.<locals>._metaclass.mro  s    r@   Nr  r   r@   r?   rI  z9ClassPropertiesAndMethods.test_altmro.<locals>._metaclass  s    r@   c                       e Zd Zyr  rM  r   r@   r?   r  z0ClassPropertiesAndMethods.test_altmro.<locals>.X  r  r@   z$non-sequence mro() return not caught)	r`  rE   r  r^  r  rG   r   r   r   )	r:   r}  r  r   rN  r  r  rI  r  s	            r?   test_altmroz%ClassPropertiesAndMethods.test_altmroJ  sa   	$ 	$	 		$ 	$	1 	1f+.QK01a.1Q6N31a.1Q6N31aAv"67Q1a$89#&	t 	
	!Aa#3 	VQ1a$;<#&	90T 0Fj  q!AAaD II78		;T Fj 
 II9:		>T Fj 
 II<=3  		  		  		s6   ,:J 8 J+ * J: 	J('J(+	J76J7:	KKc                     G d dt                G fdd      } |       }| j                  |j                  d       d|_        | j                  |j                  d       |`| j                  |j                  d       | j                  |d   d	       d
|d<   | j                  |j
                  d       |d= | j                  |j                  d       | j                  |dd dt        dd      f       d|dd | j                  |j
                  t        dd      df       |dd= | j                  |j                  t        dd             y )Nc                       e Zd ZdZy)5ClassPropertiesAndMethods.test_overloading.<locals>.Bz<Intermediate class because object doesn't have a __setattr__Nr   r   r   r  r   r@   r?   r  r    s    Jr@   r  c                   :    e Zd Zd Z fdZ fdZd Zd Zd Zy)5ClassPropertiesAndMethods.test_overloading.<locals>.Cc                      |dk(  rd|fS t         )Nr   rH   r  r  s     r?   r  zAClassPropertiesAndMethods.test_overloading.<locals>.C.__getattr__  s    5=%t,,((r@   c                 H    |dk(  r
||f| _         y j                  | ||      S Nr   )rd  r*  )r:   r=   r  r  s      r?   r*  zAClassPropertiesAndMethods.test_overloading.<locals>.C.__setattr__  s(    5=$(%=DL==tU;;r@   c                 B    |dk(  r|| _         y j                  | |      S r  )r,  r-  )r:   r=   r  s     r?   r-  zAClassPropertiesAndMethods.test_overloading.<locals>.C.__delattr__  s"    5=#'DL==t44r@   c                 
    d|fS )Ngetitemr   r  s     r?   rp   zAClassPropertiesAndMethods.test_overloading.<locals>.C.__getitem__  s    !3''r@   c                     ||f| _         y r   )setitem)r:   r  r  s      r?   r~   zAClassPropertiesAndMethods.test_overloading.<locals>.C.__setitem__  s     #U|r@   c                     || _         y r   )delitemr  s     r?   __delitem__zAClassPropertiesAndMethods.test_overloading.<locals>.C.__delitem__  s	    "r@   N)	r   r   r   r  r*  r-  rp   r~   r  )r  s   r?   r   r    s!    )
<
5(,#r@   r   r/  r   )r   r   r   )r  r      )r   r  r   r  r  )r`  rE   r   rd  r,  r  r  rY   )r:   r   rB   r  s      @r?   test_overloadingz*ClassPropertiesAndMethods.test_overloading  s+   	K 	K	# 	#0 C 23K0EE*20"H-bEB'1R9eArl";<!BU1b\5$9:adGU1b\3r@   c           	      
    G d d      }dj                  d t        d      D              }d| d}i }t        ||       |d   }t        d	      D ]1  }| j                   | |             t	        t        d                   3 y )
Nc                       e Zd Zd Zy)FClassPropertiesAndMethods.test_load_attr_extended_arg.<locals>.Numbersc                 6    t        |j                  d            S Nrs  )r-   lstripr:   ru  s     r?   r  zRClassPropertiesAndMethods.test_load_attr_extended_arg.<locals>.Numbers.__getattr__  s    4;;s+,,r@   Nr   r   r   r  r   r@   r?   Numbersr    s    -r@   r  , c              3   (   K   | ]
  }d |d  yw)zZ._03dNr   ).0ns     r?   	<genexpr>zHClassPropertiesAndMethods.test_load_attr_extended_arg.<locals>.<genexpr>  s     <AC#w-<s   i  z"def number_attrs(Z):
    return [ z ]number_attrs   )r4  r   r]   rE   r6   )r:   r  attrscoder  r  rs  s          r?   test_load_attr_extended_argz5ClassPropertiesAndMethods.test_load_attr_extended_arg  s    	- 	- 		<s<<4UG2>T2.)r 	HA\')4d5:6FG	Hr@   c           	      ~    G d dt                d      | j                  j                         d        G fdd      } |d      }| j                  |j                         d       | j                  |j                         d       | j                  |j	                         d        G fddt               }| j                   |       j                  j
                  j                         | j                  t        j                  j                   d                  j                  d	             y )
Nc                       e Zd Zd Zd Zy)1ClassPropertiesAndMethods.test_methods.<locals>.Cc                     || _         y r   r  r  s     r?   r4   z:ClassPropertiesAndMethods.test_methods.<locals>.C.__init__  	    r@   c                     | j                   S r   r  r   s    r?   r   z5ClassPropertiesAndMethods.test_methods.<locals>.C.foo  s    vvr@   N)r   r   r   r4   r   r   r@   r?   r   r    s    r@   r   rf   c                   B    e Zd ZW  j                  ZW j                  Zy)1ClassPropertiesAndMethods.test_methods.<locals>.DN)r   r   r   r   rh  r  )r   c1s   r?   rN  r    s    %%C&&Cr@   rN  rg   c                   (    e Zd ZW  j                  Zy)1ClassPropertiesAndMethods.test_methods.<locals>.ENr   rL  s   r?   r  r    r  r@   r  r  )
r`  rE   r   rh  r  r  r   r   re  rc  )r:   rN  r  r  r   r  s       @@r?   test_methodsz&ClassPropertiesAndMethods.test_methods  s    	 	
 qT1%	 	 qT1%1%1%	 	))1551QUU]]1Q401<<=MNOr@   z)testing error message from implementationc                 ^   t         j                  }d}| j                  t              5 } |        d d d        | j	                  j
                  j                  d   |       d}| j                  t              5 } |d       d d d        | j	                  |j
                  j                  d   |       | j                  t              5 }|j                  d       d d d        | j	                  |j
                  j                  d   |       y # 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   KxY w)Nz*unbound method set.add() needs an argumentr   zBdescriptor 'add' for 'set' objects doesn't apply to a 'int' object)r  r	   r  r   rE   r  r;   re  )r:   set_addr  r  s       r?   test_methods_in_cz+ClassPropertiesAndMethods.test_methods_in_c  s    
 ''Fy) 	RI	**1-?^y) 	RAJ	**1-?y) 	ROOA	**1-?	 		 		 	s#   D8	DD#DD #D,c                     d }d }d }d }d }d }d }d/d}d	 }	d
 }
 fd} fd}d }d }dt         |t               i fdt        |t               i fdt        |t               ||dfdt        j
                  |t               i fd|	|t               i fd||t        d      i fd|
|t        d      i fd||t               d|ifd||t               d|ifdt        |t               i fdt        |t               i fdt        j                  |t               i fdt        j                  |t               i fdt        j                  |t               i fd t        |t               i fd!t        |t               i fg} G  fd"d#t              } G fd$d%t              } G d& d't               G fd(d)t              }|D ]  \  }}}} G d* d+|      }|j!                         D ]  \  }}t#        |||        t#        |||        | |              g  G d, d+|      }|j!                         D ]  \  }}t#        |||        t#        || ||              | |               j%                  d-g|        G d. d+|      }|j!                         D ]  \  }}t#        |||        t#        || |               j'                  | |               y )0Nc                 4    | 5  	 d d d        y # 1 sw Y   y xY wr   r   )managers    r?   run_contextzIClassPropertiesAndMethods.test_special_method_lookup.<locals>.run_context   s       s   c                     | S r   r   r   s    r?   idenzBClassPropertiesAndMethods.test_special_method_lookup.<locals>.iden  s    Kr@   c                      y)Ns   hellor   r   s    r?   rN  zCClassPropertiesAndMethods.test_special_method_lookup.<locals>.hello  s    r@   c                     g S r   r   r   s    r?   	empty_seqzGClassPropertiesAndMethods.test_special_method_lookup.<locals>.empty_seq  s    Ir@   c                      yr   r   r   s    r?   zerozBClassPropertiesAndMethods.test_special_method_lookup.<locals>.zero	  s    r@   c                      y)N              ?r   r   s    r?   complex_numzIClassPropertiesAndMethods.test_special_method_lookup.<locals>.complex_num  s    r@   c                     t         r   )StopIterationr   s    r?   r+  zBClassPropertiesAndMethods.test_special_method_lookup.<locals>.stop  s    r@   c                      y)NTr   )r:   things     r?   return_truezIClassPropertiesAndMethods.test_special_method_lookup.<locals>.return_true  s    r@   c                 "    t        t        |       S r   )r)  r-   r   s    r?   do_isinstancezKClassPropertiesAndMethods.test_special_method_lookup.<locals>.do_isinstance      c3''r@   c                 "    t        t        |       S r   )r  r-   r  s    r?   do_issubclasszKClassPropertiesAndMethods.test_special_method_lookup.<locals>.do_issubclass  r  r@   c                 n     G d d| j                   t              }j                   |       d   d       y )Nc                       e Zd Zy)^ClassPropertiesAndMethods.test_special_method_lookup.<locals>.do_dict_missing.<locals>.DictSubNrM  r   r@   r?   DictSubr    r  r@   r  hirn   )r  r   rE   )checkerr  r:   s     r?   do_dict_missingzMClassPropertiesAndMethods.test_special_method_lookup.<locals>.do_dict_missing  s-    '++T WYt_a0r@   c                 *    j                  |d       y)Nr  rn   rE   )rH  r  r:   s     r?   some_numberzIClassPropertiesAndMethods.test_special_method_lookup.<locals>.some_number  s    S$'r@   c                       y r   r   r;   s    r?   swallowzEClassPropertiesAndMethods.test_special_method_lookup.<locals>.swallow  s    Dr@   c                      yNrN  r   )r:   specs     r?   format_implzIClassPropertiesAndMethods.test_special_method_lookup.<locals>.format_impl  s    r@   	__bytes____reversed____length_hint__)r   __next__
__sizeof____instancecheck____missing__r  __subclasscheck__rJ   	__enter____exit____complex__
__format__	__floor__	__trunc____ceil____dir__	__round__c                   *    e Zd ZW fdZW f fd	Zy)EClassPropertiesAndMethods.test_special_method_lookup.<locals>.Checkerc                 D    |j                  dj                  |             y )Nz__getattr__ called with {0})r   format)r:   ru  tests      r?   r  zQClassPropertiesAndMethods.test_special_method_lookup.<locals>.Checker.__getattr__:  s    		7>>tDEr@   c                 x    |vr |j                  dj                  |             t        j                  | |      S )Nz __getattribute__ called with {0})r   r  r`  r&  )r:   ru  r  oks      r?   r&  zVClassPropertiesAndMethods.test_special_method_lookup.<locals>.Checker.__getattribute__<  s5    r>II@GGMN..tT::r@   Nr   r   r   r  r&  )r  r:   s   r?   Checkerr	  9  s    -1 F26 ;r@   r  c                       e Zd Zd Z fdZy)JClassPropertiesAndMethods.test_special_method_lookup.<locals>.SpecialDescrc                     || _         y r   )impl)r:   r  s     r?   r4   zSClassPropertiesAndMethods.test_special_method_lookup.<locals>.SpecialDescr.__init__A  	     	r@   c                 ^    j                  d       | j                  j                  ||      S r   )r   r  re  )r:   r   ownerrecords      r?   re  zRClassPropertiesAndMethods.test_special_method_lookup.<locals>.SpecialDescr.__get__C  s&    a yy((e44r@   N)r   r   r   r4   re  )r  s   r?   SpecialDescrr  @  s    !5r@   r  c                       e Zd Zy)IClassPropertiesAndMethods.test_special_method_lookup.<locals>.MyExceptionNrM  r   r@   r?   MyExceptionr  F  rO  r@   r  c                       e Zd Z fdZy)FClassPropertiesAndMethods.test_special_method_lookup.<locals>.ErrDescrc                     r   r   )r:   r   r  r  s      r?   re  zNClassPropertiesAndMethods.test_special_method_lookup.<locals>.ErrDescr.__get__I  s	    !!r@   Nr   r   r   re  )r  s   r?   ErrDescrr  H      "r@   r!  c                       e Zd Zy?ClassPropertiesAndMethods.test_special_method_lookup.<locals>.XNrM  r   r@   r?   r  r%  M  r  r@   r  c                       e Zd Zyr$  rM  r   r@   r?   r  z?ClassPropertiesAndMethods.test_special_method_lookup.<locals>.XU  r  r@   rf   c                       e Zd Zyr$  rM  r   r@   r?   r  z?ClassPropertiesAndMethods.test_special_method_lookup.<locals>.X]  r  r@   r   )r  r  reversedr6   r   	getsizeofr   r  mathfloortruncceildirroundr`  	Exceptionr7   rd  rE   r  )r:   r  r  rN  r  r  r  r+  r  r  r  r  r  r  r  specialsr  r  r!  r=   runner	meth_implenvr  ru  r   r  r  r  s   `                         @@@r?   test_special_method_lookupz4ClassPropertiesAndMethods.test_special_method_lookup  s   							 		(	(	1	 	!	 %r2Xy#%<dCEd353==$r: -ceRHO[ "& - "&+tSUZ'4JKgsu{T6JKG[#%<6;r:$**dCE26$**dCE26D#%4Yr2%sub1',	;f 	;	56 	5	) 		"v 	" 19 	8,D&)RG  YY[ &	c4%&AtY'13KFG  YY[ &	c4%&At\)4513KVaS$/G  YY[ &	c4%&AtXZ(k6137-	8r@   c                 X    G d dt               } |       } |       }| j                  |        | j                  t        |      t        |             t	        |       t	        |       | j                  ||       | j                  ||k7         | j                  ||k7         | j                  ||k(         | j                  t        |      j                  d      d       | j                  t        |      t        |             | j                  d|       t        d      D ]  }| j                  ||        | j                  d|        G d dt               } |       } |       }| j                  |        | j                  t        |      t        |             t	        |       t	        |       | j                  ||       | j                  ||       | j                  ||k7         | j                  ||k(         | j                  t        |      j                  d	      d       | j                  t        |      t        |             | j                  d|       t        d      D ]  }| j                  ||        | j                  d|        G d
 dt               } |d      }	 |d      }
 |d      }| j                  |	       | j                  |
        | j                  t	        |	      t	        d             | j                  |	|	       | j                  |	|
       | j                  |	|	k7         | j                  |	 |
       | j                  |	|
k         | j                  |	|
k         | j                  |
|	kD         | j                  |
|	k\         | j                  t        |	      d       | j                  t        |	      d        |t        d            }| j                  d|       t        d      D ]  }| j                  ||        | j                  d|       y )Nc                       e Zd Zd Zy)2ClassPropertiesAndMethods.test_specials.<locals>.Cc                 6    d|cxk  rdk  r	|S  t         t         Nr   r  
IndexErrorr,  s     r?   rp   z>ClassPropertiesAndMethods.test_specials.<locals>.C.__getitem__j      ;B;q;  j r@   Nr-  r   r@   r?   r   r8  i      !r@   r   zC object at r   r  r  c                       e Zd Zd Zy)2ClassPropertiesAndMethods.test_specials.<locals>.Dc                 6    d|cxk  rdk  r	|S  t         t         r:  r;  r,  s     r?   rp   z>ClassPropertiesAndMethods.test_specials.<locals>.D.__getitem__  r=  r@   Nr-  r   r@   r?   rN  r@    r>  r@   rN  zD object at c                   T    e Zd Zd Zd Zd Zd Zd Zd Zd Z	d Z
d	 Zd
 Zd Zd Zy)6ClassPropertiesAndMethods.test_specials.<locals>.Proxyc                     || _         y r   r  r  s     r?   r4   z?ClassPropertiesAndMethods.test_specials.<locals>.Proxy.__init__  r  r@   c                     | j                     S r   r  r   s    r?   r   z?ClassPropertiesAndMethods.test_specials.<locals>.Proxy.__bool__  s    #vv:~%r@   c                 ,    t        | j                        S r   )hashr  r   s    r?   __hash__z?ClassPropertiesAndMethods.test_specials.<locals>.Proxy.__hash__  s    DFF|#r@   c                      | j                   |k(  S r   r  r   s     r?   rA  z=ClassPropertiesAndMethods.test_specials.<locals>.Proxy.__eq__      vv&r@   c                      | j                   |k7  S r   r  r   s     r?   __ne__z=ClassPropertiesAndMethods.test_specials.<locals>.Proxy.__ne__  rJ  r@   c                      | j                   |k\  S r   r  r   s     r?   __ge__z=ClassPropertiesAndMethods.test_specials.<locals>.Proxy.__ge__  rJ  r@   c                      | j                   |kD  S r   r  r   s     r?   __gt__z=ClassPropertiesAndMethods.test_specials.<locals>.Proxy.__gt__      vv~%r@   c                      | j                   |k  S r   r  r   s     r?   __le__z=ClassPropertiesAndMethods.test_specials.<locals>.Proxy.__le__  rJ  r@   c                      | j                   |k  S r   r  r   s     r?   __lt__z=ClassPropertiesAndMethods.test_specials.<locals>.Proxy.__lt__  rQ  r@   c                      d| j                   z  S )NzProxy:%sr  r   s    r?   r   z>ClassPropertiesAndMethods.test_specials.<locals>.Proxy.__str__  s    !DFF**r@   c                      d| j                   z  S )Nz	Proxy(%r)r  r   s    r?   r   z?ClassPropertiesAndMethods.test_specials.<locals>.Proxy.__repr__  s    "TVV++r@   c                     || j                   v S r   r  r  s     r?   rm   zCClassPropertiesAndMethods.test_specials.<locals>.Proxy.__contains__  s    &r@   N)r   r   r   r4   r   rH  rA  rL  rN  rP  rS  rU  r   r   rm   r   r@   r?   ProxyrC    s>    &$'''&'&+,'r@   rY  rf   zProxy:0zProxy(0))r`  r  r  idrG  rE   r   assertGreaterEqualr>  findr   assertNotInr   r  )r:   r   r  c2r   rN  r  r  rY  p0p1p_1p10s                r?   test_specialsz'ClassPropertiesAndMethods.test_specialsd  sx   
	! 	! SSR BrFBrF+RRR b!r"r" 	B^ <a@R$r(+R r 	!AMM!R 	!R 	! 	! SSR BrFBrF+RRR B#r"r" 	B^ <a@R$r(+R r 	!AMM!R 	!R 	'F 	'2 1X1XBiR b47+R B#r"R$R b!R b!R),b:.E"IS!r 	"AMM!S!	"S!r@   c                    dd l } G d dt              } |       } |j                  |      }| j                   |       |       ~t	        j
                          | j                   |       d        ~ G d dt              } |       }	  |j                  |       | j                  d        G d d	t              } |       }	 |j                  |	      }| j                   |       |	       ~	t	        j
                          | j                   |       d        ~y # t        $ r%}| j                  dt        |             Y d }~d }~ww xY w)
Nr   c                       e Zd Zy)2ClassPropertiesAndMethods.test_weakrefs.<locals>.CNrM  r   r@   r?   r   rf    rO  r@   r   c                       e Zd ZdgZy)7ClassPropertiesAndMethods.test_weakrefs.<locals>.NoWeakr   Nr  r   r@   r?   NoWeakrh    s	    Ir@   ri  z!weakref.ref(no) should be illegalzweak referencec                       e Zd ZddgZy)5ClassPropertiesAndMethods.test_weakrefs.<locals>.Weakr   rf  Nr  r   r@   r?   Weakrk    s    .Ir@   rl  )
weakrefr`  refrE   r   rV  r   r   r  r>  )
r:   rm  r   rX   rri  nor  rl  yess
             r?   test_weakrefsz'ClassPropertiesAndMethods.test_weakrefs  s   	 	CGKKNa d#	 V 	 X	;GKKO II9:	/6 	/fGKKc"d#  	6MM*CH55	6s   D 	E!EEc           
          G d dt               } |       }| j                  |d       d|_        | j                  |j                  d       | j                  |j                  d       |`| j                  |d       | j                  |d       |j                  j                  |d       | j                  |j                  j                  |      d       |j                  j                  |       | j                  |d       |j                  d   }| j                  |t               t        |      }| j                  d|       | j                  d|       | j                  d	|       | j                  d
|       | j                  |j                  d       | j                  |j                  |j                  d          | j                  |j                   |j                  d          | j                  |j"                  |j                  d          dD ]$  }	 t%        ||d       | j'                  d|z         & d|_        | j                  |j                  d        G d dt               } |       }	 |D ]  }	t+        |	        	 | j'                  d       y # t(        $ rG}t+        |      j-                  d      dk  r | j'                  d|dt+        |             Y d }~d }~ww xY w# t.        $ r Y y w xY w)Nc                   6    e Zd Zd Zd Zd Z eeeed      Zy)4ClassPropertiesAndMethods.test_properties.<locals>.Cc                     | j                   S r   r/  r   s    r?   getxz9ClassPropertiesAndMethods.test_properties.<locals>.C.getx  r  r@   c                     || _         y r   r/  r  s     r?   setxz9ClassPropertiesAndMethods.test_properties.<locals>.C.setx  r  r@   c                     | ` y r   r/  r   s    r?   delxz9ClassPropertiesAndMethods.test_properties.<locals>.C.delx  r8  r@   I'm the x property.docN)r   r   r   rw  ry  r{  r  r  r   r@   r?   r   ru    s"     !tT/DEAr@   r   r  r   r0  r   r  fgetfsetfdelr|  rw  ry  r{  )r  r  r  zIexpected AttributeError from trying to set readonly %r attr on a propertyreadonlyr   zwhen setting readonly attr z2 on a property, got unexpected AttributeError msg c                       e Zd Z ed       Zy)4ClassPropertiesAndMethods.test_properties.<locals>.Dc                     ddz  S r  r   )r\  s    r?   r  z=ClassPropertiesAndMethods.test_properties.<locals>.D.<lambda>	  s
    QqS r@   N)r   r   r   r  rp   r   r@   r?   rN  r  	  s    "=1Kr@   rN  z,expected ZeroDivisionError from bad property)r`  r  r  rE   r0  r  re  r,  rI   r  r  r.  r  r  r  r  r  r  rd  r   r  r>  r\  ZeroDivisionError)
r:   r   rB   rawr  ru  r  rN  rM   r   s
             r?   test_propertiesz)ClassPropertiesAndMethods.test_properties  s   	F 	F Ca%"%b!Ca%a)	AsQ-	qa%jjoc8,Ci'fe$fe$fe$&;<chh

6 23chh

6 23chh

6 23* 		7D7T2& 		 /156 7		7 b)	2 	2 C	F A
 IIDE+ " Ys8==,q0IIHLcRUhX YY$ ! 		s*   J4K, 	K)"=K$$K),	K87K8rg   z)Docstrings are omitted with -O2 and abovec                 (      G  fddt               }y )Nc                       e Zd Zd Zd Z ee      ZW  j                  ej                  d        ee      Z	W  j                  e	j                  d       y)?ClassPropertiesAndMethods.test_properties_doc_attrib.<locals>.Ec                      y)getter methodr   r   r   s    r?   getterzFClassPropertiesAndMethods.test_properties_doc_attrib.<locals>.E.getter(	  s    r@   c                      y)zsetter methodNr   )rH  r  s     r?   setterzFClassPropertiesAndMethods.test_properties_doc_attrib.<locals>.E.setter+	      r@   r  )r  N)
r   r   r   r  r  r  proprE   r  prop2r   s   r?   r  r  '	  sK     F#DT\\?;&)EU]]D1r@   r  r`  )r:   r  s   ` r?   test_properties_doc_attribz4ClassPropertiesAndMethods.test_properties_doc_attrib$	  s    
	2 
	2r@   c                 P    	 dd l  G fddt              }y # t        $ r Y y w xY w)Nr   c                   4    e Zd Z eW  j                        Zy)>ClassPropertiesAndMethods.test_testcapi_no_segfault.<locals>.XN)r   r   r   r  test_with_docstringp)	_testcapis   r?   r  r  ;	  s    Y::;r@   r  )r  r`  ImportError)r:   r  r  s     @r?   test_testcapi_no_segfaultz3ClassPropertiesAndMethods.test_testcapi_no_segfault3	  s+    	<<F <  		s    	%%c                     G d dt                       }| j                  j                  j                  d       | j	                  |d       d|_        | j                  |d       | j                  |j                  d       | j                  |j                  d       |`| j	                  |d       | j	                  |d        G fdd	      } |       }d
|_        | j                  |j                  d
       |`|` G d dt                       }d|_        | j                  |j                  d       |` G fdd      } |       }d|_        | j                  |j                  d       |`y )Nc                       e Zd Z ed      Zej
                  d        Zej                  d        Zej                  d        Zy)9ClassPropertiesAndMethods.test_properties_plus.<locals>.CrN  r}  c                     | j                   S r   _foor   s    r?   r   z=ClassPropertiesAndMethods.test_properties_plus.<locals>.C.fooA	      yy r@   c                 $    t        |      | _        y r   r+   r  r  s     r?   r   z=ClassPropertiesAndMethods.test_properties_plus.<locals>.C.fooD	      J	r@   c                     | ` y r   r  r   s    r?   r   z=ClassPropertiesAndMethods.test_properties_plus.<locals>.C.fooG	      Ir@   N)r   r   r   r  r   r  r  deleterr   r@   r?   r   r  ?	  sN    w'CZZ! !ZZ' '[[ r@   r   rN  r   ir  r   c                   H    e Zd ZW  j                  j                  d        Zy)9ClassPropertiesAndMethods.test_properties_plus.<locals>.Dc                 (    	 | ` y # t        $ r Y y w xY wr   )r  r  r   s    r?   r   z=ClassPropertiesAndMethods.test_properties_plus.<locals>.D.fooV	  s    	% s    	N)r   r   r   r   r  rL  s   r?   rN  r  U	  s    UU]] r@   rN  r  c                       e Zd Zed        Zej
                  d        Zej
                  d        Zej                  dd       Zy)9ClassPropertiesAndMethods.test_properties_plus.<locals>.Ec                     | j                   S r   r  r   s    r?   r   z=ClassPropertiesAndMethods.test_properties_plus.<locals>.E.fooc	  r  r@   c                     t         r   )RuntimeErrorr  s     r?   r   z=ClassPropertiesAndMethods.test_properties_plus.<locals>.E.foof	  s    ""r@   c                 $    t        |      | _        y r   r  r  s     r?   r   z=ClassPropertiesAndMethods.test_properties_plus.<locals>.E.fooi	  r  r@   Nc                     | ` y r   r  r  s     r?   r   z=ClassPropertiesAndMethods.test_properties_plus.<locals>.E.fool	  r  r@   r   )r   r   r   r  r   r  r  r   r@   r?   r  r  b	  sV    ! !ZZ# #ZZ' '[[ r@   r  c                   l    e Zd ZW  j                  j                  d        Zej
                  d        Zy)9ClassPropertiesAndMethods.test_properties_plus.<locals>.Fc                     | ` y r   r  r   s    r?   r   z=ClassPropertiesAndMethods.test_properties_plus.<locals>.F.foov	  r  r@   c                 &    t        d|      | _        y r   )maxr  r  s     r?   r   z=ClassPropertiesAndMethods.test_properties_plus.<locals>.F.fooy	  s    5M	r@   N)r   r   r   r   r  r  )r  s   r?   r  r  u	  s3    UU]] ZZ* *r@   r  r   )r`  rE   r   r  r  r   r  )	r:   rX   rN  rM   r9  r  r  r   r  s	          @@r?   test_properties_plusz.ClassPropertiesAndMethods.test_properties_plus>	  sH   
	 
	 C0a'1f%$#Ea(a'	 	 C#EE	 	 C#E	* 	* C"Er@   c                    t               }| j                  |i        t        i       }| j                  |i        t        ddd      }| j                  |ddd       | j                  |t        t        |j                                            | j                  |t        t	        |j                                            t        ddd      }| j                  |t        dd             | j                  |t        d"i |       | j                  |t        ddid             | j                  |t        dgd	             | j                  |t        d
dgfi |       | j                  |t        d"i |       dddddgdfD ]"  }	 t        |       | j                  d|z         $ | j                  t              5  t        i i        d d d         G d d      }	 t         |              | j                  d       d |_	        d |_
        t         |             }| j                  ||j                           G d d      }t         |dd       |dd       |dd       |dd      g      }| j                  |ddd       t        t        t        d      t        dd                  }| j                  |t        t        d      D cg c]	  }||dz   f c}             dgd gfD ]"  }	 t        |       | j                  d!|z         $ y # t        $ r Y t        $ r |dk(  rn| j                  d|z         Y w xY w# 1 sw Y   |xY w# t        $ r Y _w xY wc c}w # t        $ r Y w xY w)#Nrg   rT   )rf   rB   rf   )onetwor  )r  )r  rg   )r  )r  r   )r  r1  r   y                0r   zno TypeError from dict(%r)c                       e Zd ZddddZy)AClassPropertiesAndMethods.test_dict_constructors.<locals>.Mappingrg   rn   r  )rf   rk   rB   N)r   r   r   r   r   r@   r?   Mappingr  	  s    1"%Dr@   r  z*no TypeError from dict(incomplete mapping)c                 H    t        | j                  j                               S r   )r6   r   r   r   s    r?   r  zBClassPropertiesAndMethods.test_dict_constructors.<locals>.<lambda>	  s    D)9$: r@   c                      | j                   |   S r   )r   r,  s     r?   r  zBClassPropertiesAndMethods.test_dict_constructors.<locals>.<lambda>	  s    diil r@   c                       e Zd Zd Zd Zy)JClassPropertiesAndMethods.test_dict_constructors.<locals>.AddressBookEntryc                      || _         || _        y r   )firstlast)r:   r  r  s      r?   r4   zSClassPropertiesAndMethods.test_dict_constructors.<locals>.AddressBookEntry.__init__	  s    "
 	r@   c                 D    t        | j                  | j                  g      S r   )r   r  r  r   s    r?   r   zSClassPropertiesAndMethods.test_dict_constructors.<locals>.AddressBookEntry.__iter__	  s    TZZ344r@   N)r   r   r   r4   r   r   r@   r?   AddressBookEntryr  	  s    !5r@   r  TimWarsawBarryPeters)r  r  rn   r   )tooshort)toolongzby 1zno ValueError from dict(%r)r   )r   rE   r6   r7   r   r   r   
ValueErrorr  r   rp   zipr   )r:   rM   badargr  r  r   bads          r?   test_dict_constructorsz0ClassPropertiesAndMethods.test_dict_constructors	  sD   FBHBQS!",-Daggi12Daggi12#$DQA./DI1I&D%34D*156D,!=CCDDI1I&BaS$. 	AFAV 		6?@	A  y) 	RL		& 	&	DO IIBC::OGLL)	5 	5 "5(3"7H5"5(3"7H57 8 	hx@AU1XuQ{+,DE!H!=q1ac(!=>? "?%<$== 	?C?S	 		7#=>	?e   ES= II:VCDE	 	  		2 ">  sN   
L M M M$0M)	M"MMM	M! M!)	M54M5c                 `   d}| j                  t               ddg       ~dddddgddd	ddit        | j                  fD ]  }t        |        d
 } G d dt              }ddg}| j                   |t        |            |        |       }| j                   |t        |            |       d|_        d |_        | j                   |t        |            |ddgz           G d d|      }ddg|z   }| j                   |t        |            |        |       }	| j                   |t        |	            |       d|	_        d |	_        | j                   |t        |	            |ddgz           G d dt        t                    }
 |
d      }d|_
        d|_        g d}t        |      D cg c]	  }||vs| }}| j                  |dd g        G d! d"|
      } |d#      }d|_
        d|_        | j                  |j                  d$       | j                  t              5  t        |       d d d        | j                  t        t	                     t        t                      G fd%d&t               G fd'dt              }t         |              y c c}w # 1 sw Y   qxY w)(Nr   junkr:   rg   y               @g       @2   2)rg   c                 P    | D cg c]  }|j                  d      r| c}S c c}w r  )rc  )stringsr\  s     r?   interestingz7ClassPropertiesAndMethods.test_dir.<locals>.interesting	  s!    &@!all3.?A@@@s   ##c                       e Zd ZdZd Zy)-ClassPropertiesAndMethods.test_dir.<locals>.Crf   c                      y r   r   r   s    r?   Cmethodz5ClassPropertiesAndMethods.test_dir.<locals>.C.Cmethod	      tr@   N)r   r   r   Cdatar  r   r@   r?   r   r  	  
    E#r@   r   r  r  c                      yr   r   r   s    r?   r  z4ClassPropertiesAndMethods.test_dir.<locals>.<lambda>	  r  r@   cdatacmethodc                       e Zd ZdZd Zy)-ClassPropertiesAndMethods.test_dir.<locals>.Arf   c                      y r   r   r   s    r?   Amethodz5ClassPropertiesAndMethods.test_dir.<locals>.A.Amethod	  r  r@   N)r   r   r   Adatar  r   r@   r?   r}  r  	  r  r@   r}  r  r  r   c                      y)Nrk   r   r   s    r?   r  z4ClassPropertiesAndMethods.test_dir.<locals>.<lambda>	  r  r@   adataamethodc                       e Zd Zy)-ClassPropertiesAndMethods.test_dir.<locals>.MNrM  r   r@   r?   Mr  	  rO  r@   r  rO   rf   )r   r  __package__
__loader____spec__rB   rT   c                   "    e Zd Zd Z ee      Zy).ClassPropertiesAndMethods.test_dir.<locals>.M2c                      y)NNot a dict!r   r   s    r?   getdictz6ClassPropertiesAndMethods.test_dir.<locals>.M2.getdict	
  s    $r@   N)r   r   r   r  r  rI   r   r@   r?   ri  r  
  s    %(Hr@   ri  m2r  c                   4    e Zd Zd Zd Z fdZd Z fdZy)3ClassPropertiesAndMethods.test_dir.<locals>.Wrapperc                     || _         y r   _Wrapper__objr+  s     r?   r4   z<ClassPropertiesAndMethods.test_dir.<locals>.Wrapper.__init__
  	     
r@   c                 2    dt        | j                        z  S )NzWrapper(%s))r   r  r   s    r?   r   z<ClassPropertiesAndMethods.test_dir.<locals>.Wrapper.__repr__
  s    $tDJJ'777r@   c                 .     | j                   |         S r   r  )r:   r  Wrappers     r?   rp   z?ClassPropertiesAndMethods.test_dir.<locals>.Wrapper.__getitem__
  s    tzz#//r@   c                 ,    t        | j                        S r   )r	  r  r   s    r?   rx   z;ClassPropertiesAndMethods.test_dir.<locals>.Wrapper.__len__ 
  s    4::&r@   c                 <     t        | j                  |            S r   )rH   r  )r:   r=   r  s     r?   r  z?ClassPropertiesAndMethods.test_dir.<locals>.Wrapper.__getattr__"
  s    wtzz4899r@   N)r   r   r   r4   r   rp   rx   r  r  s   r?   r  r  
  s    !80':r@   r  c                   (    e Zd Z fdZ ee      Zy)r  c                 &     t        |             S r   )rG   )r:   r  s    r?   
__getclassz8ClassPropertiesAndMethods.test_dir.<locals>.C.__getclass&
  s    tDz**r@   N)r   r   r   _C__getclassr  r  r	  s   r?   r   z-ClassPropertiesAndMethods.test_dir.<locals>.C%
  s    + ,Ir@   )rE   r.  rG   test_dirr`  r  r  r  r  r   rT   rB   rI   r  r   Ellipsis)r:   r  r  r  r   cstuffrX   r}  astuffrB   r  	minstancedefault_attributesr  namesri  
m2instancer  s                    @r?   r  z"ClassPropertiesAndMethods.test_dir	  sy    01 aS1#sD$1tT]]R 	CH	
	A	$ 	$ 9%SV,f5CSV,f5 "	SV,f7K.KL	$ 	$ 9%.SV,f5CSV,f5"	SV,f7K.KL	S	 	cF			8	NJqa7I.IJJc
+	) 	)
 X


,,m<y) 	
O	
 	VXH6
	:f 
	:	- 	-
 	ACK K	 	s   2	J<J(J$$J-c                 4  	
  G d dt               }| j                   |       j                  d      d        G fdd|      | j                          j                  d      d        G d	 d
|      }t        |      |_        | j                   |       j                  d      d        G 	fdd|      	| j                   	       j                  d      d        G fddt               G 
fdd	      
| j                   
       j                  d      d        G d d
      } |      |_        | j                   |       j                  d      d       	 t        	d       | j                  d       	 t        	 |              | j                  d       	 t        	      j                  d       | j                  d       	 t        	      j                   |              | j                  d         G d! d"t               } G d# d$|      } |       }| j                  |j                  d%       | j                  t        ||&  d        G d& d't               } G fd(d)|      | j                  j                         |j                         | j                  t              5  t        |d*       d d d        y # t        $ r Y Uw xY w# t        $ r Y Bw xY w# t        $ r Y &w xY w# t        $ r Y w xY w# 1 sw Y   y xY w)+Nc                       e Zd Zd Zy)0ClassPropertiesAndMethods.test_supers.<locals>.Ac                     d|z  S )NzA(%r)r   r:   rB   s     r?   rL   z5ClassPropertiesAndMethods.test_supers.<locals>.A.meth0
  s    {"r@   Nr  r   r@   r?   r}  r  /
      #r@   r}  rf   zA(1)c                   (     e Zd Z fdZd Z xZS )0ClassPropertiesAndMethods.test_supers.<locals>.Bc                 (    t        |       | _        y r   )ru  r  )r:   r  r  s    r?   r4   z9ClassPropertiesAndMethods.test_supers.<locals>.B.__init__6
  s    $Q~r@   c                 D    d|z  | j                   j                  |      z   S )NzB(%r)r  r  s     r?   rL   z5ClassPropertiesAndMethods.test_supers.<locals>.B.meth8
       {T\\%6%6q%999r@   )r   r   r   r4   rL   rx  )r  r  s   @r?   r  r  5
  s    .:r@   r  rg   zB(2)A(2)c                       e Zd Zd Zy)0ClassPropertiesAndMethods.test_supers.<locals>.Cc                 D    d|z  | j                   j                  |      z   S )NzC(%r)r  r  s     r?   rL   z5ClassPropertiesAndMethods.test_supers.<locals>.C.meth>
  r   r@   Nr  r   r@   r?   r   r"  =
  s    :r@   r   rk   zC(3)A(3)c                   "     e Zd Z fdZ xZS )0ClassPropertiesAndMethods.test_supers.<locals>.Dc                 .    d|z  t         |   |      z   S )NzD(%r))ru  rL   )r:   rB   rN  r  s     r?   rL   z5ClassPropertiesAndMethods.test_supers.<locals>.D.methE
  s    {U1d%8%;;;r@   )r   r   r   rL   rx  )r  rN  s   @r?   rN  r%  D
      < <r@   rN  rn   zD(4)C(4)B(4)A(4)c                   "     e Zd Z fdZ xZS )6ClassPropertiesAndMethods.test_supers.<locals>.mysuperc                     t        |   | S r   r~  )r:   r;   r  mysupers     r?   r4   z?ClassPropertiesAndMethods.test_supers.<locals>.mysuper.__init__M
  s    Wd4d;;r@   )r   r   r   r4   rx  )r  r+  s   @r?   r+  r)  L
  r'  r@   r+  c                       e Zd Z fdZy)0ClassPropertiesAndMethods.test_supers.<locals>.Ec                 @    d|z   |       j                  |      z   S )NzE(%r))rL   )r:   rB   r  r+  s     r?   rL   z5ClassPropertiesAndMethods.test_supers.<locals>.E.methQ
  s$    {WQ%5%:%:1%===r@   Nr  )r  r+  s   r?   r  r-  P
  s    >r@   r  r   zE(5)D(5)C(5)B(5)A(5)c                       e Zd Zd Zy)0ClassPropertiesAndMethods.test_supers.<locals>.Fc                 x    | j                   }d|d|j                  j                  d|j                  |      z   S )NzF(z)[])	_F__superr  r   rL   )r:   rB   r\  s      r?   rL   z5ClassPropertiesAndMethods.test_supers.<locals>.F.methW
  s-    LL&')=)=>JJr@   Nr  r   r@   r?   r  r0  V
  s    Kr@   r  r   z!F(6)[mysuper]E(6)D(6)C(6)B(6)A(6)r   zshouldn't allow super(D, 42)zshouldn't allow super(D, C())r   z$shouldn't allow super(D).__get__(12)z%shouldn't allow super(D).__get__(C())c                   "    e Zd Zd Z ee      Zy)5ClassPropertiesAndMethods.test_supers.<locals>.DDbasec                      yrl  r   r   s    r?   rw  z:ClassPropertiesAndMethods.test_supers.<locals>.DDbase.getx
  s    2r@   Nr   r   r   rw  r  r  r   r@   r?   DDbaser5  
  s    %Ar@   r8  c                   "    e Zd Zd Z ee      Zy)4ClassPropertiesAndMethods.test_supers.<locals>.DDsubc                      yr  r   r   s    r?   rw  z9ClassPropertiesAndMethods.test_supers.<locals>.DDsub.getx
  s    7r@   Nr7  r   r@   r?   DDsubr:  
  s    *Ar@   r<  rN  c                       e Zd Z ed       Zy)3ClassPropertiesAndMethods.test_supers.<locals>.Basec                      yr  r   r   s    r?   r  z<ClassPropertiesAndMethods.test_supers.<locals>.Base.<lambda>
  r  r@   N)r   r   r   r  aPropr   r@   r?   Baser>  
  s    /0Er@   rA  c                   ,     e Zd Ze fd       Z xZS )2ClassPropertiesAndMethods.test_supers.<locals>.Subc                     t         |   S r   )ru  r@  )klassSubr  s    r?   r  z7ClassPropertiesAndMethods.test_supers.<locals>.Sub.test
  s    S--r@   )r   r   r   r  r  rx  )r  rF  s   @r?   rF  rC  
  s    . .r@   rF  r  )r`  rE   rL   ru  r  r3  r   r   re  r  r  r@  r  )r:   r}  r   r  r8  r<  ddrA  r  rN  r  rF  r+  r  s           @@@@@r?   test_supersz%ClassPropertiesAndMethods.test_supers,
  s   	# 	# 	!f-	: 	: 	!j1	: 	: Ah!j1	<1 	< 	!&89	<e 	<	> 	> 	!&<=	K 	K aj!&IJ	6!RL II45	7!QSM II56	>!HR  II<=	?!HQS! II=>
	V 		F 	 Ww'ub+R0
	16 	1	.$ 	.
 	TZZ0 y) 	$1	 	o  		  		  		  		D	 	sT   (K K )K. K> 7L	KK	K+*K+.	K;:K;>	L
LLc                 4    G fddt               | j                  t         d      dz         d       | j                  t         d      dz         d        d      }| j                  |d       | j                  t        |      d       | j                  t        |      j                  t                | j                  t        |      t        d             | j                  |j                  t                | j                  |d	z	  j                  t                | j                  |d	z  j                  t                | j                   d	      d
z  j                  t                | j                   d	      d
z	  j                  t                 G fddt               | j                  t         d      dz         d       | j                  t        d d      z         d        d      }| j                  |d       | j                  t        |      d       | j                  t        |      t        d             | j                  t        |      j                  t                | j                  |j                  t                | j                  | j                  t                | j                   d	       j                  t                | j                  |d	z	  j                  t                | j                  |d	z  j                  t                | j                  |d	z
  j                  t                | j                  |dz  j                  t                | j                  |dz  j                  t                | j                  |dz  j                  t                | j                  d|z  j                  t                | j                  |d	z  j                  t                | j                  |d	z  j                  t                | j                  |dz  j                  t                | j                   d	      d
z  j                  t                | j                   d	      d
z	  j                  t                | j                  t         d	            j                  t                 G d dt               } |d      }| j                  |d	z   j                  t                | j                  d	|z   j                  t                 |d      }| j                  |j                  i        | j                  t        |      d        G d dt              }| j                  t         |d            d        |d      }| j                  |d       | j                  t        |      d       | j                  t        |      j                  t               | j                  t        |      t        d             | j                  |j                  t                G d dt              } |dd      }| j                  t        |      d       t        dd      }| j                  |j                  t               | j                  ||       | j                  t        |      |       | j                  t        |      j                  t                ||      }| j                  t        |      d       | j                  ||       | j                  t        |      |       | j                  t        |      j                  t               | j                  t        |      t        |             | j                  |j                  t               | j                  |d	z   j                  t               | j                  |d	z   |       | j                  |d	z
  j                  t               | j                  |d	z
  |       | j                  |dz  j                  t               | j                  |dz  |       | j                  |dz  j                  t               | j                  |dz  |        G d  d!t              } |d"      }| j                  |d"       | j                  |j                          |d#             | j                  |j                         j                          |d"             t        d$      D ]E  } |t        |            }|j                         }	|	j                         }
| j                  |
|       G  |d%      }| j                  t        |      d%       | j                  t        |      j                  t               | j                  t        |      t        d%             | j                  |d d  j                  t               | j                  |dz  j                  t               | j                  |d	z  j                  t               | j                  |d&z   j                  t                |d&      }| j                  t        |      d&       | j                  t        |      j                  t               | j                  ||z   j                  t               | j                  |d	z  j                  t               | j                  |dz  j                  t               | j                  |d'z  j                  t               | j                  |d d  j                  t                G d( d)t              } |d*      }| j                  |d*       | j                  |j                          |d+             | j                  |j                         j                          |d*             t        d,      D ]b  } |d-j                  t        t         t        |                        }|j                         }|j                         }	| j                  |	|       d  |d.      }| j                  t        |      d.       | j                  t        |      j                  t               d/} ||      }| j                  ||       | j                  t        |      |       | j                  t        |      j                  t               | j                  t        |      t        |             | j                  |di|   d       | j                  |di|   d       | j                  |d-z   j                  t               | j                  |d-z   |       | j                  d-|z   j                  t               | j                  d-|z   |       | j                  |d	z  j                  t               | j                  |d	z  d-       | j                  |dz  j                  t               | j                  |dz  |       | j                  |d'z  j                  t               | j                  |d'z  ||z          | j                  |d d  j                  t               | j                  |d d  |       | j                  |d	d	 j                  t               | j                  |d	d	 d-       | j                  |j#                         j                  t               | j                  |j#                         |       | j                  |j%                         j                  t               | j                  |j%                         |       | j                  |j'                         j                  t               | j                  |j'                         |       i }| j                  |j)                  |      j                  t               | j                  |j)                  |      |       | j                  |j+                  d0d0      j                  t               | j                  |j+                  d0d0      |       | j                  |j-                  t/        |            j                  t               | j                  |j-                  t/        |            |       | j                  |j1                  t/        |            j                  t               | j                  |j1                  t/        |            |       | j                  |j3                  t/        |            j                  t               | j                  |j3                  t/        |            |       | j                  |j5                         j                  t               | j                  |j5                         |        G d1 d2t              } |d3      }	| j                  |	d3       | j                  |	j                          |d4             | j                  |	j                         j                          |d3             d.} ||      }	| j                  t        |	      |       | j                  t        |	      j                  t               | j                  t        |	      t        |             | j                  |	di|   d       | j                  |di|	   d       | j                  |	j#                         j                  t               | j                  |	j#                         |       | j                  |	j%                         j                  t               | j                  |	j%                         |       | j                  |	j'                         j                  t               | j                  |	j'                         |       | j                  |	j+                  d0d0      j                  t               | j                  |	j+                  d0d0      |       | j                  |	j+                  d5d5      j                  t               | j                  |	j+                  d5d5      |       | j                  |	j3                  t/        |	            j                  t               | j                  |	j3                  t/        |	            |       | j                  |	j-                  t/        |	            j                  t               | j                  |	j-                  t/        |	            |       | j                  |	j1                  t/        |	            j                  t               | j                  |	j1                  t/        |	            |       | j                  |	j5                         j                  t               | j                  |	j5                         |       | j                  |	j7                         j                  t               | j                  |	j7                         |       | j                  |	j9                         j                  t               | j                  |	j9                         |       | j                  |	j;                         j                  t               | j                  |	j;                         |       | j                  |	d-z   j                  t               | j                  |	d-z   |       | j                  d-|	z   j                  t               | j                  d-|	z   |       | j                  |	d	z  j                  t               | j                  |	d	z  d-       | j                  |	dz  j                  t               | j                  |	dz  |       | j                  |	d'z  j                  t               | j                  |	d'z  ||z          | j                  |	d d  j                  t               | j                  |	d d  |       | j                  |	d	d	 j                  t               | j                  |	d	d	 d-        G d6 d7t<              } |t        d            }| j                  |t=        t        d                   |j?                  d8       | j                  |t=        t        d            d8gz          d|d<   | j                  |t=        t        d9                   |jA                  t        d9d:             | j                  |t=        t        d:                   g |d;d  | j                  |t=        t        d<                   |d=d<= | j                  t/        |      d=       | j                  |t=        t        d=                   | j                  t=        |      t=        t        d=                   | j                  |d	   d	       | j                  |d   d       | j                  |d>   d	       | j                  |d   d       | j                  |d d t=        t        d                   y )?Nc                       e Zd Zd Z fdZy)@ClassPropertiesAndMethods.test_basic_inheritance.<locals>.hexintc                     t        |       S r   )hexr   s    r?   r   zIClassPropertiesAndMethods.test_basic_inheritance.<locals>.hexint.__repr__
      4y r@   c                 <     t         j                  | |            S r   )r-   ri   )r:   r   hexints     r?   ri   zHClassPropertiesAndMethods.test_basic_inheritance.<locals>.hexint.__add__
  s    ckk$677r@   N)r   r   r   r   ri   )rP  s   r?   rP  rK  
  s    !8r@   rP     	   0x10i  0x3efi90  r   r   c                   0     e Zd Zg Zd Z fdZeZ xZS )AClassPropertiesAndMethods.test_basic_inheritance.<locals>.octlongc                     t        |       S r   )octr   s    r?   r   zIClassPropertiesAndMethods.test_basic_inheritance.<locals>.octlong.__str__
  rN  r@   c                 @    | j                  t        |   |            S r   )r  ru  ri   )r:   r   r  octlongs     r?   ri   zIClassPropertiesAndMethods.test_basic_inheritance.<locals>.octlong.__add__
  s    ~~eGT&B5&IJJr@   )r   r   r   r   r   ri   r   rx  )r  rZ  s   @r?   rZ  rV  
  s    I!KHr@   rZ  rk   r   0o10i  0o5675rf   r  c                       e Zd Zy)CClassPropertiesAndMethods.test_basic_inheritance.<locals>.longcloneNrM  r   r@   r?   	longcloner^  
  rO  r@   r_  c                        e Zd ZdgZddZd Zy)CClassPropertiesAndMethods.test_basic_inheritance.<locals>.precfloatr   c                 $    t        |      | _        y r   )r-   r   )r:   r  r   s      r?   r4   zLClassPropertiesAndMethods.test_basic_inheritance.<locals>.precfloat.__init__
  s    I	r@   c                 $    d| j                   | fz  S )Nr   r   r   s    r?   r   zLClassPropertiesAndMethods.test_basic_inheritance.<locals>.precfloat.__repr__
  s    D 111r@   N)r   r   )r   r   r   r   r4   r   r   r@   r?   	precfloatra  
  s    I&2r@   rd  g?z1.1g    @c                       e Zd Zd Zy)DClassPropertiesAndMethods.test_basic_inheritance.<locals>.madcomplexc                 8    d| j                   | j                  fz  S )Nz%.17gj%+.17gr   r   r   s    r?   r   zMClassPropertiesAndMethods.test_basic_inheritance.<locals>.madcomplex.__repr__
  s    %DII(>>>r@   N)r   r   r   r   r   r@   r?   
madcomplexrf  
  s    ?r@   ri  rn   z4j-3c                       e Zd ZdZd Zy)BClassPropertiesAndMethods.test_basic_inheritance.<locals>.madtupleNc                     | j                   | j                   S t        |       }|j                          | j                  |      | _         | j                   S r   )_revr6   r  r  r:   r  s     r?   revzFClassPropertiesAndMethods.test_basic_inheritance.<locals>.madtuple.rev  sB    99(99$J		 NN1-	yy r@   r   r   r   rn  rp  r   r@   r?   madtuplerl  	      D!r@   rr  )
rf   rg   rk   rn   r   r   rQ     rR  r   )
r   rR  rt  rQ  r   r   rn   rk   rg   rf   i   )rf   rg   rk   rn   r   r   rg   c                       e Zd ZdZd Zy)CClassPropertiesAndMethods.test_basic_inheritance.<locals>.madstringNc                     | j                   | j                   S t        |       }|j                          | j                  dj	                  |            | _         | j                   S Nr   rn  r6   r  r  r4  ro  s     r?   rp  zGClassPropertiesAndMethods.test_basic_inheritance.<locals>.madstring.rev.  J    99(99$J		 NN2771:6	yy r@   rq  r   r@   r?   	madstringrv  ,  rs  r@   r{  abcdefghijklmnopqrstuvwxyzzyxwvutsrqponmlkjihgfedcba   r   12345z     r  c                       e Zd ZdZd Zy)DClassPropertiesAndMethods.test_basic_inheritance.<locals>.madunicodeNc                     | j                   | j                   S t        |       }|j                          | j                  dj	                  |            | _         | j                   S rx  ry  ro  s     r?   rp  zHClassPropertiesAndMethods.test_basic_inheritance.<locals>.madunicode.revn  rz  r@   rq  r   r@   r?   
madunicoder  l  rs  r@   r  ABCDEFFEDCBAxyc                       e Zd Zy)AClassPropertiesAndMethods.test_basic_inheritance.<locals>.sublistNrM  r   r@   r?   sublistr    rO  r@   r  rN  r         r  r  )!r-   rE   r   r  r  rG  r>  r+   rI   r.   r   r  rp  r   r4  mapr+  stripr  rstrip	translatereplaceljustr	  rjustcenterlowerupper
capitalizetitler6   r   r2  )r:   rB   r_  rd  ri  baserr  r   rN   r  r   r{  r\  identitytabr  r  rP  rZ  s                   @@r?   test_basic_inheritancez0ClassPropertiesAndMethods.test_basic_inheritance
  s   	8S 	8 	fQi!m,f5fTlQ./95ME"Q'c!f&&,a$u+.rnnc*qAv((#.qAv((#.vayB1137vayB1137	c 	 	WQZ!^,f5 	Q./:ENE"Q'a$u+.c!f&&,rnnc*rnnc*
{--s3qAv((#.qAv((#.q1u''-q1u''-qAv((#.qAv((#.q1u''-q1u''-q1u''-q2v((#.wqzR'22C8wqzR'22C8c'!*o//5	 	aLq1u''-q1u''- bMR(Q$	2 	2 	in-u5eG$q7+eAh((%0a$w-0rnne,	? 	? r1a&)r1~1D!T*--w7qMa&)D!T*--w7a$t*-1"1!a%**G4Q%!a%**G4Q%!a%**G4Q%!a%**G4Q%	!u 	! *+12(+@"AB1F(GHs 	#Aq"AAAQ"		#
 [!q;/eAh((%0a${"34adnne,q1u''/q1u''/q2v((%0RLq2&eAh((%0q1u''/q1u''/q1u''/q1u''/adnne,	! 	! 2389),H"IJ	2N(OPs 	#A"''#c58"456AAAQ"		#
 gQ)c!f&&,dOD!Q&c!f&&,a$t*-!Qq)$1q)q2v((#.R&rAv((#.a&q1u''-Q#q1u''-Q%q1u''-Qt,adnnc*1t$a!f&&,1Q$aggi))3/D)ahhj**C0T*ahhj**C0T*akk+.88#>[148aiiS)33S93,d3aggc!fo//5Q$/aggc!fo//5Q$/ahhs1v&00#6#a&)40aggi))3/D)	! 	! x H%*X"67
8(<=tQ&c!f&&,a$t*-!Qq)$1q)aggi))3/D)ahhj**C0T*ahhj**C0T*aiiS)33S93,d3aiid+55s;4.5ahhs1v&00#6#a&)40aggc!fo//5Q$/aggc!fo//5Q$/aggi))3/D)aggi))3/D)alln..4.aggi))3/D)q2v((#.R&rAv((#.a&q1u''-Q#q1u''-Q%q1u''-Qt,adnnc*1t$a!f&&,1Q$	d 	E!HDqN+	DqNgY67!DqN+	q"DrO,"#DrO,beHQ$DrO,a$uRy/21q!1q!3#2"2AU1X/r@   c                    | j                  t        d      5  t        d       d d d        | j                  t        d      5  t        d       d d d        | j                  t        d      5  t	        d       d d d        | j                  t        dd      t        dd             | j                  t        d	      d
       | j                  t        dd      d       | j                  t        d      5  t        t        d             d d d        | j                  t        d      5  t        d       d d d        t        t        t        t        t        t        t        t        fD ]   }	  |d       | j                  d|z         " y # 1 sw Y   mxY w# 1 sw Y   OxY w# 1 sw Y   1xY w# 1 sw Y   xY w# 1 sw Y   xY w# t        $ r Y nw xY w)Nzkeyword argumentrf   r  rg   r   i  rh  i  r  500   abcstrict)r`  errorsr$  rk   )sequencer.  )bogus_keyword_argz4expected TypeError from bogus keyword argument to %r)r[  r   r-   r.   boolrE   r   r>  r  r   r6   r   )r:   constructors     r?   test_keywordsz'ClassPropertiesAndMethods.test_keywords  s   ##I/AB 	!H	##I/AB 	AJ	##I/AB 	1I	bs3WS"5EFC%0F8<eD##I/AB 	%58$	%##I/AB 	%)$	%  Wc3!4) 	+K+a0 		P)* +	+	 		 		 	
	% 	%	% 	%  sM   FF-F)8F6,G/	GFF&)F36F?G	GGc                     G fddt               | j                   d      d       | j                  d d             | j                  t         d            d        d      d d      d	 d
      di}| j                  | d         d       | j                  | d         d	       | j                  | d         d       | j                   d      |       | j                  |j                   d            d       y )Nc                   (    e Zd ZdZd Z fdZd Zy)FClassPropertiesAndMethods.test_str_subclass_as_dict_key.<locals>.cistrzSubclass of str that computes __eq__ case-insensitively.

            Also computes a hash code of the string in canonical form.
            c                 b    |j                         | _        t        | j                        | _        y r   )r  	canonicalrG  hashcoder  s     r?   r4   zOClassPropertiesAndMethods.test_str_subclass_as_dict_key.<locals>.cistr.__init__  s    !& $T^^ 4r@   c                 ^    t        |      s |      }| j                  |j                  k(  S r   )r)  r  )r:   r   cistrs     r?   rA  zMClassPropertiesAndMethods.test_str_subclass_as_dict_key.<locals>.cistr.__eq__  s)    !%/!%LE~~88r@   c                     | j                   S r   )r  r   s    r?   rH  zOClassPropertiesAndMethods.test_str_subclass_as_dict_key.<locals>.cistr.__hash__  s    }}$r@   N)r   r   r   r  r4   rA  rH  )r  s   r?   r  r    s    
59
%r@   r  ABCr$  aBcr  rf   r  rg   tHreerk   tWoTHrEEONethrEE)r>  rE   r  r   )r:   rM   r  s     @r?   test_str_subclass_as_dict_keyz7ClassPropertiesAndMethods.test_str_subclass_as_dict_key  s    	%C 	%$ 	uu-e-U5\*E25\1eElAuW~qA5<!,5<!,5>*A.eElA&uW~.2r@   c                   
  G d d      }|t         t        fD ]  } G 
fdd|      
 
d      } 
d      } 
d      }| j                  |d       |||d}dD ]  }dD ]  }d	D ]  }	| j                  t        d
|	z        t        d|	z        d||fz         | j                  t        d|	z        t        d|	z        d||fz         | j                  t        d|	z        t        d|	z        d||fz             y )Nc                       e Zd Zy)CClassPropertiesAndMethods.test_classic_comparisons.<locals>.classicNrM  r   r@   r?   classicr  %  rO  r@   r  c                   P    e Zd Zd Z fdZ fdZ fdZ fdZ fdZ fdZ	y)	=ClassPropertiesAndMethods.test_classic_comparisons.<locals>.Cc                 $    t        |      | _        y r   r-   r  r  s     r?   r4   zFClassPropertiesAndMethods.test_classic_comparisons.<locals>.C.__init__*      !$UDJr@   c                     t        |      r| j                  |j                  k(  S t        |t              st        |t              r| j                  |k(  S t        S r   r)  r  r-   r   r:   r   r   s     r?   rA  zDClassPropertiesAndMethods.test_classic_comparisons.<locals>.C.__eq__,  H    !%+#zzU[[88!%-E31G#zzU22))r@   c                     t        |      r| j                  |j                  k7  S t        |t              st        |t              r| j                  |k7  S t        S r   r  r  s     r?   rL  zDClassPropertiesAndMethods.test_classic_comparisons.<locals>.C.__ne__2  r  r@   c                     t        |      r| j                  |j                  k  S t        |t              st        |t              r| j                  |k  S t        S r   r  r  s     r?   rU  zDClassPropertiesAndMethods.test_classic_comparisons.<locals>.C.__lt__8  H    !%+#zzEKK77!%-E31G#zzE11))r@   c                     t        |      r| j                  |j                  k  S t        |t              st        |t              r| j                  |k  S t        S r   r  r  s     r?   rS  zDClassPropertiesAndMethods.test_classic_comparisons.<locals>.C.__le__>  r  r@   c                     t        |      r| j                  |j                  kD  S t        |t              st        |t              r| j                  |kD  S t        S r   r  r  s     r?   rP  zDClassPropertiesAndMethods.test_classic_comparisons.<locals>.C.__gt__D  r  r@   c                     t        |      r| j                  |j                  k\  S t        |t              st        |t              r| j                  |k\  S t        S r   r  r  s     r?   rN  zDClassPropertiesAndMethods.test_classic_comparisons.<locals>.C.__ge__J  r  r@   N)
r   r   r   r4   rA  rL  rU  rS  rP  rN  rL  s   r?   r   r  )  s&    ,******r@   r   rf   rg   rk   rj   r    r"   r$   r%   r&   r'   c[x] %s c[y]x %s y
x=%d, y=%d	c[x] %s y	x %s c[y])r-   r`  rE   rF   )r:   r  r  r  r^  c3rX   r  yopr   s             @r?   test_classic_comparisonsz2ClassPropertiesAndMethods.test_classic_comparisons#  s3   	 	 c6* 9	<D&*D &*P 1B1B1BR#2"%A <  
<A> 	<((nr.A)B%)(R-%8%1QF%:< ((kB.>)?%)(R-%8%1QF%:< ((kB.>)?%)(R-%8%1QF%:<	<
<<]9	<r@   c                      G d dt               } |d      } j                  |d        j                  d|        G d dt               } |d      } j                  |d        j                  d|        G d d	      }|t        t        t        fD ]  } G  fd
d|       d      } d      } d      }	 j                  |d       |||	d}
dD ]  }dD ]  }dD ]  } j                  t        d|z        t        d|z        d||fz          j                  t        d|z        t        d|z        d||fz          j                  t        d|z        t        d|z        d||fz             y )Nc                       e Zd Zy):ClassPropertiesAndMethods.test_rich_comparisons.<locals>.ZNrM  r   r@   r?   r  r  e  rO  r@   r  rf   y      ?        c                       e Zd Zd Zy);ClassPropertiesAndMethods.test_rich_comparisons.<locals>.ZZc                 @    	 t        | |z
        dk  S #  t        cY S xY w)Ngư>)r+   r   r   s     r?   rA  zBClassPropertiesAndMethods.test_rich_comparisons.<locals>.ZZ.__eq__k  s(    *te|,44*))s    NrB  r   r@   r?   ZZr  j  s    *r@   r  gׇP  ?c                       e Zd Zy)@ClassPropertiesAndMethods.test_rich_comparisons.<locals>.classicNrM  r   r@   r?   r  r  t  rO  r@   r  c                   Z    e Zd Zd ZfdZ fdZ fdZ fdZ fdZ fdZ	 fdZ
y	)
:ClassPropertiesAndMethods.test_rich_comparisons.<locals>.Cc                 $    t        |      | _        y r   r  r  s     r?   r4   zCClassPropertiesAndMethods.test_rich_comparisons.<locals>.C.__init__x  r  r@   c                 (    j                  d       y )Nzshouldn't call __cmp__)r   )rH  r   r:   s     r?   __cmp__zBClassPropertiesAndMethods.test_rich_comparisons.<locals>.C.__cmp__z  s    II67r@   c                     t        |      r| j                  |j                  k(  S t        |t              st        |t              r| j                  |k(  S t        S r   r  r  s     r?   rA  zAClassPropertiesAndMethods.test_rich_comparisons.<locals>.C.__eq__|  r  r@   c                     t        |      r| j                  |j                  k7  S t        |t              st        |t              r| j                  |k7  S t        S r   r  r  s     r?   rL  zAClassPropertiesAndMethods.test_rich_comparisons.<locals>.C.__ne__  r  r@   c                     t        |      r| j                  |j                  k  S t        |t              st        |t              r| j                  |k  S t        S r   r  r  s     r?   rU  zAClassPropertiesAndMethods.test_rich_comparisons.<locals>.C.__lt__  r  r@   c                     t        |      r| j                  |j                  k  S t        |t              st        |t              r| j                  |k  S t        S r   r  r  s     r?   rS  zAClassPropertiesAndMethods.test_rich_comparisons.<locals>.C.__le__  r  r@   c                     t        |      r| j                  |j                  kD  S t        |t              st        |t              r| j                  |kD  S t        S r   r  r  s     r?   rP  zAClassPropertiesAndMethods.test_rich_comparisons.<locals>.C.__gt__  r  r@   c                     t        |      r| j                  |j                  k\  S t        |t              st        |t              r| j                  |k\  S t        S r   r  r  s     r?   rN  zAClassPropertiesAndMethods.test_rich_comparisons.<locals>.C.__ge__  r  r@   N)r   r   r   r4   r  rA  rL  rU  rS  rP  rN  )r   r:   s   r?   r   r  w  s+    ,8******r@   r   rg   rk   rj   r  r  r  r  r  r  )r   rE   r-   r`  r6   rF   )r:   r  rW  r  zzr  r  r  r^  r  rX   r  r  r  r   s   `             @r?   test_rich_comparisonsz/ClassPropertiesAndMethods.test_rich_comparisonsc  s   	 	aDD!q!	* 	* 	]T"r"	 	c640 :	@D(*D (*R 1B1B1BR#2"%A @  
@A> 	@((nr.A)B)-hm)<)5A)>@ ((kB.>)?)-hm)<)5A)>@ ((kB.>)?)-hm)<)5A)>@	@
@@_:	@r@   c                 p     ddl m}  fd} ||j                  d        |t        j                  d       y )Nr   )FileIOc                 >    j                  | j                  |       y r   )rE   r  )descrwhatr:   s     r?   checkz6ClassPropertiesAndMethods.test_descrdoc.<locals>.check  s    U]]D1r@   zTrue if the file is closedz!the real part of a complex number)_ior  closedr   r   )r:   r  r  s   `  r?   test_descrdocz'ClassPropertiesAndMethods.test_descrdoc  s)    	2fmm9:gll?@r@   c                      G d dt                G fdd      }| j                  |j                  d       | j                   |       j                  d       y )Nc                       e Zd Zd Zy)?ClassPropertiesAndMethods.test_doc_descriptor.<locals>.DocDescrc                 d    |r|j                   j                  dz   }|r|j                  }d|d|S )Nz	 instancezobject=z; type=)r  r   )r:   r`  otypes      r?   re  zGClassPropertiesAndMethods.test_doc_descriptor.<locals>.DocDescr.__get__  s3    #--66DF!NNE/5u==r@   Nr   r   r@   r?   DocDescrr    s    >r@   r  c                       e Zd Z W         Zy)?ClassPropertiesAndMethods.test_doc_descriptor.<locals>.NewClassNr  )r  s   r?   NewClassr    s
    jGr@   r  zobject=None; type=NewClassz'object=NewClass instance; type=NewClass)r`  rE   r  )r:   r  r  s     @r?   test_doc_descriptorz-ClassPropertiesAndMethods.test_doc_descriptor  sI    	>v 	>	! 	!))+GH++-VWr@   c                 N     G d dt               } G d dt               } G d dt               } G d d||      }||||fD ]Z  }||||fD ]O  } |       }||_         j                  |j                  |       ||_         j                  |j                  |       Q \  fd	} | |       t                |t               |        | |       d
        | |       t                 |t               t                |t               t                 G d dt              }	 |dt                |dt
               t               }
 ||
t                ||
t        d              ~
 G d dt               } G d dt               } G d dt               } G d dt               } G d dt               } G d d|      } G d d|      } G d d|      } G d d |      } G d! d"|      } G d# d$|      }||f||f||f||f||ffD ]  \  }} |       }d
|_        ||_         j                  |j                  |d%|d&|d'        j                  |j                  d
       ||_         j                  |j                  |d%|d&|d'        j                  |j                  d
        ||||||||t        |	f
D ]*  }||||||||t        |	f
D ]  }||u r | |       |        ,  G d( d)t                G fd*d+t               }t        d,      D cg c]	  } |        }}~y c c}w )-Nc                       e Zd Zy)3ClassPropertiesAndMethods.test_set_class.<locals>.CNrM  r   r@   r?   r   r    r  r@   r   c                       e Zd Zy)3ClassPropertiesAndMethods.test_set_class.<locals>.DNrM  r   r@   r?   rN  r    r  r@   rN  c                       e Zd Zy)3ClassPropertiesAndMethods.test_set_class.<locals>.ENrM  r   r@   r?   r  r    r  r@   r  c                       e Zd Zy)3ClassPropertiesAndMethods.test_set_class.<locals>.FNrM  r   r@   r?   r  r    r  r@   r  c                     	 || _         j                  d| d|       	 t        | d       j                  d| z         y # t        $ r Y -w xY w# t        t        f$ r Y y w xY w)Nshouldn't allow z.__class__ = r  z shouldn't allow del %r.__class__)r  r   r   r,  r  )r  r   r:   s     r?   cantz6ClassPropertiesAndMethods.test_set_class.<locals>.cant  ss    H 		AFGB;' 		<q@A   ~. s"   A A 	AAA$#A$rf   c                       e Zd Zg Zy)5ClassPropertiesAndMethods.test_set_class.<locals>.IntNr  r   r@   r?   Intr
    s    B	r@   r  Trg   c                       e Zd ZddgZy)3ClassPropertiesAndMethods.test_set_class.<locals>.GrB   rT   Nr  r   r@   r?   rv  r    r<  r@   rv  c                       e Zd ZddgZy)3ClassPropertiesAndMethods.test_set_class.<locals>.HrT   rB   Nr  r   r@   r?   rI  r    r<  r@   rI  c                       e Zd ZddgZy)3ClassPropertiesAndMethods.test_set_class.<locals>.IrB   rT   Nr  r   r@   r?   r  r    r<  r@   r  c                       e Zd ZddgZy)3ClassPropertiesAndMethods.test_set_class.<locals>.JrX   rT   Nr  r   r@   r?   Jr    r<  r@   r  c                       e Zd Zg dZy)3ClassPropertiesAndMethods.test_set_class.<locals>.K)rB   rT   rM   Nr  r   r@   r?   Kr    r	  r@   r  c                       e Zd ZdgZy)3ClassPropertiesAndMethods.test_set_class.<locals>.Lr9  Nr  r   r@   r?   r  r    r  r@   r  c                       e Zd ZdgZy)3ClassPropertiesAndMethods.test_set_class.<locals>.Mr9  Nr  r   r@   r?   r  r    r  r@   r  c                       e Zd ZdgZy)3ClassPropertiesAndMethods.test_set_class.<locals>.Nrf  Nr  r   r@   r?   r!  r    rj  r@   r!  c                       e Zd ZdgZy)3ClassPropertiesAndMethods.test_set_class.<locals>.PrI   Nr  r   r@   r?   Pr     re  r@   r   c                       e Zd Zy)3ClassPropertiesAndMethods.test_set_class.<locals>.QNrM  r   r@   r?   Qr"    rO  r@   r#  c                       e Zd ZddgZy)3ClassPropertiesAndMethods.test_set_class.<locals>.RrI   rf  Nr  r   r@   r?   Rr%    s    #]3Ir@   r&  z
assigning z as __class__ for z silently failedc                       e Zd Zy)3ClassPropertiesAndMethods.test_set_class.<locals>.ONrM  r   r@   r?   Or(    rO  r@   r)  c                       e Zd Z fdZy)3ClassPropertiesAndMethods.test_set_class.<locals>.Ac                     | _         y r   r  )r:   r)  s    r?   r3  z;ClassPropertiesAndMethods.test_set_class.<locals>.A.__del__  s
    !"r@   Nr   r   r   r3  )r)  s   r?   r}  r+    s    #r@   r}  r   )
r`  r  r  r6   r-   r  rG   rB   rE   r   )r:   r   rN  r  r  r   cls2r  r  r  orv  rI  r  r  r  r  r  r!  r   r#  r&  r}  r   r)  s   `                       @r?   test_set_classz(ClassPropertiesAndMethods.test_set_class  s   1aA: 	0C1a
 0E"akk40!akk3/0	0	B 	QS$TVQQS!QS&VXtTVV&#&T3QHQQT
	# 	#	# 	#	# 	#	# 	#	( 	(	 		 		( 	(	% 	%	 		4 	4 a&1a&1a&1a&1a&A 
	%ICAACAKMM!++tIMqQSQSS!$AKMM!++sILaPRQSS!$
	% aAq!Q44 	"C1aAq!Qc9 "$;SUD!"	"	 		# 	#  *%QQS%% &s   L"c                      G d dt               } |       }ddi|_         j                  |j                  d        fd |d         |g         |d       |` G d dt                fd} G d	 d
t              } G d dt              } G d dt         |      } G d dt         |      }|||fD ]0  } ||       |j                  }		 d|	d<    j                  d|z         2  G d dt        j                        }
 G d dt        j                        }|
|fD ]!  } |d      } ||       d|j                  d<   # d } G d dt              } G d dt              }t        ||fD ]T  } |       }ddi|_         j                  |j                  d        j                   ||       |t                            V y # t        $ r Y w xY w)Nc                       e Zd Zy)2ClassPropertiesAndMethods.test_set_dict.<locals>.CNrM  r   r@   r?   r   r3  $  r  r@   r   rT   rf   c                 n    	 || _         j                  d| d|       y # t        t        f$ r Y y w xY w)Nr  z.__dict__ = )rI   r   r  r   )r  r   r:   s     r?   r  z5ClassPropertiesAndMethods.test_set_dict.<locals>.cant(  s<    J!
 		4HI #I. s   " 44c                       e Zd Zy)5ClassPropertiesAndMethods.test_set_dict.<locals>.BaseNrM  r   r@   r?   rA  r6  4  rO  r@   rA  c                     | i        	 | ` j                  d| z         j                   d   }	 |j	                  | i        j                  d| z         y# t        t        f$ r Y Hw xY w# t        t        f$ r Y yw xY w)zR
            x has to be an instance of a class inheriting from Base.
            zshouldn't allow del %r.__dict__rI   z&dict_descr allowed access to %r's dictN)rI   r   r  r   r  )r  
dict_descrrA  r  r:   s     r?   verify_dict_readonlyzEClassPropertiesAndMethods.test_set_dict.<locals>.verify_dict_readonly6  s     BKAJ 		;a?@z2JH""1b) 		BQFG #I.  #I. s"   A A. A+*A+.B ?B c                       e Zd Zy)6ClassPropertiesAndMethods.test_set_dict.<locals>.Meta1NrM  r   r@   r?   Meta1r;  J  rO  r@   r<  c                       e Zd Zy)6ClassPropertiesAndMethods.test_set_dict.<locals>.Meta2NrM  r   r@   r?   Meta2r>  L  rO  r@   r?  c                       e Zd Zy)2ClassPropertiesAndMethods.test_set_dict.<locals>.DNrM  r   r@   r?   rN  rA  N  rO  r@   rN  rB  c                       e Zd Zy)2ClassPropertiesAndMethods.test_set_dict.<locals>.ENrM  r   r@   r?   r  rC  P  rO  r@   r  eggsr   z%r's __dict__ can be modifiedc                       e Zd Zy)8ClassPropertiesAndMethods.test_set_dict.<locals>.Module1NrM  r   r@   r?   Module1rF  ]  rO  r@   rG  c                       e Zd Zy)8ClassPropertiesAndMethods.test_set_dict.<locals>.Module2NrM  r   r@   r?   Module2rI  _  rO  r@   rJ  c                 4    	 | ` y# t        t        f$ r Y yw xY w)NTF)rI   r   r  )r9  s    r?   can_delete_dictz@ClassPropertiesAndMethods.test_set_dict.<locals>.can_delete_dictj  s*    J  ~. s    c                       e Zd Zy);ClassPropertiesAndMethods.test_set_dict.<locals>.Exception1NrM  r   r@   r?   
Exception1rN  q  rO  r@   rO  c                       e Zd Zy);ClassPropertiesAndMethods.test_set_dict.<locals>.Exception2NrM  r   r@   r?   
Exception2rQ  s  rO  r@   rR  rB   )r`  rI   rE   rT   rG   r   r   r<  r=  r0  rB   r  )r:   r   rB   r9  r<  r?  rN  r  r   
class_dictrG  rJ  r=  r   rL  rO  rR  ExceptionTyper9  rA  r  s   `                  @@r?   test_set_dictz'ClassPropertiesAndMethods.test_set_dict"  s   C1X
a 	J 	QQQ
J	6 		H(	D$ 		D$ 		% 		% 	a7 	AC %JA%+
6" 		9C?@	A	e&& 		dE,, 	!7* 	*JV$C %#)CLL 	*		D 		y 	&
J> 	PMAqAJQSS!$_Q/1NO		P=  s   G	GGc                 ~    G fddt               | j                  t         d       d      z         d       | j                  t         d      dz         d       | j                  t        d d      z         d       | j                  t         d       d      z        d       | j                  t        d d      z        d       | j                  t         d      dz        d       | j                  t        t         d       d       d                  d        G d	 d
t              }y )Nc                   :    e Zd Zd Z fdZeZd fd	Zd fd	Zy)BClassPropertiesAndMethods.test_binary_operator_override.<locals>.Ic                     dt        |       z  S )NzI(%r)r-   r   s    r?   r   zKClassPropertiesAndMethods.test_binary_operator_override.<locals>.I.__repr__~  s    T**r@   c                 >     t        |       t        |      z         S r   rZ  )r:   r   r  s     r?   ri   zJClassPropertiesAndMethods.test_binary_operator_override.<locals>.I.__add__  s    TSZ/00r@   Nc           	          |$ t        t        |       t        |                  S  t        t        |       t        |      t        |                  S r   r   r-   r:   r   r   r  s      r?   __pow__zJClassPropertiesAndMethods.test_binary_operator_override.<locals>.I.__pow__  sB    ;STCJ788STCJCABBr@   c           	          |% t        t        |      t        |       |            S  t        t        |      t        |       t        |                  S r   r]  r^  s      r?   __rpow__zKClassPropertiesAndMethods.test_binary_operator_override.<locals>.I.__rpow__  sD    ;SUSY<==SUSYCABBr@   r   )r   r   r   r   ri   r   r_  ra  )r  s   r?   r  rX  }  s    +1HC
Cr@   r  rf   rg   zI(3)rk   zI(8)r   c                       e Zd Zd Zy)BClassPropertiesAndMethods.test_binary_operator_override.<locals>.Sc                 D    | j                         |j                         k(  S r   )r  r   s     r?   rA  zIClassPropertiesAndMethods.test_binary_operator_override.<locals>.S.__eq__  s    zz|u{{}44r@   NrB  r   r@   r?   Src    r  r@   re  )r-   rE   r   r   r>  )r:   re  r  s     @r?   test_binary_operator_overridez7ClassPropertiesAndMethods.test_binary_operator_override{  s    	C 	C" 	adQqTk*F3adQh0a!A$h0adadl+V4a1Q4i&1adai&1c!A$!ad34f=	5 	5r@   c                     G d dt               } G d d|      } G d d|      } G d d||      } |       }t        |      }d	 |_        | j                  t        |      d
       d |_        | j                  t        |      d       d |_        | j                  t        |      d       d |_        | j                  t        |      d       d |_        | j	                  t
        t        |       |`| j                  t        |      d       d |_        | j	                  t
        t        |       |`| j                  t        |      d       d |_        | j	                  t
        t        |       |`| j                  t        |      d
       d |_        | j	                  t
        t        |       |`| j                  t        |      |       d
|_        d
|_        | j                  |j                  d
       | j                  |j                  d
       d }||_        | j                  |j                  d       | j                  |j                  d
       d }||_	        | j                  |j                  d       | j                  |j                  d       | j                  |j                  d
       |`| j                  |j                  d
       |`| j                  |j                  d       | j                  |j                  d
       |`		 |j                   | j                  d        G d dt               } G d d|      }~t        j                          d |_        y # t        $ r Y Cw xY w)Nc                       e Zd Zy>ClassPropertiesAndMethods.test_subclass_propagation.<locals>.ANrM  r   r@   r?   r}  rj    rO  r@   r}  c                       e Zd Zy>ClassPropertiesAndMethods.test_subclass_propagation.<locals>.BNrM  r   r@   r?   r  rm    rO  r@   r  c                       e Zd Zy)>ClassPropertiesAndMethods.test_subclass_propagation.<locals>.CNrM  r   r@   r?   r   ro    rO  r@   r   c                       e Zd Zy)>ClassPropertiesAndMethods.test_subclass_propagation.<locals>.DNrM  r   r@   r?   rN  rq    rO  r@   rN  c                      yrl  r   r   s    r?   r  zEClassPropertiesAndMethods.test_subclass_propagation.<locals>.<lambda>  r  r@   r   c                      y)N:  r   r   s    r?   r  zEClassPropertiesAndMethods.test_subclass_propagation.<locals>.<lambda>  r  r@   rt  c                      y)N   r   r   s    r?   r  zEClassPropertiesAndMethods.test_subclass_propagation.<locals>.<lambda>  r  r@   rv  c                      yr(  r   r   s    r?   r  zEClassPropertiesAndMethods.test_subclass_propagation.<locals>.<lambda>  r  r@   r   c                 :    |dk(  ryt         j                  | |      S )Nr   r  )r`  r&  r  s     r?   r&  zMClassPropertiesAndMethods.test_subclass_propagation.<locals>.__getattribute__  s    u}**466r@   r  c                 "    |dv ryt        |      )N)r   r   r   rN  r  r  s     r?   r  zHClassPropertiesAndMethods.test_subclass_propagation.<locals>.__getattr__  s    -- &&r@   rN  zd.foo should be undefined nowc                       e Zd Zyri  rM  r   r@   r?   r}  z>ClassPropertiesAndMethods.test_subclass_propagation.<locals>.A  rO  r@   c                       e Zd Zyrl  rM  r   r@   r?   r  z>ClassPropertiesAndMethods.test_subclass_propagation.<locals>.B  rO  r@   c                       y r   r   r  s    r?   r  zEClassPropertiesAndMethods.test_subclass_propagation.<locals>.<lambda>  r  r@   )r`  rG  rH  rE   r  r   r   r   r&  r  r   r   r  r   rV  r~   )	r:   r}  r  r   rN  rM   	orig_hashr&  r  s	            r?   test_subclass_propagationz3ClassPropertiesAndMethods.test_subclass_propagation  s   	 		 		 		1 	CG	$
a"%%
a#&%
a#&%
a#&
)T1-Ja#&
)T1-Ja#&
)T1-Ja"%
)T1-Ja),##	7 .##	' $)###E(#M	7EE II56	 		 	'  		s   M" "	M.-M.c                 0   dd l } G d dt              }d} ||      }| j                  |j                  |      |j                  |              G d dt              } |d      }	 |j                  |       | j                  d       y # t        $ r Y y w xY w)	Nr   c                       e Zd Zy)BClassPropertiesAndMethods.test_buffer_inheritance.<locals>.MyBytesNrM  r   r@   r?   r  r    rO  r@   r  r  c                       e Zd Zy)@ClassPropertiesAndMethods.test_buffer_inheritance.<locals>.MyIntNrM  r   r@   r?   r  r    rO  r@   r  r   z2subclass of int should not have a buffer interface)binasciir  rE   b2a_hexr-   r   r   )r:   r  r  r  rO   r  s         r?   test_buffer_inheritancez1ClassPropertiesAndMethods.test_buffer_inheritance  s     		e 	DM 	))!,h.>.>t.DE	C 	"I	QIIJK 		s   &"B	 		BBc                 8   dd l  G fddt              } |d      }| j                  t        |      |       | j                  t        t        |            t               | j                  t        t	        |            t               | j                  t        |      d       | j                  t        |      d       | j                  t	        |      d       | j                  |j                         d       | j                  |j                         d       y )Nr   c                       e Zd Z fdZd Zy)GClassPropertiesAndMethods.test_str_of_str_subclass.<locals>.octetstringc                 b    j                  | j                  d            j                  d      S )Nascii)r  encodedecode)r:   r  s    r?   r   zOClassPropertiesAndMethods.test_str_of_str_subclass.<locals>.octetstring.__str__  s(    ''G(<=DDWMMr@   c                     | dz   S )Nz reprr   r   s    r?   r   zPClassPropertiesAndMethods.test_str_of_str_subclass.<locals>.octetstring.__repr__  s    g~%r@   N)r   r   r   r   r   )r  s   r?   octetstringr    s    N&r@   r  r}  A   41zA repr)r  r>  rE   rG   r   ordr   r   )r:   r  r/  r  s      @r?   test_str_of_str_subclassz2ClassPropertiesAndMethods.test_str_of_str_subclass  s    	&# 	& a+.c!fs+d1g,Q&Q&a(+d+x0r@   c                      G d dt               } G d d      } |d      |_        | j                  t        |      t                | j                  t         |             t                y )Nc                       e Zd Zy)LClassPropertiesAndMethods.test_repr_with_module_str_subclass.<locals>.StrSubNrM  r   r@   r?   StrSubr    rO  r@   r  c                       e Zd Zy)JClassPropertiesAndMethods.test_repr_with_module_str_subclass.<locals>.SomeNrM  r   r@   r?   Somer    rO  r@   r  example)r>  r   r  r   )r:   r  r  s      r?   "test_repr_with_module_str_subclassz<ClassPropertiesAndMethods.test_repr_with_module_str_subclass  sN    	S 		 	 +d4j#.d46lC0r@   c                     d }| j                  |j                  d      d       t               }t        j                  |ddd       | j                  |d       y )	Nc                     | S r   r   r  s    r?   r  z;ClassPropertiesAndMethods.test_keyword_arguments.<locals>.f  s    (r@   r   r  u   abc½€latin1r  )encodingr  s   abc?)rE   rg  	bytearrayr4   )r:   r  bas      r?   test_keyword_argumentsz0ClassPropertiesAndMethods.test_keyword_arguments  sT    b)2.[2$,Y 	 	@[)r@   c                      G d dt               } |       |_        | j                  t              5    |               d d d        y # 1 sw Y   y xY w)Nc                       e Zd Zy)8ClassPropertiesAndMethods.test_recursive_call.<locals>.ANrM  r   r@   r?   r}  r  &  rO  r@   r}  )r`  rg  r  RecursionErrorr`  s     r?   test_recursive_callz-ClassPropertiesAndMethods.test_recursive_call$  sE    	 	 S
~. 	ACE	 	 	s   AAc                     g  G fddt               } |       }| j                  g        ~t        j                          | j                  dg        G d dt               } |       }|d= | j	                  d       y # t
        $ r Y y w xY w)Nc                       e Zd Z fdZy)5ClassPropertiesAndMethods.test_delete_hook.<locals>.Cc                 (    j                  d       y r   r  )r:   r(  s    r?   r3  z=ClassPropertiesAndMethods.test_delete_hook.<locals>.C.__del__1  s    

1r@   Nr-  )r(  s   r?   r   r  0  s    r@   r   rf   c                       e Zd Zy)5ClassPropertiesAndMethods.test_delete_hook.<locals>.DNrM  r   r@   r?   rN  r  9  r  r@   rN  r   z$invalid del() didn't raise TypeError)r`  rE   r   rV  r   r   )r:   r   rX   rN  rM   r(  s        @r?   test_delete_hookz*ClassPropertiesAndMethods.test_delete_hook-  s    	 	 Cb!qc"C1ii>? $s   ,B 	BBc                     G d dt               } |       }	 t        |       | j                  d        G d dt              } |       }	 t        |       | j                  d       y # t        $ r Y ?w xY w# t        $ r Y y w xY w)Nc                       e Zd Zy)?ClassPropertiesAndMethods.test_hash_inheritance.<locals>.mydictNrM  r   r@   r?   mydictr  B  rO  r@   r  z#hash() of dict subclass should failc                       e Zd Zy)?ClassPropertiesAndMethods.test_hash_inheritance.<locals>.mylistNrM  r   r@   r?   mylistr  L  rO  r@   r  z#hash() of list subclass should fail)r   rG  r   r   r6   )r:   r  rM   r  s       r?   test_hash_inheritancez/ClassPropertiesAndMethods.test_hash_inheritance?  s    	T 	H	=G II;<	T 	H	=G II;<  		  		s#   A( A7 (	A43A47	BBc                    ddz    | j                  d       dj                  d       | j                  d       dj	                  dg       | j                  d       dj                  d       | j                  d	       d
d z   | j                  d       di z   | j                  d       ddz   | j                  d       ddz   | j                  d       ddz   | j                  d       dd z   | j                  d       | j                  dj                         d       | j                  dj                         d       | j                  ddz  d       | j                  ddz  d       y # t        $ r Y bw xY w# t        $ r Y Pw xY w# t        $ r Y =w xY w# t        $ r Y +w xY w# t        $ r Y %w xY w# t        $ r Y w xY w# t        $ r Y w xY w# t        $ r Y w xY w# t        $ r Y w xY w# t        $ r Y w xY w)NrB   r   z'' + 5 doesn't raise TypeErrorr   z%''.split('') doesn't raise ValueErrorr   z$''.join([0]) doesn't raise TypeError5z'''.rindex('5') doesn't raise ValueErrorz%(n)sz&'%(n)s' % None doesn't raise TypeErrorz%(nz&'%(n' % {} '' doesn't raise ValueErrorz%*sr$  z''%*s' % ('abc') doesn't raise TypeErrorz%*.*s)r$  r   z,'%*.*s' % ('abc', 5) doesn't raise TypeErrorz%srf   rg   z%'%s' % (1, 2) doesn't raise TypeError%z#'%' % None doesn't raise ValueError534253rf   534253xz%c)r   r   splitr  r4  rindexrE   isdigitr   s    r?   test_str_operationsz-ClassPropertiesAndMethods.test_str_operationsV  s   1Wii89XXb\ii?@WWaS\ii>?YYs^iiABt^ii@ARZii@Ae_iiABz!iiFGF]ii?@4Zii=>))+Q/**,a06*S)U $ 4 $ 4 $ 4 $ $ $ 4s   E- E= F F >F- F= *G  G G- ,G= -	E:9E:=	F
	F
	FF	F*)F*-	F:9F:=	G
	G
	GG	G*)G*-	G:9G:=	H
	H
c                 f     G d d      } |       } |       }||_         ||_        t        |      }y )Nc                       e Zd Zy)?ClassPropertiesAndMethods.test_deepcopy_recursive.<locals>.NodeNrM  r   r@   r?   rV  r    rO  r@   rV  )rT   rB   r   )r:   rV  rB   rT   rW  s        r?   test_deepcopy_recursivez1ClassPropertiesAndMethods.test_deepcopy_recursive  s1    	 	FFQKr@   c                 4   ddl m} |j                  |      }t        |       | j	                  |d       | j	                  |d       | j	                  |d       | j                  |j                         d|_        | j                  |j                  ddi       y )Nr   )r=  r   __file__r   rf   )	r<  r=  r   r>  r  r  rI   r   rE   )r:   r  rO   s      r?   test_uninitialized_modulesz4ClassPropertiesAndMethods.test_uninitialized_modules  sz    )IIaLAa,a,a'$eQZ0r@   c                     G fddt               } G d d|      | j                   |d      g d       | j                   d      g d        d       }| j                  |j                  d         |d      }| j                  |       | j                  |j                  d        d      }| j                  |       | j                  |j                  d        G d dt               }| j                   |dd	      |dd	f        G d
 d|      | j                   dd	      dd	f        G d dt               }| j                   |dd	      ||dd	f        G d d|      | j                   dd	      dd	f       y )Nc                       e Zd Z fdZy)3ClassPropertiesAndMethods.test_funny_new.<locals>.Cc                     t        |t              rg dS t        |t              rt        j	                        S t        j	                  |       S )Nrj   )r)  r>  r-   r`  r   )r   r  rN  s     r?   r   z;ClassPropertiesAndMethods.test_funny_new.<locals>.C.__new__  s9    c3'	)9S)&..2C+C#^^C00r@   NrV  )rN  s   r?   r   r    s    1r@   r   c                       e Zd Zd Zy)3ClassPropertiesAndMethods.test_funny_new.<locals>.Dc                     || _         y r   rE  r:   r  s     r?   r4   z<ClassPropertiesAndMethods.test_funny_new.<locals>.D.__init__  rV  r@   NrK  r   r@   r?   rN  r    rW  r@   rN  r  rj   rf   c                       e Zd Zed        Zy)r  c                      | S r   r   r  s    r?   r   z;ClassPropertiesAndMethods.test_funny_new.<locals>.C.__new__      r@   N)r   r   r   rh  r   r   r@   r?   r   z3ClassPropertiesAndMethods.test_funny_new.<locals>.C  s     r@   rg   c                       e Zd Zyr  NrM  r   r@   r?   rN  z3ClassPropertiesAndMethods.test_funny_new.<locals>.D  rO  r@   c                       e Zd Zed        Zy)r  c                      | S r   r   r  s    r?   r   z;ClassPropertiesAndMethods.test_funny_new.<locals>.C.__new__  r  r@   N)r   r   r   r  r   r   r@   r?   r   z3ClassPropertiesAndMethods.test_funny_new.<locals>.C  s     r@   c                       e Zd Zyr  rM  r   r@   r?   rN  z3ClassPropertiesAndMethods.test_funny_new.<locals>.D  rO  r@   )r`  rE   r   r  )r:   r   rM   rN  s      @r?   test_funny_newz(ClassPropertiesAndMethods.test_funny_new  sd   	1 	1
	 	 	3+3+dG%aDa#"aDa#"	 	 	1a1a),	 	1a1a),	 	 	1a1aA,/	 	1a1aA,/r@   c                 t    G d dt               } |       }|}|dz  }| j                  ||df       |}|dz  }| j                  ||df       |}|dz  }| j                  ||df       |}|dz  }| j                  ||df       |}|d z  }| j                  ||d f       |}|dz  }| j                  ||df       y )Nc                       e Zd Zd Zy)2ClassPropertiesAndMethods.test_imul_bug.<locals>.Cc                 
    | |fS r   r   r   s     r?   rv   z;ClassPropertiesAndMethods.test_imul_bug.<locals>.C.__imul__  s    e}$r@   N)r   r   r   rv   r   r@   r?   r   r    rh  r@   r   r  rg   rk   l                r   r`  rE   )r:   r   r  r  s       r?   test_imul_bugz'ClassPropertiesAndMethods.test_imul_bug  s    	% 	% C	SQH%	QQF#	QQF#	VQK(	T	QI&	U
QJ'r@   c                     dd l } G  fddt              } |d      }|j                  d        j                  |j                  d        j                  |j                         d       |j                  |      } j                  |j                  d        j                  |j                         d       |j                  |      } j                  |j                  d        j                  |j                         d       y )Nr   c                   4    e Zd ZddZddZd Zd Z fdZy)7ClassPropertiesAndMethods.test_copy_setstate.<locals>.CNc                      || _         || _        y r   )r   _C__foorU  s     r?   r4   z@ClassPropertiesAndMethods.test_copy_setstate.<locals>.C.__init__  s     
r@   c                     || _         y r   rE  rU  s     r?   setfooz>ClassPropertiesAndMethods.test_copy_setstate.<locals>.C.setfoo  rV  r@   c                     | j                   S r   )r  r   s    r?   getfooz>ClassPropertiesAndMethods.test_copy_setstate.<locals>.C.getfoo  r  r@   c                     | j                   gS r   rE  r   s    r?   __getstate__zDClassPropertiesAndMethods.test_copy_setstate.<locals>.C.__getstate__  s    z!r@   c                 ^    j                  t        |      d       |d   x| _        | _        y r  )rE   r	  r  r   )rH  lstr:   s     r?   __setstate__zDClassPropertiesAndMethods.test_copy_setstate.<locals>.C.__setstate__  s)      S1-*-a&0eir@   r   )r   r   r   r4   r  r  r  r  r   s   r?   r   r    s    !""1r@   r   r   r  )r   r`  r  rE   r   r  r   )r:   r   r   rB   rT   s   `    r?   test_copy_setstatez,ClassPropertiesAndMethods.test_copy_setstate  s    	1 	1 bE	#R(IIaL#R(MM!#R(r@   c                    | j                  dd d d       | j                  dt        d         d       | j                  t        j                  dt        d            d        G d dt              }| j                   |d      d d d       | j                   |d      t        d         d       | j                   |d      j                  t        d            d       | j                  dd d d       | j                  dt        d         d       | j                  t        j                  dt        d            d        G d	 d
t              }| j                   |d      d d d       | j                   |d      t        d         d       | j                   |d      j                  t        d            d       | j                  g dd d ddg       | j                  g dt        d         ddg       | j                  t
        j                  g dt        d            ddg        G d dt
              }| j                   |g d      d d ddg       | j                   |g d      t        d         ddg       | j                   |g d      j                  t        d            ddg        |g d      }ddg|t        dd      <   | j                  |g d       ddg|t        ddd      <   | j                  |g d       |j                  t        dd      ddg       | j                  |g d       |j                  t        ddd      ddg       | j                  |g d       y )NrN  rn   hellc                       e Zd Zd Zy)0ClassPropertiesAndMethods.test_slices.<locals>.Sc                 .    t         j                  | |      S r   )r>  rp   r  s     r?   rp   z<ClassPropertiesAndMethods.test_slices.<locals>.S.__getitem__  s    tQ//r@   Nr-  r   r@   r?   re  r    s    0r@   re  rj   rg   r  c                       e Zd Zd Zy)0ClassPropertiesAndMethods.test_slices.<locals>.Tc                 .    t         j                  | |      S r   )r  rp   r  s     r?   rp   z<ClassPropertiesAndMethods.test_slices.<locals>.T.__getitem__  s    ((q11r@   Nr-  r   r@   r?   r  r        2r@   r  rf   c                       e Zd Zd Zy)0ClassPropertiesAndMethods.test_slices.<locals>.Lc                 .    t         j                  | |      S r   )r6   rp   r  s     r?   rp   z<ClassPropertiesAndMethods.test_slices.<locals>.L.__getitem__  s    ''a00r@   Nr-  r   r@   r?   r  r    r  r@   r  rk   )rf   rk   rg   r   )rk   rf   rg   )rk   rg   rf   )rg   rk   rf   )rE   rY   r>  rp   r  r6   r~   )r:   re  r  r  rB   s        r?   test_slicesz%ClassPropertiesAndMethods.test_slices  s    	!f-q*F3%(;VD	0 	0 	7BQ07E!H-v67//a96B!e,q*E2**7E!H=uE	2 	2 	7BQ/7E!H-u57//a95A!qe,q*QqE2))'58<qeD	1 	1 	7BQ!A/7E!H-!u57//a9Aa5AgJA%1+G$qE%1a.G$	eAqkAa5)G$	eAq!nqe,G$r@   c                      G fddt                       }d|_        ~t        j                          | j	                  t        j                        d       `y )Nc                       e Zd Zg Z fdZy)>ClassPropertiesAndMethods.test_subtype_resurrection.<locals>.Cc                 <    j                   j                  |        y r   )	containerr   r   s    r?   r3  zFClassPropertiesAndMethods.test_subtype_resurrection.<locals>.C.__del__(  s    ""4(r@   N)r   r   r   r  r3  rL  s   r?   r   r  %  s    I)r@   r   r   rf   )r`  ru  r   rV  rE   r	  r  r3  )r:   rX   r   s     @r?   test_subtype_resurrectionz3ClassPropertiesAndMethods.test_subtype_resurrection"  sP    	) 	) C
 Q[[)1- Ir@   c                 X     G d dt               }d }t        d      D ]
  } ||      } ~y )Nc                       e Zd ZdgZd Zy)9ClassPropertiesAndMethods.test_slots_trash.<locals>.trashr  c                     || _         y r   r  r  s     r?   r4   zBClassPropertiesAndMethods.test_slots_trash.<locals>.trash.__init__@  r  r@   N)r   r   r   r   r4   r   r@   r?   trashr  >  s    Ir@   r  iP  )r`  r   )r:   r  r/  r   s       r?   test_slots_trashz*ClassPropertiesAndMethods.test_slots_trash;  s4    	F 	 u 	AaA	r@   c                 ,    G d dt               } G d dt               } G d d||      }t        j                         r&| j                  |j                  |j                         | j                  |d       | j                  |d       d	 |       _        y )
Nc                       e Zd ZdZy)DClassPropertiesAndMethods.test_slots_multiple_inheritance.<locals>.Ar   Nr  r   r@   r?   r}  r  I      Ir@   r}  c                       e Zd Zy)DClassPropertiesAndMethods.test_slots_multiple_inheritance.<locals>.BNrM  r   r@   r?   r  r  K  rO  r@   r  c                       e Zd ZdZy)DClassPropertiesAndMethods.test_slots_multiple_inheritance.<locals>.Cr   Nr  r   r@   r?   r   r  M  r  r@   r   rI   rf  rg   )r`  r   r  rE   __basicsize__r   r  )r:   r}  r  r   s       r?   test_slots_multiple_inheritancez9ClassPropertiesAndMethods.test_slots_multiple_inheritanceG  su    	 		 		! 	$$&Q__aoo>1j)1m,r@   c                      G d dt               } |       }| j                  |dz  d       | j                  |dz  d       | j                  d|z  d       | j                  d|z  d       y )Nc                       e Zd Zd Zd Zy).ClassPropertiesAndMethods.test_rmul.<locals>.Cc                      y)Nr   r   r   s     r?   rz   z6ClassPropertiesAndMethods.test_rmul.<locals>.C.__mul__Y      r@   c                      y)Nrmulr   r   s     r?   r|   z7ClassPropertiesAndMethods.test_rmul.<locals>.C.__rmul__[  s    r@   N)r   r   r   rz   r|   r   r@   r?   r   r  X  s    r@   r   rg   r   g@r  r  r3  s      r?   	test_rmulz#ClassPropertiesAndMethods.test_rmulU  sg    	 	
 C1e$3&1f%Q'r@   c                 :     G d dt               } |       }|dz  }y )Nc                       e Zd Zd Zy).ClassPropertiesAndMethods.test_ipow.<locals>.Cc                      y r   r   r   s     r?   __ipow__z7ClassPropertiesAndMethods.test_ipow.<locals>.C.__ipow__g      r@   Nr   r   r   r  r   r@   r?   r   r  f      r@   r   rg   r  r3  s      r?   	test_ipowz#ClassPropertiesAndMethods.test_ipowc  s     	 	 C	ar@   c                      G d d      } G d d|      } G d d|      } |       } |       } |       }||z  }| j                  |d       ||z  }| j                  |d       y )	Nc                       e Zd Zd Zy)FClassPropertiesAndMethods.test_ipow_returns_not_implemented.<locals>.Ac                     t         S r   r   r   s     r?   r  zOClassPropertiesAndMethods.test_ipow_returns_not_implemented.<locals>.A.__ipow__n  r   r@   Nr!  r   r@   r?   r}  r&  m  r   r@   r}  c                       e Zd Zd Zy)FClassPropertiesAndMethods.test_ipow_returns_not_implemented.<locals>.Bc                      yr   r   r   s     r?   ra  zOClassPropertiesAndMethods.test_ipow_returns_not_implemented.<locals>.B.__rpow__r      r@   Nr   r   r   ra  r   r@   r?   r  r)  q      r@   r  c                       e Zd Zd Zy)FClassPropertiesAndMethods.test_ipow_returns_not_implemented.<locals>.Cc                      yrD  r   r   s     r?   r_  zNClassPropertiesAndMethods.test_ipow_returns_not_implemented.<locals>.C.__pow__v  r+  r@   Nr   r   r   r_  r   r@   r?   r   r/  u  r-  r@   r   rf   rg   r  )r:   r}  r  r   rB   rT   rX   s          r?   !test_ipow_returns_not_implementedz;ClassPropertiesAndMethods.test_ipow_returns_not_implementedl  sm    	& 	&	 		 	 CCC	aA	aAr@   c                 h     G d d      }t               } |       }||z  }| j                  |d       y )Nc                       e Zd Zd Zy)1ClassPropertiesAndMethods.test_no_ipow.<locals>.Bc                      yr   r   r   s     r?   ra  z:ClassPropertiesAndMethods.test_no_ipow.<locals>.B.__rpow__  r+  r@   Nr,  r   r@   r?   r  r5    r-  r@   r  rf   r  )r:   r  rB   rT   s       r?   test_no_ipowz&ClassPropertiesAndMethods.test_no_ipow  s5    	 	 HC	aAr@   c                 X   d }| j                  t              5 }|dz  }d d d        | j                  dt        j                               | j                  t              5 }|dz  }d d d        | j                  dt        |j                               y # 1 sw Y   wxY w# 1 sw Y   ;xY w)Nrg   z#unsupported operand type(s) for **=z"unsupported operand type(s) for **)r  r   r  r>  r  )r:   r  r  r  s       r?   test_ipow_exception_textz2ClassPropertiesAndMethods.test_ipow_exception_text  s    y) 	R!GA	;S=NOy) 	RQA	:C<MN	 		 	s   B B B B)c                     G d dt               } G fddt                G d d|      } G d d|      } |       } |       }|f|_        f|_        | j                  |j                         d	       | j                  |j                         d	       | j                  |j                  d
       | j                  |j                  d
       | j                  j                         |g       	 |`| j                  d       	 d|_        | j                  d       	 |f|_        | j                  d       	 ||f|_        | j                  d       	 |f|_        | j                  d       y # t        t        f$ r Y zw xY w# t        $ r)}t        |      dk(  r| j                  d       Y d }~d }~ww xY w# t        $ r Y w xY w# t        $ r Y w xY w# t        $ r Y y w xY w)Nc                       e Zd Zy)7ClassPropertiesAndMethods.test_mutable_bases.<locals>.CNrM  r   r@   r?   r   r<    rO  r@   r   c                   (     e Zd Z fdZd Z xZS )8ClassPropertiesAndMethods.test_mutable_bases.<locals>.C2c                 .    |dk(  ryt         |   |      S )NrB   rg   )ru  r&  )r:   ru  r  r  s     r?   r&  zIClassPropertiesAndMethods.test_mutable_bases.<locals>.C2.__getattribute__  s    3; T;DAAr@   c                      yr   r   r   s    r?   rL   z=ClassPropertiesAndMethods.test_mutable_bases.<locals>.C2.meth  r+  r@   )r   r   r   r&  rL   rx  )r  r  s   @r?   r  r>    s    B
r@   r  c                       e Zd Zy)7ClassPropertiesAndMethods.test_mutable_bases.<locals>.DNrM  r   r@   r?   rN  rB    rO  r@   rN  c                       e Zd Zy)7ClassPropertiesAndMethods.test_mutable_bases.<locals>.ENrM  r   r@   r?   r  rD    rO  r@   r  rf   rg   z&shouldn't be able to delete .__bases__r   z)shouldn't be able to set .__bases__ to ()z/a new-style class can't have only classic basesz'wrong error message for .__bases__ = ()z.shouldn't be able to create inheritance cyclesz#didn't detect repeated base classes)
r`  rJ   rE   rL   rB   r?  r   r   r  r>  )r:   r   rN  r  rM   r9  r  r  s          @r?   test_mutable_basesz,ClassPropertiesAndMethods.test_mutable_bases  s   	 		 		 		 	CCde1%1%a a **,qc2	@ II>?	CAK
 IIAB	H$AK
 IIFG	=a&AK II;<	H$AK IIFGC >* 		  	E3xLL		CD	E  		  		  		s`   0E, F F6 7	G G ,E>=E>	F3
F..F36	GG	GG	G G c                    t         j                  j                         D cg c]  }t        |t              r| }}|D ]T  }t
        j                  |d       |t
        us"|t        u rd}nd}| j                  t        |j                        ||       V  G d dt              } G d dt
              } G d d	|      }	 t        f|_
        | j                  d
       	 t        ft        _
        | j                  d       	 |t        f|_
        | j                  d       y c c}w # t        $ r Y Rw xY w# t        $ r Y ?w xY w# t        $ r Y y w xY w)NrJ   rg   rf   c                       e Zd Zy)7ClassPropertiesAndMethods.test_builtin_bases.<locals>.LNrM  r   r@   r?   r  rH    rO  r@   r  c                       e Zd Zy)7ClassPropertiesAndMethods.test_builtin_bases.<locals>.CNrM  r   r@   r?   r   rJ    rO  r@   r   c                       e Zd Zy)7ClassPropertiesAndMethods.test_builtin_bases.<locals>.DNrM  r   r@   r?   rN  rL    rO  r@   rN  z/shouldn't turn list subclass into dict subclassz-shouldn't be able to assign to list.__bases__z#best_base calculation found wanting)builtinsrI   valuesr)  rG   r`  r&  ExceptionGrouprE   r	  rJ   r6   r   r   r   )r:   tpbuiltin_types	num_basesr  r   rN  s          r?   test_builtin_basesz,ClassPropertiesAndMethods.test_builtin_bases  sN    '/&7&7&>&>&@ 2&r40  2 2 	CB##B4' !I !I  R\\!2IrB	C	 		 		 		I'AK IIGH	G"WDN IIEF	=d)AK II;<O2,  		  		  		s;   D?D# D2 ?E #	D/.D/2	D>=D>	EEc           	      6   | j                  t              5   G d dt        d             }d d d        | j                  t              5   G d dt        t        d             }d d d        | j                  t              5   G d dt        d       t              }d d d         G d dt              }| j                  t              5   G d d|t        d             }d d d        | j                  t              5   G d dt        d       |      }d d d         G d	 dt              }| j                  t              5  t        d       f|_        d d d        | j                  t              5  t        t        d       f|_        d d d        | j                  t              5  t        d       t        f|_        d d d        | j                  t              5  |t        d       f|_        d d d        | j                  t              5  t        d       |f|_        d d d        y # 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   kxY w# 1 sw Y   ExY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   y xY w)
Nc                       e Zd Zy>ClassPropertiesAndMethods.test_unsubclassable_types.<locals>.XNrM  r   r@   r?   r  rW    r  r@   r  c                       e Zd ZyrV  rM  r   r@   r?   r  z>ClassPropertiesAndMethods.test_unsubclassable_types.<locals>.X  r  r@   c                       e Zd ZyrV  rM  r   r@   r?   r  z>ClassPropertiesAndMethods.test_unsubclassable_types.<locals>.X  r  r@   c                       e Zd Zy)>ClassPropertiesAndMethods.test_unsubclassable_types.<locals>.ONrM  r   r@   r?   r)  r[    rO  r@   r)  c                       e Zd ZyrV  rM  r   r@   r?   r  z>ClassPropertiesAndMethods.test_unsubclassable_types.<locals>.X  r  r@   c                       e Zd ZyrV  rM  r   r@   r?   r  z>ClassPropertiesAndMethods.test_unsubclassable_types.<locals>.X  r  r@   c                       e Zd ZyrV  rM  r   r@   r?   r  z>ClassPropertiesAndMethods.test_unsubclassable_types.<locals>.X  rO  r@   )r  r   rG   r`  rJ   )r:   r  r)  s      r?   test_unsubclassable_typesz3ClassPropertiesAndMethods.test_unsubclassable_types  s&   y) 	DJ 	 y) 	FDJ 	 y) 	DJ 		 	y) 	AtDz 	 y) 	DJ 		 	y) 	&t*+AK	&y) 	- $t*,AK	-y) 	-t*f,AK	-y) 	(T$Z-AK	(y) 	(t*a-AK	( 	(9	 		 		 	
	 		 		& 	&	- 	-	- 	-	( 	(	( 	(sw   HH*?H7I8I:I)I+I7JJH'*H47IIII(+I47J JJc                   
  G 
fddt               
 G d dt               } G d dt              } G d dt              } G d	 d
|      } G d d|      } G d d|
      } G d d||      }|j                  }|j                  }		 |f|_        | j	                  d       y # t
        $ r; | j                  |j                  |       | j                  |j                  |	       Y y w xY w)Nc                   (     e Zd Z fdZd Z xZS )OClassPropertiesAndMethods.test_mutable_bases_with_failing_mro.<locals>.WorkOncec                 6    d| _         t        |   |||      S r   )flagru  r   )r:   r=   rU  r  WorkOncer  s       r?   r   zWClassPropertiesAndMethods.test_mutable_bases_with_failing_mro.<locals>.WorkOnce.__new__&  s"    	Xt4XtUBOOr@   c                     | j                   dkD  rt        d      | xj                   dz  c_         t        j                  |       S )Nr   bozorf   )rd  r  rG   r  r   s    r?   r  zSClassPropertiesAndMethods.test_mutable_bases_with_failing_mro.<locals>.WorkOnce.mro)  s3    99q=&v..IINI88D>)r@   )r   r   r   r   r  rx  )r  re  s   @r?   re  rb  %  s    P*r@   re  c                       e Zd Zd Zy)QClassPropertiesAndMethods.test_mutable_bases_with_failing_mro.<locals>.WorkAlwaysc                 ,    t         j                  |       S r   )rG   r  r   s    r?   r  zUClassPropertiesAndMethods.test_mutable_bases_with_failing_mro.<locals>.WorkAlways.mro1  s    
 xx~%r@   Nr  r   r@   r?   
WorkAlwaysri  0  s    &r@   rk  c                       e Zd Zy)HClassPropertiesAndMethods.test_mutable_bases_with_failing_mro.<locals>.CNrM  r   r@   r?   r   rm  8  rO  r@   r   c                       e Zd Zy)IClassPropertiesAndMethods.test_mutable_bases_with_failing_mro.<locals>.C2NrM  r   r@   r?   r  ro  ;  rO  r@   r  c                       e Zd Zy)HClassPropertiesAndMethods.test_mutable_bases_with_failing_mro.<locals>.DNrM  r   r@   r?   rN  rq  >  rO  r@   rN  c                       e Zd Zy)HClassPropertiesAndMethods.test_mutable_bases_with_failing_mro.<locals>.ENrM  r   r@   r?   r  rs  A  rO  r@   r  c                       e Zd Zy)HClassPropertiesAndMethods.test_mutable_bases_with_failing_mro.<locals>.FNrM  r   r@   r?   r  ru  D  rO  r@   r  rB  c                       e Zd Zy)HClassPropertiesAndMethods.test_mutable_bases_with_failing_mro.<locals>.GNrM  r   r@   r?   rv  rw  G  rO  r@   rv  zexception not propagated)rG   r`  r^  rJ   r   r  rE   )r:   rk  r   r  rN  r  r  rv  E_mro_beforeD_mro_beforere  s             @r?   #test_mutable_bases_with_failing_mroz=ClassPropertiesAndMethods.test_mutable_bases_with_failing_mro#  s    		*t 		*	& 	&	 		 		 		 		X 		Z 	 yyyy	2%AK
 II01	  	6QYY5QYY5	6s   	B# #AC'&C'c                      G d dt               } G d dt               } G d d||      } G d d||      } G d	 d
||      }	 ||f|_        | j                  d       y # t        $ r Y y w xY w)Nc                       e Zd Zy)JClassPropertiesAndMethods.test_mutable_bases_catch_mro_conflict.<locals>.ANrM  r   r@   r?   r}  r}  [  rO  r@   r}  c                       e Zd Zy)JClassPropertiesAndMethods.test_mutable_bases_catch_mro_conflict.<locals>.BNrM  r   r@   r?   r  r  ^  rO  r@   r  c                       e Zd Zy)JClassPropertiesAndMethods.test_mutable_bases_catch_mro_conflict.<locals>.CNrM  r   r@   r?   r   r  a  rO  r@   r   c                       e Zd Zy)JClassPropertiesAndMethods.test_mutable_bases_catch_mro_conflict.<locals>.DNrM  r   r@   r?   rN  r  d  rO  r@   rN  c                       e Zd Zy)JClassPropertiesAndMethods.test_mutable_bases_catch_mro_conflict.<locals>.ENrM  r   r@   r?   r  r  g  rO  r@   r  zdidn't catch MRO conflict)r`  rJ   r   r   )r:   r}  r  r   rN  r  s         r?   %test_mutable_bases_catch_mro_conflictz?ClassPropertiesAndMethods.test_mutable_bases_catch_mro_conflictY  sw    	 		 		1 		1 		1 		3a&AK II12  		s   	A 	A+*A+c                      G d dt               }|j                  }d|_        | j                  |j                  |j                  f|df       d|_        | j                  |j                  |j                  f|df       y )Nc                       e Zd Zy)7ClassPropertiesAndMethods.test_mutable_names.<locals>.CNrM  r   r@   r?   r   r  s  rO  r@   r   rN  zD.E)r`  r   r   rE   )r:   r   r   s      r?   test_mutable_namesz,ClassPropertiesAndMethods.test_mutable_namesq  si    	 	 ll
!,,

3c3Z@
!,,

3c5\Br@   c                 d     G fddt               } G d d       |d      _        d_        y )Nc                       e Zd Z fdZy)<ClassPropertiesAndMethods.test_evil_type_name.<locals>.Nastyc                     d_         y )Nr   )r   r   s    r?   r3  zDClassPropertiesAndMethods.test_evil_type_name.<locals>.Nasty.__del__  s
    $
r@   Nr-  rL  s   r?   Nastyr    s    %r@   r  c                       e Zd Zy)8ClassPropertiesAndMethods.test_evil_type_name.<locals>.CNrM  r   r@   r?   r   r    rO  r@   r   r$  normal)r>  r   )r:   r  r   s     @r?   test_evil_type_namez-ClassPropertiesAndMethods.test_evil_type_name  s-    	%C 	%	 	 5\

r@   c                     G d dt               }| j                   |d      dz  d       | j                  d |d      z  d        G d dt              }| j                   |       dz  d       | j                  d |       z  d	        G d
 d|      }| j                   |        |       z  d       | j                   |        |       z  d        G d d|      }| j                  |j                  |j                         | j                   |       dz  d       | j                  d |       z  d	       | j                   |        |       z  d       | j                   |        |       z  d       y )Nc                       e Zd Zd Zd Zy);ClassPropertiesAndMethods.test_subclass_right_op.<locals>.Bc                      y)NB.__floordiv__r   r   s     r?   __floordiv__zHClassPropertiesAndMethods.test_subclass_right_op.<locals>.B.__floordiv__      'r@   c                      y)NB.__rfloordiv__r   r   s     r?   __rfloordiv__zIClassPropertiesAndMethods.test_subclass_right_op.<locals>.B.__rfloordiv__      (r@   Nr   r   r   r  r  r   r@   r?   r  r        ()r@   r  rf   r  r  c                       e Zd Zd Zd Zy);ClassPropertiesAndMethods.test_subclass_right_op.<locals>.Cc                      y)NC.__floordiv__r   r   s     r?   r  zHClassPropertiesAndMethods.test_subclass_right_op.<locals>.C.__floordiv__  r  r@   c                      y)NC.__rfloordiv__r   r   s     r?   r  zIClassPropertiesAndMethods.test_subclass_right_op.<locals>.C.__rfloordiv__  r  r@   Nr  r   r@   r?   r   r    r  r@   r   r  r  c                       e Zd Zd Zd Zy);ClassPropertiesAndMethods.test_subclass_right_op.<locals>.Dc                      y)ND.__floordiv__r   r   s     r?   r  zHClassPropertiesAndMethods.test_subclass_right_op.<locals>.D.__floordiv__  r  r@   c                      y)ND.__rfloordiv__r   r   s     r?   r  zIClassPropertiesAndMethods.test_subclass_right_op.<locals>.D.__rfloordiv__  r  r@   Nr  r   r@   r?   rN  r    r  r@   rN  r  r  c                       e Zd Zy);ClassPropertiesAndMethods.test_subclass_right_op.<locals>.ENrM  r   r@   r?   r  r    rO  r@   r  )r-   rE   r`  r  )r:   r  r   rN  r  s        r?   test_subclass_right_opz0ClassPropertiesAndMethods.test_subclass_right_op  sD   	) 	) 	1$45ad$56	) 	) 	#34ac#45	) 	) 	%56%67	 	 	!//:#34ac#45%56%56r@   z)testing an internal kind of method objectc                    g d}d d d d}| j                  t        j                  |      |       | j                  i j                  |      |       t        j                  d   }| j                   |j	                  d t              |      |       | j                   |j	                  i       |      |       	 |j	                  d d        | j                  d       	 |j	                  d       | j                  d       	 |j	                  d d       | j                  d       	 |j	                  d t               | j                  d       y # t        $ r Y {w xY w# t        $ r Y gw xY w# t        $ r Y Rw xY w# t        $ r Y y w xY w)Nrj   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))rE   r   r  rI   re  r   r   r-   )r:   r  rK   r  s       r?   test_meth_class_getz-ClassPropertiesAndMethods.test_meth_class_get  st    4D)s+S1S)3/ j) 	2tT237=*r*3/5	JMM$% IIHI	BMM" II@A	HMM$# IIFG	IMM$$ IIGH+  		  		  		  		sH   8E E ?E) #E8 	EE	E&%E&)	E54E58	FFc                     G d dt               } G d d      } |       } ||      }| j                  ||       | j                  ||        G d d|      } |       } ||      }| j                  ||       | j                  ||        G d dt               } |       } ||      }| j                  ||       | j                  ||        G d d|      } |       } ||      }| j                  ||       | j                  ||       y )	Nc                       e Zd Zd Zd Zy)<ClassPropertiesAndMethods.test_isinst_isclass.<locals>.Proxyc                     || _         y r   _Proxy__objr+  s     r?   r4   zEClassPropertiesAndMethods.test_isinst_isclass.<locals>.Proxy.__init__  r  r@   c                 |    |j                  d      rt        j                  | |      S t        | j                  |      S N_Proxy__rc  r`  r&  rH   r  r  s     r?   r&  zMClassPropertiesAndMethods.test_isinst_isclass.<locals>.Proxy.__getattribute__  2    ??:.!224>>"4::t44r@   Nr   r   r   r4   r&  r   r@   r?   rY  r        !5r@   rY  c                       e Zd Zy8ClassPropertiesAndMethods.test_isinst_isclass.<locals>.CNrM  r   r@   r?   r   r    rO  r@   r   c                       e Zd Zy8ClassPropertiesAndMethods.test_isinst_isclass.<locals>.DNrM  r   r@   r?   rN  r    rO  r@   rN  c                       e Zd Zyr  rM  r   r@   r?   r   z8ClassPropertiesAndMethods.test_isinst_isclass.<locals>.C  rO  r@   c                       e Zd Zyr  rM  r   r@   r?   rN  z8ClassPropertiesAndMethods.test_isinst_isclass.<locals>.D  rO  r@   )r`  r  )r:   rY  r   rB   parN  s         r?   test_isinst_isclassz-ClassPropertiesAndMethods.test_isinst_isclass  s    	5F 	5	 	C1Xa#b!$	 	C1Xa#b!$	 	C1Xa#b!$	 	C1Xa#b!$r@   c                      G d dt               } G d dt               } G fdd|              } ||      }| j                   j                  d   |      d       y )	Nc                       e Zd Zd Zd Zy)9ClassPropertiesAndMethods.test_proxy_super.<locals>.Proxyc                     || _         y r   r  r+  s     r?   r4   zBClassPropertiesAndMethods.test_proxy_super.<locals>.Proxy.__init__  r  r@   c                 |    |j                  d      rt        j                  | |      S t        | j                  |      S r  r  r  s     r?   r&  zJClassPropertiesAndMethods.test_proxy_super.<locals>.Proxy.__getattribute__  r  r@   Nr  r   r@   r?   rY  r    r  r@   rY  c                       e Zd Zd Zy)5ClassPropertiesAndMethods.test_proxy_super.<locals>.Bc                      y)NzB.fr   r   s    r?   r  z7ClassPropertiesAndMethods.test_proxy_super.<locals>.B.f  r  r@   Nrw  r   r@   r?   r  r    s    r@   r  c                   "     e Zd Z fdZ xZS )5ClassPropertiesAndMethods.test_proxy_super.<locals>.Cc                 &    t         |          dz   S )Nz->C.f)ru  r  )r:   r   r  s    r?   r  z7ClassPropertiesAndMethods.test_proxy_super.<locals>.C.f#  s    Q')G33r@   )r   r   r   r  rx  )r  r   s   @r?   r   r  "  s    4 4r@   r   r  zB.f->C.f)r`  rE   rI   )r:   rY  r  r   r  r   s        @r?   test_proxy_superz*ClassPropertiesAndMethods.test_proxy_super  sX    	5F 	5	 		4 	4 c#JC+Z8r@   c                     	 t         j                  t        dd       | j                  d       	 t         j                  t        d       | j                  d       y # t        $ r Y 8w xY w# t        $ r Y y w xY w)Nr   r   z"Carlo Verre __setattr__ succeeded!r  z"Carlo Verre __delattr__ succeeded!)r`  r*  r>  r   r   r-  r   s    r?   test_carloverrez)ClassPropertiesAndMethods.test_carloverre*  ss    	<sE2. II:;	<sG, II:;  		  		s"   A A* 	A'&A'*	A65A6c                      G d dt               } G d d      } G d d||      } |dt        fi       }	 d|_        y # t        $ r | j	                  d	       Y y w xY w)
Nc                       e Zd Zd Zy)HClassPropertiesAndMethods.test_carloverre_multi_inherit_valid.<locals>.Ac                 2    t         j                  | ||       y r   )rG   r*  r   r  r  s      r?   r*  zTClassPropertiesAndMethods.test_carloverre_multi_inherit_valid.<locals>.A.__setattr__;  s      c51r@   Nr   r   r   r*  r   r@   r?   r}  r  :  r  r@   r}  c                       e Zd Zy)HClassPropertiesAndMethods.test_carloverre_multi_inherit_valid.<locals>.BNrM  r   r@   r?   r  r  >  rO  r@   r  c                       e Zd Zy)HClassPropertiesAndMethods.test_carloverre_multi_inherit_valid.<locals>.CNrM  r   r@   r?   r   r  A  rO  r@   r   rN  Tz1setattr through direct base types should be legal)rG   r`  r  r   r   r:   r}  r  r   r   s        r?   #test_carloverre_multi_inherit_validz=ClassPropertiesAndMethods.test_carloverre_multi_inherit_valid9  sc    	2 	2	 		1 	 fY#	KCH 	KIIIJ	Ks   > AAc                      G d dt               } G d d      } G d d||      } |dt        fi       }	 d|_        | j                  d	       y # t        $ r Y y w xY w)
Nc                       e Zd Zd Zy)JClassPropertiesAndMethods.test_carloverre_multi_inherit_invalid.<locals>.Ac                 2    t         j                  | ||       y r   )r`  r*  r  s      r?   r*  zVClassPropertiesAndMethods.test_carloverre_multi_inherit_invalid.<locals>.A.__setattr__L  s    ""3U3r@   Nr  r   r@   r?   r}  r  K  s    4r@   r}  c                       e Zd Zy)JClassPropertiesAndMethods.test_carloverre_multi_inherit_invalid.<locals>.BNrM  r   r@   r?   r  r  O  rO  r@   r  c                       e Zd Zy)JClassPropertiesAndMethods.test_carloverre_multi_inherit_invalid.<locals>.CNrM  r   r@   r?   r   r  R  rO  r@   r   rN  Tz6setattr through indirect base types should be rejected)rG   r`  r  r   r   r  s        r?   %test_carloverre_multi_inherit_invalidz?ClassPropertiesAndMethods.test_carloverre_multi_inherit_invalidJ  sh    	4 	4	 		1 	 fY#	PCH IINO  		s   A 	AAc                 n    dd l  G fdd      } G d dt              } |       } ||      |_        ~y )Nr   c                       e Zd Z fdZd Zy)AClassPropertiesAndMethods.test_weakref_segfault.<locals>.Provokerc                 4     j                   |      | _         y r   rn  )r:   	referrentrm  s     r?   r4   zJClassPropertiesAndMethods.test_weakref_segfault.<locals>.Provoker.__init__c  s    &7;;y1r@   c                 $    | j                         }y r   r  r  s     r?   r3  zIClassPropertiesAndMethods.test_weakref_segfault.<locals>.Provoker.__del__f  s    HHJr@   N)r   r   r   r4   r3  )rm  s   r?   Provokerr  b  s    2r@   r  c                       e Zd Zy)=ClassPropertiesAndMethods.test_weakref_segfault.<locals>.OopsNrM  r   r@   r?   Oopsr  i  rO  r@   r  )rm  r`  whatever)r:   r  r  r/  rm  s       @r?   test_weakref_segfaultz/ClassPropertiesAndMethods.test_weakref_segfault]  s5     		 		6 	 Fa[
r@   cpuc                 F    d }t        d      D ]  }|j                  } d }y )Nc                       y r   r   r   r@   r?   r  zAClassPropertiesAndMethods.test_wrapper_segfault.<locals>.<lambda>s  r  r@   i@B )r   rg  )r:   r  r   s      r?   test_wrapper_segfaultz/ClassPropertiesAndMethods.test_wrapper_segfaultp  s*     w 	A

A	r@   c                      G d d      }t         |             5  | j                  t              5  t        d       d d d        d d d        y # 1 sw Y   xY w# 1 sw Y   y xY w)Nc                       e Zd Zd Zy)>ClassPropertiesAndMethods.test_file_fault.<locals>.StdoutGuardc                 P    t         j                  t         _        t        d|       )NzPremature access to sys.stdout.)r   
__stdout__stdoutr  r  s     r?   r  zJClassPropertiesAndMethods.test_file_fault.<locals>.StdoutGuard.__getattr__{  s      ^^
"%DTF#KLLr@   Nr  r   r@   r?   StdoutGuardr 	  z  s    Mr@   r	  zOops!)r   r  r  print)r:   r	  s     r?   test_file_faultz)ClassPropertiesAndMethods.test_file_faultx  s^    	M 	M
 []+ 	""<0 g	 	 	 	s!   AAAA	AA#c                 $    G fddt               } G d dt                G fddt                       }d|j                   |       <   | j                  |j                  d       t	        j
                          | j                  |d	       y )
Nc                       e Zd Zd Z fdZy)HClassPropertiesAndMethods.test_vicious_descriptor_nonsense.<locals>.Evilc                     t        d      S )Nru  rG  r   s    r?   rH  zQClassPropertiesAndMethods.test_vicious_descriptor_nonsense.<locals>.Evil.__hash__  s    F|#r@   c                 *    	 ` y# t        $ r Y yw xY wr   )ru  r  r  s     r?   rA  zOClassPropertiesAndMethods.test_vicious_descriptor_nonsense.<locals>.Evil.__eq__  s)      & s    	Nr   r   r   rH  rA  rL  s   r?   Evilr		    s    $r@   r	  c                       e Zd ZddZy)IClassPropertiesAndMethods.test_vicious_descriptor_nonsense.<locals>.DescrNc                      yr   r   )r:   obrG   s      r?   re  zQClassPropertiesAndMethods.test_vicious_descriptor_nonsense.<locals>.Descr.__get__  r+  r@   r   r   r   r@   r?   Descrr	    s    r@   r	  c                       e Zd Z W         Zy)EClassPropertiesAndMethods.test_vicious_descriptor_nonsense.<locals>.CN)r   r   r   ru  r	  s   r?   r   r	    s
    7Dr@   r   r   rf   ru  )r`  rI   rE   ru  r   rV  r  )r:   r	  rX   r   r	  s      @@r?    test_vicious_descriptor_nonsensez:ClassPropertiesAndMethods.test_vicious_descriptor_nonsense  sp    		6 			F 		 	 C

46#a(r@   c                 r     G d dt               }	  |        | j                  d       y # t        $ r Y y w xY w)Nc                       e Zd Zd Zy)0ClassPropertiesAndMethods.test_init.<locals>.Fooc                      y)Nr  r   r   s    r?   r4   z9ClassPropertiesAndMethods.test_init.<locals>.Foo.__init__  rm  r@   NrK  r   r@   r?   Foor	    ro  r@   r	  z'did not test __init__() for None return)r`  r   r   )r:   r	  s     r?   	test_initz#ClassPropertiesAndMethods.test_init  s<    	& 		AE II?@  		s   * 	66c                 |   | j                  t              5  ||k   d d d        | j                  t              5  ||kD   d d d        | j                  t              5  ||k   d d d        | j                  t              5  ||k\   d d d        y # 1 sw Y   sxY w# 1 sw Y   \xY w# 1 sw Y   ExY w# 1 sw Y   y xY wr   r  r   r:   rB   rT   s      r?   assertNotOrderablez,ClassPropertiesAndMethods.assertNotOrderable  s    y) 	E	y) 	E	y) 	F	y) 	F	 		 		 		 		 	s.   BBB&?B2BB#&B/2B;c                    g }| j                  |j                  |j                  k(         | j                  |j                  |j                  k7         | j                  |j                  g j                  k(         | j                  |j                  g j                  k7         | j                  |j                  |j                  k(         | j                  |j                  |j                  k7         | j	                  |j                  |j                         | j                  |j                  j                  d       | j                  |j                  j                  |       | j                  |j                  j                  t               | j                  |j                  j                  t        j                  j                         t        |j                         y )Nri   )r   ri   r  rz   r!	  rE   r   r  r  __objclass__r6   r  rG  r:   r   s     r?   test_method_wrapperz-ClassPropertiesAndMethods.test_method_wrapper  s6    		QYY./aii/0bjj01		RZZ/0aii/0		QYY./		1995++Y7aii((!,aii,,d3**DLL,@,@AQYYr@   c                 r   g }| j                  |j                  |j                  k(         | j                  |j                  |j                  k7         | j                  |j                  g j                  k(         | j                  |j                  g j                  k7         | j                  |j                  |j                  k(         | j                  |j                  |j                  k7         | j	                  |j                  |j                         | j                  |j                  j                  d       | j                  |j                  j                  |       | j                  |j                  j                  t        j                  j                         t        |j                         y )Nr   )r   r   r  popr!	  rE   r   r  r  r  r6   rG  r$	  s     r?   test_builtin_function_or_methodz9ClassPropertiesAndMethods.test_builtin_function_or_method  s    AHH,-QXX-.RYY./BII-.QUU*+AEE)*!((3**H5ahh''+))4;;+>+>?QXXr@   c                    | j                  t        j                  t        j                  k(         | j                  t        j                  t        j                  k7         | j                  t        j                  t        j                  k(         | j                  t        j                  t        j                  k7         | j                  t        j                  t        j                         | j                  t        j                  j                  d       | j                  t        j                  j                  t               | j                  t        j                  t        j                  k(         | j                  t        j                  t        j                  k7         | j                  t        j                  t        j                  k(         | j                  t        j                  t        j                  k7         | j                  t        j                  t        j                         | j                  t        j                  j                  d       | j                  t        j                  j                  t               y )Nri   r   )r   r6   ri   r  rz   r!	  rE   r   r  r#	  r   r'	  r   s    r?   !test_special_unbound_method_typesz;ClassPropertiesAndMethods.test_special_unbound_method_types  sh   45565645dll;..	:dll//6 	t{{233401txx/0T[[9--x8dkk..5r@   c                 \    d } fd}t         j                  dz   }t         j                  }dD ]  \  }}}t        dd||i      } |       }	 |||	|	        |||	|        |||	|       d|dd  z   }
t        d	d|
|i      } |       } ||||        |||	|        ||||	        ||||        ||||        ||||        ||||       |s |||	|	        |||	|        |||	|       d
|dd  z   }t        dd||i      } |       } ||||	        ||||        ||||        y )Nc                     t         S r   r   r   s     r?   specialmethodzEClassPropertiesAndMethods.test_not_implemented.<locals>.specialmethod  s    !!r@   c                     j                  | ||      5  j                  t              5  t        | ||d       d d d        d d d        y # 1 sw Y   xY w# 1 sw Y   y xY w)N)r>   r  r  )r  r  )subTestr  r   r]   )r>   r  r  r:   s      r?   r  z=ClassPropertiesAndMethods.test_not_implemented.<locals>.check  s^    $!q1-!!),- T+,	- - - - - -s!   AAAA	AA"rf   ))ri   zx + yzx += y)__sub__zx - yzx -= y)rz   zx * yzx *= y)
__matmul__zx @ yzx @= y)__truediv__zx / yzx /= y)r  zx // yzx //= y)__mod__zx % yzx %= y)
__divmod__zdivmod(x, y)N)r_  zx ** yzx **= y)
__lshift__zx << yzx <<= y)
__rshift__zx >> yzx >>= y)__and__zx & yzx &= y)__or__zx | yzx |= y)__xor__zx ^ yzx ^= yr}  r   __rrg   r  __ir   )r   r   rG   )r:   r-	  r  N1N2r=   r>   iexprr}  rB   rnamer  rT   inamer   rX   s   `               r?   test_not_implementedz.ClassPropertiesAndMethods.test_not_implemented  sr   	"	- [[1_[["G )	$D$  S"t]34AA$1$2$2DH$ES"um45AA$1$1$1$2$2$A$AeQ"eQ#eQ#QR(b5-"89CeQ"eQ#eQ#S)	$r@   c                 r     G d dt               } |       }d|dd | j                  |j                  d       y )Nc                       e Zd Zd Zy)6ClassPropertiesAndMethods.test_assign_slice.<locals>.Cc                     || _         y r   r  )r:   idxr  s      r?   r~   zBClassPropertiesAndMethods.test_assign_slice.<locals>.C.__setitem__5  r  r@   N)r   r   r   r~   r   r@   r?   r   rD	  4  r  r@   r   rk   rf   rg   )r`  rE   r  )r:   r   rX   s      r?   test_assign_slicez+ClassPropertiesAndMethods.test_assign_slice/  s6    
	# 	# C!A!$r@   c                 x    G d dt               } |d       G fddt               } |       }| j                  |j                         d|_        | j                  |j                  d        G d dt              } G d	 d|
      }d|_         |d      |_        | j                  |j                  d       y )Nc                       e Zd Zd Zd Zy)<ClassPropertiesAndMethods.test_set_and_no_get.<locals>.Descrc                     || _         y r   )r=   r  s     r?   r4   zEClassPropertiesAndMethods.test_set_and_no_get.<locals>.Descr.__init__A  r  r@   c                 6    ||j                   | j                  <   y r   )rI   r=   r)  s      r?   r  zDClassPropertiesAndMethods.test_set_and_no_get.<locals>.Descr.__set__D  s    */TYY'r@   N)r   r   r   r4   r  r   r@   r?   r	  rK	  ?  s    !0r@   r	  rB   c                       e Zd ZW  Zy8ClassPropertiesAndMethods.test_set_and_no_get.<locals>.XNr  r  s   r?   r  rP	  H  s    Ar@   r  r   c                       e Zd Zy);ClassPropertiesAndMethods.test_set_and_no_get.<locals>.MetaNrM  r   r@   r?   rw  rS	  Q  rO  r@   rw  c                       e Zd ZyrO	  rM  r   r@   r?   r  z8ClassPropertiesAndMethods.test_set_and_no_get.<locals>.XS  rO  r@   rB  )r`  r  rB   rE   rG   )r:   r	  r  r  rw  r  s        @r?   test_set_and_no_getz-ClassPropertiesAndMethods.test_set_and_no_get<  s    	0F 	0 c
	 	 Cacc5!b!	4 		$ 	sb!r@   c                 l    G d dt               } |        G fddt               } G fddt               } G fddt               }| j                  t        t         |       d	       | j	                  j
                  d
       | j                  t        t         |       d	       | j	                  j
                  d       | j                  t        t         |       d	       | j	                  j
                  d        G fddt               | j                  t        t                d	       y )Nc                       e Zd ZdZddZy)@ClassPropertiesAndMethods.test_getattr_hooks.<locals>.Descriptorr   Nc                       fd}|S )Nc                 D    xj                   dz  c_         t        |       r   )r  r  )r=   r:   s    r?   r  zXClassPropertiesAndMethods.test_getattr_hooks.<locals>.Descriptor.__get__.<locals>.getter_  s    LLA%L(..r@   r   )r:   r   objtyper  s   `   r?   re  zHClassPropertiesAndMethods.test_getattr_hooks.<locals>.Descriptor.__get__^  s    / r@   r   )r   r   r   r  re  r   r@   r?   
DescriptorrX	  \  s    Gr@   r\	  c                       e Zd ZW  Zy)7ClassPropertiesAndMethods.test_getattr_hooks.<locals>.AN)r   r   r   r&  rQ	  s   r?   r}  r^	  e  s	    $r@   r}  c                       e Zd ZW  Zy)7ClassPropertiesAndMethods.test_getattr_hooks.<locals>.BNr  rQ	  s   r?   r  r`	  g  s    Kr@   r  c                       e Zd ZW  ZW  Zy)7ClassPropertiesAndMethods.test_getattr_hooks.<locals>.CN)r   r   r   r&  r  rQ	  s   r?   r   rb	  i  s    $Kr@   r   ru  rf   rg   rn   c                       e Zd Zd Z fdZy)FClassPropertiesAndMethods.test_getattr_hooks.<locals>.EvilGetattributec                     t        |      r   r  r  s     r?   r  zRClassPropertiesAndMethods.test_getattr_hooks.<locals>.EvilGetattribute.__getattr__v  s    $T**r@   c                 f    ` t        d      D ]  }t        j                           t	        |      Nr   )r  r   rX  collectr  )r:   r=   r   EvilGetattributes      r?   r&  zWClassPropertiesAndMethods.test_getattr_hooks.<locals>.EvilGetattribute.__getattribute__x  s0    $0q !AJJL!$T**r@   Nr  )ri	  s   r?   ri	  rd	  t  s    ++r@   ri	  )r`  r  r  rH   rE   r  )r:   r\	  r}  r  r   ri	  r  s        @@r?   test_getattr_hooksz,ClassPropertiesAndMethods.test_getattr_hooksY  s    	 	 	% 	%	  	 	  	  	.'13?*.'13?*.'13?*	+v 	+ 	.'3C3EvNr@   c                 `    | j                  t        t        j                  t        t               y r   )r  r   rG   r&  r6   r   s    r?   test_type___getattribute__z4ClassPropertiesAndMethods.test_type___getattribute__  s    )T%:%:D$Gr@   c                    | j                  t        t        t        d        G d dt              }| j                  t        t        |d        G d dt              }| j                  t              5  |`d d d        y # 1 sw Y   y xY w)N__abstractmethods__c                       e Zd Zy)<ClassPropertiesAndMethods.test_abstractmethods.<locals>.metaNrM  r   r@   r?   metarp	    rO  r@   rq	  c                       e Zd Zy)9ClassPropertiesAndMethods.test_abstractmethods.<locals>.XNrM  r   r@   r?   r  rs	    rO  r@   r  )r  r  rH   rG   r`  rn	  )r:   rq	  r  s      r?   test_abstractmethodsz.ClassPropertiesAndMethods.test_abstractmethods  sm    .'49NO	4 	.'49NO	 	~. 	&%	& 	& 	&s   0A<<Bc                 P    G d d      } |       }| j                  |t               | j                  t              5  t        j	                  |       d d d        | j                  t              5  t        j                  |d       d d d        y # 1 sw Y   >xY w# 1 sw Y   y xY w)Nc                       e Zd ZeZy):ClassPropertiesAndMethods.test_proxy_call.<locals>.FakeStrN)r   r   r   r>  r  r   r@   r?   FakeStrrw	    rN  r@   rx	  r$  )r  r>  r  r   r  ri   )r:   rx	  fake_strs      r?   test_proxy_callz)ClassPropertiesAndMethods.test_proxy_call  s    	 	 9h, y) 	 IIh	  y) 	)KK%(	) 	)		  	 	) 	)s   B0BBB%c                 F    G d d      } |       }t        d      D ]5  }| j                  t              5  t        j	                  |       d d d        7 t        d      D ]5  }| j                  t              5  t
        j                  |       d d d        7 t        d      D ]5  }| j                  t              5  t
        j                  |       d d d        7 t        d      D ]5  }| j                  t              5  t
        j                  |       d d d        7 ddl	m
} t        d      D ]2  }| j                  t              5  |j                  ||       d d d        4 y # 1 sw Y   RxY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   qxY w)Nc                       e Zd Zy)RClassPropertiesAndMethods.test_specialized_method_calls_check_types.<locals>.ThingNrM  r   r@   r?   Thingr}	    rO  r@   r~	  r  r   )deque)r   r  r   r6   sortr>  r  r  r  collectionsr	  r   )r:   r~	  r  r   r	  s        r?   )test_specialized_method_calls_check_typeszCClassPropertiesAndMethods.test_specialized_method_calls_check_types  s   	 	r 	!A""9- !		% ! !	! r 	!A""9- !		% ! !	! r 	!A""9- !		% ! !	! r 	!A""9- !		% ! !	! 	&r 	+A""9- +UE*+ +	+!! !! !! !! !
+ +s;   E%8E2;E?>FF%E/	2E<	?F	F	F 	c                      G d d      }|j                   |_         |       }| j                  t        t        |       | j                  t        t
        |       y )Nc                       e Zd Zy)7ClassPropertiesAndMethods.test_repr_as_str.<locals>.FooNrM  r   r@   r?   r	  r	    rO  r@   r	  )r   r   r  r  r>  r   )r:   r	  r   s      r?   test_repr_as_strz*ClassPropertiesAndMethods.test_repr_as_str  sB    	 	{{e.#s3.$4r@   c                      G d dt               } |       }d|_        | j                  |d   d       | j                  ||        y )Nc                   <    e Zd Zej                  Zej                  Zy)>ClassPropertiesAndMethods.test_mixing_slot_wrappers.<locals>.XN)r   r   r   r   r~   r*  r   __neg__r   r@   r?   r  r	    s    **KiiGr@   r  r   r  )r   r  rE   )r:   r  r  s      r?   test_mixing_slot_wrappersz3ClassPropertiesAndMethods.test_mixing_slot_wrappers  sD    	  	  C3$QBr@   c                      G d dt               } |       }| j                  t              5  ||k(   d d d        | j                  t              5  ||z    d d d        y # 1 sw Y   -xY w# 1 sw Y   y xY w)Nc                   <    e Zd Zej                  Zej
                  Zy)BClassPropertiesAndMethods.test_wrong_class_slot_wrapper.<locals>.AN)r   r   r   r>  rA  ri   r   r@   r?   r}  r	    s    ZZFkkGr@   r}  )r-   r  r   )r:   r}  rB   s      r?   test_wrong_class_slot_wrapperz7ClassPropertiesAndMethods.test_wrong_class_slot_wrapper  sp    	" 	" Cy) 	F	y) 	E	 		 		 	s   AA*A'*A3c                     | j                  t              5 } G d d      }d d d        t        j                        }| j	                  d|       y # 1 sw Y   1xY w)Nc                       e Zd ZdgZdZy)EClassPropertiesAndMethods.test_slot_shadows_class_variable.<locals>.Xr   N)r   r   r   r   r   r   r@   r?   r  r	    s    "G	r@   r  z0'foo' in __slots__ conflicts with class variable)r  r  r>  r  rE   )r:   r  r  rO   s       r?    test_slot_shadows_class_variablez:ClassPropertiesAndMethods.test_slot_shadows_class_variable  sR    z* 	b 	 KQO	 	s   AAc                     G d d      }d|_         | j                  |j                   d       | j                  t              5 }t	        t
              j                  d   j                  t
        d       d d d        | j                  dt        j                               | j                  t              5 }t	        |      j                  d   j                  |       d d d        | j                  dt        |j                               | j                  |j                   d       y # 1 sw Y   xY w# 1 sw Y   WxY w)Nc                       e Zd ZdZy)1ClassPropertiesAndMethods.test_set_doc.<locals>.XelephantNr  r   r@   r?   r  r	    s    r@   r  bananar  blahz7cannot set '__doc__' attribute of immutable type 'list'z7cannot delete '__doc__' attribute of immutable type 'X')r  rE   r  r   rG   r6   rI   r  r  r>  r  r,  )r:   r  r  s      r?   test_set_docz&ClassPropertiesAndMethods.test_set_doc  s    	 		H-y) 	ARJ	*224@	AOQTUWUaUaQbcy) 	6RGY'2215	6OQTUWUaUaQbcH-	A 	A	6 	6s   1D(6(D4(D14D=c                 d   t         j                  t        j                  t        j                  t
        j                  g}g d}t        ||      D ]-  \  }}| j                  t        |      j                  |dz          / |D ]D  }|j                  j                  dz   |j                  z   }| j                  |j                  |       F | j                  t         j                  j                  d       | j                  t        j                  j                  d       | j                  t        j                  j                  d       | j                  t
        j                  j                  d        G d d	      }| j                  t              5  |`d d d        | j                  t        t        j                  d
   j                   t         d        G d d      a| j                  t"        j                  d       | j                  t"        j$                  j                  d       y # 1 sw Y   xY w)N)r  membergetsetwrapper_descriptor.z	str.lowerzcomplex.realz
float.realzint.__add__c                       e Zd Zy)2ClassPropertiesAndMethods.test_qualname.<locals>.XNrM  r   r@   r?   r  r	     rO  r@   r  r   Oinkc                        e Zd Z G d d      Zy)r  c                       e Zd Zy)Y.InsideNrM  r   r@   r?   Insider	  
  r  r@   r	  N)r   r   r   r	  r   r@   r?   r  r  	  s     r@   r  r	  )r>  r  r   r   r.   r-   ri   r  rE   rG   r   r#	  r   r  r   rI   r  r  r	  )r:   descriptorsr<  rM   r  qualnamer  s          r?   test_qualnamez'ClassPropertiesAndMethods.test_qualname  s   yy',,

CKKH9 U+ 	BDAqT!W--q=/@A	B  	7A~~22S81::EHQ^^X6	7 	//=22NC00,?11=A	 	y) 		 	)T]]>%B%J%Jv	'	 	 	-..
;	 	s   H&&H/c                     ddi}t        dd|      }| j                  |j                  d       | j                  d|j                         | j                  |ddi       ddi}| j                  t        t         dd|       y )Nr   z	some.namer	  r   rf   )rG   rE   r   r]  rI   r  r   )r:   r  rP  s      r?   test_qualname_dictz,ClassPropertiesAndMethods.test_qualname_dict  sw    k*%R +65nk:;a )T5"b9r@   c                 &    G d dt               } |       }d|_        t        j                  |      }~t	        j
                          | j                   |              t        j                         D ]  }| j                  t        |      |        y )Nc                       e Zd Zd Zy)<ClassPropertiesAndMethods.test_cycle_through_dict.<locals>.Xc                 <    t         j                  |        | | _        y r   )r   r4   rI   r   s    r?   r4   zEClassPropertiesAndMethods.test_cycle_through_dict.<locals>.X.__init__  s    d# $r@   NrK  r   r@   r?   r  r	    s    %r@   r  r   )r   ru  rm  rn  r   rV  assertIsNonerX  r=  assertIsNotrG   )r:   r  r  wrr/  s        r?   test_cycle_through_dictz1ClassPropertiesAndMethods.test_cycle_through_dict  st    	% 	% C[[^"$! 	)AT!Wa(	)r@   c                 T    G d d      }| j                  t        |d       | j                  t        |d        G d d      } G d d      } G d	 d
||      }|||fD ]G  } |d        |dd       | j                  t        |ddd       | j                  t        |ddd       I y )Nc                       e Zd Zy)[ClassPropertiesAndMethods.test_object_new_and_init_with_parameters.<locals>.OverrideNeitherNrM  r   r@   r?   OverrideNeitherr	  *  rO  r@   r	  rf   r  c                       e Zd ZddZy)WClassPropertiesAndMethods.test_object_new_and_init_with_parameters.<locals>.OverrideNewc                 4    t        j                  | g|i |S r   rZ  )r   r   r  r;   r   s        r?   r   z_ClassPropertiesAndMethods.test_object_new_and_init_with_parameters.<locals>.OverrideNew.__new__/  s    ~~c9D9D99r@   Nr  rV  r   r@   r?   OverrideNewr	  .  s    :r@   r	  c                       e Zd ZddZy)XClassPropertiesAndMethods.test_object_new_and_init_with_parameters.<locals>.OverrideInitc                 4    t        j                  | g|i |S r   )r`  r4   )r:   r   r  r;   r<   s        r?   r4   zaClassPropertiesAndMethods.test_object_new_and_init_with_parameters.<locals>.OverrideInit.__init__2  s    t=d=f==r@   Nr  rK  r   r@   r?   OverrideInitr	  1  s    >r@   r	  c                       e Zd Zy)XClassPropertiesAndMethods.test_object_new_and_init_with_parameters.<locals>.OverrideBothNrM  r   r@   r?   OverrideBothr	  4  rO  r@   r	  rg   rk   rE  r	  )r:   r	  r	  r	  r	  cases         r?   (test_object_new_and_init_with_parameterszBClassPropertiesAndMethods.test_object_new_and_init_with_parameters(  s    	 	)_a8)_;	: 	:	> 	>	; 	|; 	<DGqMiq!Q7iq!;		<r@   c                      G d d      } G d d|      }| j                  d|j                         | j                  d|j                         y )Nc                       e Zd Zy)\ClassPropertiesAndMethods.test_subclassing_does_not_duplicate_dict_descriptors.<locals>.BaseNrM  r   r@   r?   rA  r	  =  rO  r@   rA  c                       e Zd Zy)[ClassPropertiesAndMethods.test_subclassing_does_not_duplicate_dict_descriptors.<locals>.SubNrM  r   r@   r?   rF  r	  ?  rO  r@   rF  rI   )r  rI   r]  )r:   rA  rF  s      r?   4test_subclassing_does_not_duplicate_dict_descriptorszNClassPropertiesAndMethods.test_subclassing_does_not_duplicate_dict_descriptors<  s>    	 		$ 	j$--0S\\2r@   c                     G d d      }| j                  t         |       j                        d        G d d      } G d d|      } G d d	|      } |       } |       } |       }t        ||      }| j                  t        |j                        d
       | j                  t        |j                        d       | j                  t        |j                        d       | j                  t        |j                        d        G d d      } |       }	| j                  t        |	j                        d       | j                  t        |j                        d        G d d      }
 |
       }t	               }t        j                  ||      }| j                  t        |      d       d|_        | j                  t        |      d       d|_        | j                  t        |      d       y )Nc                       e Zd Zd Zy)=ClassPropertiesAndMethods.test_bound_method_repr.<locals>.Fooc                      y r   r   r   s    r?   r  zDClassPropertiesAndMethods.test_bound_method_repr.<locals>.Foo.methodF  r   r@   Nr   r   r   r  r   r@   r?   r	  r	  E  r"  r@   r	  z4<bound method .*Foo\.method of <.*Foo object at .*>>c                       e Zd Zd Zy)>ClassPropertiesAndMethods.test_bound_method_repr.<locals>.Basec                      y r   r   r   s    r?   r  zEClassPropertiesAndMethods.test_bound_method_repr.<locals>.Base.methodM  r   r@   Nr	  r   r@   r?   rA  r	  L  r"  r@   rA  c                       e Zd Zy)BClassPropertiesAndMethods.test_bound_method_repr.<locals>.Derived1NrM  r   r@   r?   Derived1r	  O  rO  r@   r	  c                       e Zd Zd Zy)BClassPropertiesAndMethods.test_bound_method_repr.<locals>.Derived2c                      y r   r   r   s    r?   r  zIClassPropertiesAndMethods.test_bound_method_repr.<locals>.Derived2.methodR  r   r@   Nr	  r   r@   r?   Derived2r	  Q  r"  r@   r	  z6<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                       e Zd Zed        Zy)r	  c                      y r   r   rG  s    r?   r  zDClassPropertiesAndMethods.test_bound_method_repr.<locals>.Foo.methodb  r  r@   N)r   r   r   r  r  r   r@   r?   r	  z=ClassPropertiesAndMethods.test_bound_method_repr.<locals>.Fooa  s     r@   z/<bound method .*Foo\.method of <class '.*Foo'>>c                       e Zd Zd Zy)DClassPropertiesAndMethods.test_bound_method_repr.<locals>.MyCallablec                      y r   r   r  s     r?   rg  zMClassPropertiesAndMethods.test_bound_method_repr.<locals>.MyCallable.__call__m  r   r@   N)r   r   r   rg  r   r@   r?   
MyCallabler	  l  r"  r@   r	  z*<bound method \? of <object object at .*>>r=   z,<bound method name of <object object at .*>>r	  z0<bound method qualname of <object object at .*>>)	assertRegexr   r  ru  r`  r<  
MethodTyper   r   )r:   r	  rA  r	  r	  r  derived1derived2super_d2r   r	  r  instancer  r  s                 r?   test_bound_method_reprz0ClassPropertiesAndMethods.test_bound_method_reprD  s   	 	 	cell+C	E	 		t 		t 	 v::8,dkk*E	Ghoo.I	Khoo.M	Ohoo.I	K	 	 ecjj)>	@cjj)>	@	 	 |8!!$1f9	;f;	=&f?	Ar@   zneed the _testcapi modulec                 J     G d d       G fdd      }|j                    y )Nc                   $    e Zd Zej                  Zy)6ClassPropertiesAndMethods.test_bpo25750.<locals>.DescrN)r   r   r   r  bad_getre  r   r@   r?   r	  r	    s    ''Gr@   r	  c                   $    e Zd Z W         Zd Zy)2ClassPropertiesAndMethods.test_bpo25750.<locals>.Xc                 ^    d | _         t        d      D cg c]  }d|z  	 c}| _        y c c}w )Ni'  rg   )r  r   r  )r   r   s     r?   r   z:ClassPropertiesAndMethods.test_bpo25750.<locals>.X.__new__  s&     	).u6A1a466s   *N)r   r   r   r  r   r	  s   r?   r  r	    s    GE7r@   r  rQ	  )r:   r  r	  s     @r?   test_bpo25750z'ClassPropertiesAndMethods.test_bpo25750{  s     
	( 	(	7 	7 	
r@   c                     G d d      }| j                  |j                         g         G d d|      }| j                  |j                         |g       ~t        j                          | j                  |j                         g        y )Nc                       e Zd Zy)>ClassPropertiesAndMethods.test_remove_subclass.<locals>.ParentNrM  r   r@   r?   Parentr	    rO  r@   r	  c                       e Zd Zy)=ClassPropertiesAndMethods.test_remove_subclass.<locals>.ChildNrM  r   r@   r?   Childr	    rO  r@   r	  )rE   r?  rX  rh	  )r:   r	  r	  s      r?   test_remove_subclassz.ClassPropertiesAndMethods.test_remove_subclass  sq    
	 	..0"5	F 	..05':


..0"5r@   c                     G d d      }| j                  t        d      5   |       j                   d d d         G d d      }| j                  t        d      5   |       j                   d d d        y # 1 sw Y   DxY w# 1 sw Y   y xY w)Nc                   "    e Zd Zd Zed        Zy)EClassPropertiesAndMethods.test_attr_raise_through_property.<locals>.Ac                     t        d      NFOOr  r  s     r?   r  zQClassPropertiesAndMethods.test_attr_raise_through_property.<locals>.A.__getattr__  s     ''r@   c                 $    | j                  d      S )Nasdf)r  r   s    r?   r   zIClassPropertiesAndMethods.test_attr_raise_through_property.<locals>.A.foo  s    ''//r@   N)r   r   r   r  r  r   r   r@   r?   r}  r	    s    ( 0 0r@   r}  r	  c                   ,    e Zd Zed        Zed        Zy)EClassPropertiesAndMethods.test_attr_raise_through_property.<locals>.Bc                     t        d      r	  r	  r  s     r?   r  zQClassPropertiesAndMethods.test_attr_raise_through_property.<locals>.B.__getattr__  s     ''r@   c                     t        d      )NBAR)NotImplementedErrorr   s    r?   r   zIClassPropertiesAndMethods.test_attr_raise_through_property.<locals>.B.foo  s    )%00r@   N)r   r   r   r  r  r   r   r@   r?   r  r
    s(    ( ( 1 1r@   r  r
  )r[  r  r   r
  )r:   r}  r  s      r?    test_attr_raise_through_propertyz:ClassPropertiesAndMethods.test_attr_raise_through_property  s|    	0 	0 ##J6 	CGG		1 	1 ##$7? 	CGG	 		 		 	s   A6B6A?B)r   r   r   r   r  r#  r4  r  rA  r_  rw  r  r  r  r  r  r  ra  ro  r  r  r  r  r  r   refcount_testr  r   r2   r   r   r  r  r  r  r  r=  rI  expectedFailurerO  ra  rq  r  r  r  r  r  r5  rc  rr  r  r   flagsoptimizer  cpython_onlyr  r  r  r  rH  r  r  r  r  r  r  r  r0  rU  rf  r~  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r#  r2  r7  r9  rE  rS  r_  rz  r  r  r  r  r  r  r  r  r  r  r  requires_resourcer  r	  r	  r	  r!	  r%	  r(	  r*	  rA	  rH	  rU	  rj	  rl	  rt	  rz	  r	  r	  r	  r	  r	  r	  r	  r	  r	  r	  r	  r	  r  r	  r	  r
  rx  r  s   @r?   r   r     sX   @I2/h0Tl
(9T'*R"=J@B*7#;J10;0zWr$2L&-P<"A/F:Ox<'| N N W=>X__Y$&(CD/= E ?/=b'0 N N W=>X__Y$&(CD  E ? O* &D)$ 
( 
( ?D ) ).E>N/4bHP* WDE@ F@,f8P`"D>=F~ X__SYY''1,@B2B2 < <AFM?^Zxn`_0X
+63@><@M@^AXWrWPr5<K(Z.1(1*@$=.,*\
1%0N(4)6*%X2
(,O?HB*=X(@42l30C17f WDE)I F)IV%%N9.<K"P&& Wu% &	)B
A$&6&;$z%":%ONH	&) +65 
P.<@:)<(35An X__Y$&(CD E6"r@   r   c                   P   e Zd Zd Z ej
                   eed      xr  ej                         d      d        Z	 ej
                   eed      xr  ej                         d      d        Z
 ej
                   eed      xr  ej                         d      d        Zd Zd Zy	)
DictProxyTestsc                 0     G d dt               }|| _        y )Nc                       e Zd Zd Zy)DictProxyTests.setUp.<locals>.Cc                      y r   r   r   s    r?   rL   z$DictProxyTests.setUp.<locals>.C.meth  r   r@   Nr  r   r@   r?   r   r
    r"  r@   r   )r`  r   r   s     r?   setUpzDictProxyTests.setUp  s    	 	 r@   gettracez#trace function introduces __local__c                     | j                   j                  j                         }| j                  |t               t	        |      }|j                          | j                  |g d       y )NrI   r  r   rf  rL   )r   rI   r   assertNotIsInstancer6   r	  rE   )r:   rf  r   s      r?   test_iter_keyszDictProxyTests.test_iter_keys  sQ     VV__!!#  T*Bx		  7 	8r@   c                     | j                   j                  j                         }| j                  |t               t	        |      }| j                  t        |      d       y rg	  )r   rI   rN  r
  r6   rE   r	  )r:   rf  rN  s      r?   test_iter_valueszDictProxyTests.test_iter_values  sG     VV__##%  T*bVa(r@   c                     | j                   j                  j                         }| j                  |t               |D cg c]  }|d   	 }}|j                          | j                  |g d       y c c}w )Nr   r
  )r   rI   r7   r
  r6   r	  rE   )r:   rf  itemr   s       r?   test_iter_itemszDictProxyTests.test_iter_items  sd     VV__""$  T*$&'DQ''		  7 	8 (s   A2c                      G d dt               } G d dt              } G d d|      }| j                  t        |j                        t        |j                               y )Nc                       e Zd Zy)7DictProxyTests.test_dict_type_with_metaclass.<locals>.BNrM  r   r@   r?   r  r!
    rO  r@   r  c                       e Zd Zy)7DictProxyTests.test_dict_type_with_metaclass.<locals>.MNrM  r   r@   r?   r  r#
    rO  r@   r  c                       e Zd Zy)7DictProxyTests.test_dict_type_with_metaclass.<locals>.CNrM  r   r@   r?   r   r%
    r  r@   r   rB  )r`  rG   rE   rI   )r:   r  r  r   s       r?   test_dict_type_with_metaclassz,DictProxyTests.test_dict_type_with_metaclass  sJ    	 		 		! 	 	ajj)4

+;<r@   c                 b   t        | j                  j                        }| j                  |j	                  d      |       | j                  |j                  d      |       | j                  j                  j                         D ]'  \  }}| j                  dj                  ||      |       ) y )Nzmappingproxy()z
{!r}: {!r})	r   r   rI   r   rc  endswithr7   r  r  )r:   ro  r   r   s       r?   	test_reprzDictProxyTests.test_repr  s     !_5q9

3+FFOO))+ 	8DAqMM,--a3Q7	8r@   N)r   r   r   r
  r2   r   r   r   r
  r
  r
  r
  r&
  r*
  r   r@   r?   r
  r
    s     X__WS*-@,#,,.=?8?8 X__WS*-@,#,,.=?)?) X__WS*-@,#,,.=?8?8	=8r@   r
  c                       e Zd Zd Zy)AAAPTypesLongInitTestc                      G d dt               }	 t        d |       d       t        j                  t               y #  Y xY w)Nc                       e Zd Zd Zy)>AAAPTypesLongInitTest.test_pytype_long_ready.<locals>.UserLongc                      y r   r   r:   r;   s     r?   r_  zFAAAPTypesLongInitTest.test_pytype_long_ready.<locals>.UserLong.__pow__   r   r@   Nr1  r   r@   r?   UserLongr/
    r"  r@   r2
  r   )r`  r   rG   r  r  )r:   r2
  s     r?   test_pytype_long_readyz,AAAPTypesLongInitTest.test_pytype_long_ready  s8    	v 		8:q! 		s	   = AN)r   r   r   r3
  r   r@   r?   r,
  r,
    s    
r@   r,
  c                       e Zd Zd Zy)	MiscTestsc                     G fddt               } G d dt               } G d dt               t        d|f |       di      | j                  j                  d	       | j                  j                  d
       y )Nc                        e Zd Zd Z fdZy)7MiscTests.test_type_lookup_mro_reference.<locals>.MyKeyc                     t        d      S )Nmykeyr	  r   s    r?   rH  z@MiscTests.test_type_lookup_mro_reference.<locals>.MyKey.__hash__  s    G}$r@   c                     f_         y r   r  )r:   r   Base2r  s     r?   rA  z>MiscTests.test_type_lookup_mro_reference.<locals>.MyKey.__eq__  s    $hr@   Nr	  )r<
  r  s   r?   MyKeyr8
    s    %'r@   r=
  c                       e Zd ZdZdZy)6MiscTests.test_type_lookup_mro_reference.<locals>.Base	from BaseNr   r   r   r:
  mykey2r   r@   r?   rA  r?
    s    E Fr@   rA  c                       e Zd ZdZdZy)7MiscTests.test_type_lookup_mro_reference.<locals>.Base2
from Base2NrA
  r   r@   r?   r<
  rD
    s     E!Fr@   r<
  r  r   r@
  rE
  )r`  rG   rE   r:
  rB
  )r:   r=
  rA  r<
  r  s      @@r?   test_type_lookup_mro_referencez(MiscTests.test_type_lookup_mro_reference  sg    	'F 	'	!6 	!	"F 	" tg|,+.<0r@   N)r   r   r   rF
  r   r@   r?   r5
  r5
    s    1r@   r5
  c                   Z    e Zd Zdi dddfdZd Zd ZddZed        Zd Z	d	 Z
d
 Zd Zy)PicklingTestsr   Nc                 b   |dk\  r|j                  |      }|rE| j                  |d   t        j                         | j                  |d   t	        |      ||f       nE| j                  |d   t        j
                         | j                  |d   t	        |      f|z          | j                  |d   |       || j                  t        |d         |       n| j                  |d          || j                  t        |d         |       y | j                  |d          y t	        |      j                  }	t        j                  t	        |      |	|	t        u rd n |	|      ff}|||fz  }| j                  |j                  |      |       | j                  |j                         |       y )Nrg   r   rf   rk   rn   )__reduce_ex__rE   copyreg__newobj_ex__rG   
__newobj__assertListEqualr6   r	  assertDictEqualr   __base___reconstructorr`  
__reduce__)
r:   protor   r;   r<   r
  	listitems	dictitemsreduce_value	base_types
             r?   _check_reducezPicklingTests._check_reduce)  s   A:,,U3L  a'2G2GH  a49dF2KL  a'2D2DE  a49,2EF\!_e4$$$T,q/%:IF!!,q/2$$$T,q/%:IF!!,q/2S	**I#22!#Y&%.&%8TinNOL  (S..u5|DS^^-|<r@   c                    t        t        j                  dz         }ddddddi G fdd	      } |       }|D ]  }| j                  ||        j	                         D ]  \  }}t        |||        |D ]  }| j                  ||
         G d d      } |       }|D ]7  }|dk\  s	| j                  t              5  |j                  |       d d d        9  G fdd      } |       }|D ]  }|dk\  s	| j                  ||         G fdd      }	 G fdd      }
 G d d      } G d d      }|D ]O  }|	|
||fD ]D  } |       }|dk\  s| j                  t        t        f      5  |j                  |       d d d        F Q  G fdd      } |       }|D ]  }| j                  ||         G d d      } |       }|D ]7  }|dk\  s	| j                  t              5  |j                  |       d d d        9  G fdd      } |       }|D ]  }| j                  ||
         G d d      } |       }|D ]  }| j                  ||d 
         G d! d"      } |       }|D ]e  }| j                  t              5  |j                  |       d d d        |dk  s8| j                  t              5  |j                          d d d        g  G fd#d$      } |       }|D ]{  }|dk\  r| j                  ||d f
       | j                  t              5  |j                  |       d d d        | j                  t              5  |j                          d d d        }  G d% d&t              } |d'd(i      }|D ]  }| j                  ||t        |      )       !  G d* d+t              } |d,g      }|D ]  }| j                  ||t        |      -       ! y # 1 sw Y   UxY w# 1 sw Y   xY w# 1 sw Y   @xY w# 1 sw Y   txY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   OxY w).Nrf   )ir   i7i)baconfishcheeseioc                       e Zd Z fdZy)%PicklingTests.test_reduce.<locals>.C1c                     S r   r   r1
  s    r?   __getnewargs__z4PicklingTests.test_reduce.<locals>.C1.__getnewargs__N  s    r@   Nr   r   r   r`
  r  s   r?   r  r^
  M  s    r@   r  r  c                       e Zd Zd Zy)%PicklingTests.test_reduce.<locals>.C2c                      yNzbad argsr   r   s    r?   r`
  z4PicklingTests.test_reduce.<locals>.C2.__getnewargs__Z      !r@   Nra
  r   r@   r?   r  rc
  Y      "r@   r  rg   c                       e Zd Z fdZy)%PicklingTests.test_reduce.<locals>.C3c                     fS r   r   )r:   r;   r<   s    r?   __getnewargs_ex__z7PicklingTests.test_reduce.<locals>.C3.__getnewargs_ex__c  s    f~%r@   Nr   r   r   rk
  r  s   r?   r  ri
  b  s    &r@   r  c                       e Zd Z fdZy)%PicklingTests.test_reduce.<locals>.C4c                     dfS )Nzbad dictr   r1
  s    r?   rk
  z7PicklingTests.test_reduce.<locals>.C4.__getnewargs_ex__k  s    j))r@   Nrl
  r  s   r?   r  rn
  j  s    *r@   r  c                       e Zd Z fdZy)%PicklingTests.test_reduce.<locals>.C5c                     dfS )Nz	bad tupler   )r:   r<   s    r?   rk
  z7PicklingTests.test_reduce.<locals>.C5.__getnewargs_ex__n  s    #V,,r@   Nrl
  )r<   s   r?   C5rq
  m  s    -r@   rs
  c                       e Zd Zd Zy)%PicklingTests.test_reduce.<locals>.C6c                      y)Nr   r   r   s    r?   rk
  z7PicklingTests.test_reduce.<locals>.C6.__getnewargs_ex__q  rm  r@   Nrl
  r   r@   r?   C6ru
  p  ro  r@   rw
  c                       e Zd Zd Zy)%PicklingTests.test_reduce.<locals>.C7c                      yre
  r   r   s    r?   rk
  z7PicklingTests.test_reduce.<locals>.C7.__getnewargs_ex__t  rf
  r@   Nrl
  r   r@   r?   C7ry
  s  rg
  r@   r{
  c                       e Zd Z fdZy)%PicklingTests.test_reduce.<locals>.C9c                     i fS r   r   r1
  s    r?   rk
  z7PicklingTests.test_reduce.<locals>.C9.__getnewargs_ex__~  s    bz!r@   Nrl
  r  s   r?   C9r}
  }  r"  r@   r
  c                       e Zd Zd Zy)&PicklingTests.test_reduce.<locals>.C10c                     t         r   r;  r   s    r?   rk
  z8PicklingTests.test_reduce.<locals>.C10.__getnewargs_ex__        r@   Nrl
  r   r@   r?   C10r
        !r@   r
  c                       e Zd Z fdZy)&PicklingTests.test_reduce.<locals>.C11c                     S r   r   r  s    r?   r  z3PicklingTests.test_reduce.<locals>.C11.__getstate__  s    r@   Nr   r   r   r  r  s   r?   C11r
    s    r@   r
  c                       e Zd Zd Zy)&PicklingTests.test_reduce.<locals>.C12c                      y)Nnot dictr   r   s    r?   r  z3PicklingTests.test_reduce.<locals>.C12.__getstate__  rf
  r@   Nr
  r   r@   r?   C12r
    rg
  r@   r
  r
  c                       e Zd Zd Zy)&PicklingTests.test_reduce.<locals>.C13c                     t         r   r;  r   s    r?   r  z3PicklingTests.test_reduce.<locals>.C13.__getstate__  r
  r@   Nr
  r   r@   r?   C13r
    r
  r@   r
  c                   *    e Zd Z eW        Z fdZy)&PicklingTests.test_reduce.<locals>.C14c                 P    j                         D ]  \  }}t        | ||        y r   r7   rd  )r:   r=   r  r
  s      r?   r4   z/PicklingTests.test_reduce.<locals>.C14.__init__  s(    #(;;= /KD%D$./r@   N)r   r   r   r  r   r4   r  s   r?   C14r
    s    eI/r@   r
  c                       e Zd Zy)&PicklingTests.test_reduce.<locals>.C15NrM  r   r@   r?   C15r
    rO  r@   r
  quebeci)rU
  c                       e Zd Zy)&PicklingTests.test_reduce.<locals>.C16NrM  r   r@   r?   C16r
    rO  r@   r
  yukon)rT
  )r   pickleHIGHEST_PROTOCOLrX
  r7   rd  r  r   rJ
  r  r<  rR
  r   r6   )r:   	protocolsr  r   rS
  r=   r  r  r  r  rs
  rw
  r{
  r   r
  r
  r
  r
  r
  r
  r
  r
  r;   r<   r
  s                         @@@r?   test_reducezPicklingTests.test_reduceG  s   &11A56	.4 	 	 d 	1Euc40	1 !;;= 	&KD%Cu%	& 	>Euc4u=	>	" 	" d 	-Ez&&y1 -%%e,- -	-
	& 	& d 	=Ez""5#tV<	=	* 	*	- 	-	 		" 	"  	1E2r2~ 1eA:**Iz+BC 1))%01 11	1	" 	" d 	1Euc40	1	! 	! e 	-Ez&&z2 -%%e,- -	-
	 	 e 	8Euc7	8	" 	" e 	=Euc<	=	! 	! e 	%E"":. )!!%()qy&&z2 %NN$% %		%	/ 	/ e 	%Ez""5#dE]"C&&y1 -%%e,-&&y1 %NN$% %	%	$ 	8T"# 	@EucT#Y?	@	$ 	7)n 	@EucT#Y?	@A- -61 1 - -,) )% %- -% %sT   
O7=P9PPP+3P8"Q7P	PP	P(	+P5	8Q	Q	c                     t        t        j                  dz         } G d d      }|D ]$  }|dk\  ri nd }| j                  | |       |       & y )Nrf   c                       e Zd Zd Zd Zy)7PicklingTests.test_special_method_lookup.<locals>.Pickyc                     i S r   r   r   s    r?   r  zDPicklingTests.test_special_method_lookup.<locals>.Picky.__getstate__  s    	r@   c                 "    |dv rt        |      y )N)r`
  rk
  rf  r  s     r?   r  zCPicklingTests.test_special_method_lookup.<locals>.Picky.__getattr__  s    BB(..r@   N)r   r   r   r  r  r   r@   r?   Pickyr
    s    r@   r
  rg   r  )r   r
  r
  rX
  )r:   r
  r
  protocolr
  s        r?   r5  z(PicklingTests.test_special_method_lookup  sV    &11A56		 	 " 	?H"a-BTEx>	?r@   c           	      2   |dj                  ||      }t        |      j                  t        j                  u rt	        d      | j                  |||       | j                  t        |      t        |      |       t        |d      rP| j                  |j                  |j                  |       | j                  |j                  |j                  |       t        |d      r| j                  |j                  |j                  |       |j                  D ]T  }| j                  t        ||      t        ||      |       | j                  t        ||d      t        ||d      |       V | j                  t        |      t        |      |       y)zKUtility method to verify if two objects are copies of each others.
        Nz{!r} is not a copy of {!r}zCobject passed to _assert_is_copy must override the __repr__ method.)r  rI   r   )r  rG   r   r`  r  r	  r  r   rO
  rI   rN
  r   rE   rH   r   )r:   r   objcopyr  slots        r?   _assert_is_copyzPicklingTests._assert_is_copy  so    ;.55c7CC90
  = > >g3/d3igC83
#  w/?/?S IS\\7+;+;E3$  0A0As K H  C&(>C ! I  dD!9!($!=3 ! HH
 	cDMs;r@   c                       G d d        fdt        j                  t        t        j                  dz         t        j
                  t        j                  ht        j                  t        j                  h      D        S )zLUtility method to generate the many possible pickle configurations.
        c                   "    e Zd ZdZd Zd Zd Zy)<PicklingTests._generate_pickle_copiers.<locals>.PickleCopierz&This class copies object using pickle.c                 .    || _         || _        || _        y r   )rS
  dumpsloads)r:   rS
  r
  r
  s       r?   r4   zEPicklingTests._generate_pickle_copiers.<locals>.PickleCopier.__init__  s    "
"
"
r@   c                 X    | j                  | j                  || j                              S r   )r
  r
  rS
  r+  s     r?   r   zAPicklingTests._generate_pickle_copiers.<locals>.PickleCopier.copy  s     zz$**S$**"=>>r@   c                     dj                  | j                  | j                  j                  | j                  j                  | j
                  j                  | j
                  j                        S )Nz0PickleCopier(proto={}, dumps={}.{}, loads={}.{}))r  rS
  r
  r   r   r
  r   s    r?   r   zEPicklingTests._generate_pickle_copiers.<locals>.PickleCopier.__repr__  sQ     K

 $

 5 5tzz7N7N $

 5 5tzz7N7NPQr@   N)r   r   r   r  r4   r   r   r   r@   r?   PickleCopierr
    s    4#?Qr@   r
  c              3   (   K   | ]	  } |   y wr   r   )r  r;   r
  s     r?   r  z9PicklingTests._generate_pickle_copiers.<locals>.<genexpr>  s      Ed# Es   rf   )		itertoolsproductr   r
  r
  r
  _dumpsr
  _loads)r
  s   @r?   _generate_pickle_copiersz&PicklingTests._generate_pickle_copiers  sb    	Q 	Q E$$U6+B+BQ+F%G&,llFMM%B&,llFMM%BDE 	Er@   c                     G d d      a | j                  t              5  t        j                  t               d       d d d         G d dt               a| j                  t              5  t        j                  t               d       d d d         G d d      a  G d dt               a G d d	t               a| j                         D ]  }| j                  |
      5  t               }|j                  |      }| j                  ||       d|_        |j                  |      }| j                  ||       t               }d|_        d|_        |j                  |      }| j                  ||       t               }d|_        d|_        |j                  |      }| j                  ||       d d d         y # 1 sw Y   {xY w# 1 sw Y   =xY w# 1 sw Y   xY w)Nc                       e Zd ZdgZy)r   rB   Nr  r   r@   r?   r   r   	  r  r@   r   r   c                       e Zd Zy)rN  NrM  r   r@   r?   rN  rN    rO  r@   rN  c                   (    e Zd ZdZdgZd Zd Zd Zy)r   z7A class with __getstate__ and __setstate__ implemented.rB   c                     t        | di       j                         }t        |       j                  D ]3  }|j                  j                  dd      D ]  }	 t        | |      ||<    5 |S # t        $ r Y $w xY w)NrI   r   r   )rH   r   rG   r^  rI   r   r  )r:   r
  r   r
  s       r?   r  zC.__getstate__  s    j"5::<:-- !C # 0 0b A !!*1$*=E$K!!   . ! !s   A))	A54A5c                 N    |j                         D ]  \  }}t        | ||        y r   r
  )r:   r
  r   r   s       r?   r  zC.__setstate__   s'    !KKM (DAqD!Q'(r@   c                 T    t        |       j                  d| j                         dS )Nz()<r&   )rG   r   r  r   s    r?   r   z
C.__repr__#  s     %)$Z%8%8$:K:K:MNNr@   N)r   r   r   r  r   r  r  r   r   r@   r?   r   r     s    EI(Or@   c                       e Zd ZdZy)rN  z!A subclass of a class with slots.Nr  r   r@   r?   rN  rN  &  s    /r@   c                       e Zd ZdZdgZy)r  zA subclass with an extra slot.rT   N)r   r   r   r  r   r   r@   r?   r  r  +  s    ,Ir@   r  )pickle_copierr   r   r   )r   r  r   r
  r
  rN  r  r
  r/	  r   r
  rB   rT   )r:   r
  r  r  s       r?   test_pickle_slotszPicklingTests.test_pickle_slots  s   	 	y) 	!LLa 	!	 	y) 	!LLa 	!	O 	O$	 	
	 	
 "::< 	+MM: +C!&&q)$$Q*!&&q)$$Q*C!&&q)$$Q*C!&&q)$$Q*'+ +	+K	! 	!	! 	!@+ +s$   F8+GCG8GGG	c                     G d d      a  G d dt              a G d dt              a G d dt              a G d	 d
t              at         t        t        t
        t        f}| j                         }t        j                  ||      D ]  \  }}| j                  ||      5  t        |di       } ||j                  i |}|j                  }|j                  |      }| j                  ||       |dk\  rI|j                   s=|j"                  j%                          |j                  |      }	| j                  ||	       d d d         |D ]  }| j                  |      5  t        |di       } ||j                  i |}t'        |      }| j                  ||       |j                   s7|j"                  j%                          t'        |      }	| j                  ||	       d d d         y # 1 sw Y   lxY w# 1 sw Y   xY w)Nc                   0     e Zd ZdZdZdZ fdZd Z xZS )r  z:The state of this class is copyable via its instance dict.r  Tc                 >    t         |           || _        || _        y r   )ru  r4   rB   rT   )r:   rB   rT   r  s      r?   r4   zC1.__init__M  s     "r@   c                 <    d| j                   d| j                  dS )NzC1(r  r(
  rS   r   s    r?   r   zC1.__repr__Q  s    '+vvtvv66r@   )	r   r   r   r  ARGSNEED_DICT_COPYINGr4   r   rx  r  s   @r?   r  r  I  s    HD $7r@   r  c                   J     e Zd ZdZdZdZ fdZ fdZed        Z	d Z
 xZS )r  z,A list subclass copyable via __getnewargs__.r  Fc                 B    t         |   |       }||_        ||_        |S r   ru  r   rB   rT   )r   rB   rT   r:   r  s       r?   r   z
C2.__new__Y  s$    ws+r@   c                 D    t         |           | j                  d       y Nr\
  )ru  r4   r   )r:   r;   r  s     r?   r4   zC2.__init__^  s     " H%r@   c                     | j                   S r   r
  rG  s    r?   r`
  zC2.__getnewargs__c      xxr@   c                 T    d| j                   d| j                  dt        |       dS )NzC2(r  )<r&   rB   rT   r6   r   s    r?   r   zC2.__repr__f      +/664664:FFr@   )r   r   r   r  r
  r
  r   r4   r  r`
  r   rx  r  s   @r?   r  r  U  s5    :D %
&
    Gr@   r  c                   :    e Zd ZdZdZdZd Zed        Zd Z	d Z
y)	r  z*A list subclass copyable via __getstate__.r  Fc                 B    || _         || _        | j                  d       y r
  )rB   rT   r   r 	  s      r?   r4   zC3.__init__n  s     H%r@   c                     | j                   S r   r
  rG  s    r?   r  zC3.__getstate__t  r
  r@   c                 *    |\  }}|| _         || _        y r   rS   )r:   r
  rB   rT   s       r?   r  zC3.__setstate__w  s    1r@   c                 T    d| j                   d| j                  dt        |       dS )NzC3(r  r
  r&   r
  r   s    r?   r   zC3.__repr__{  r
  r@   N)r   r   r   r  r
  r
  r4   r  r  r  r   r   r@   r?   r  r  j  s4    8D %&    Gr@   r  c                   @     e Zd ZdZdZdZ fdZed        Zd Z	 xZ
S )r  z,An int subclass copyable via __getnewargs__.)rN  rM  rf   Fc                 D    t         |   | |      }||_        ||_        |S r   r
  r   rB   rT   r  r:   r  s        r?   r   z
C4.__new__  &    wsE2r@   c                     | j                   S r   r
  rG  s    r?   r`
  zC4.__getnewargs__  r
  r@   c                 T    d| j                   d| j                  dt        |       dS )NzC4(r  r
  r&   rB   rT   r-   r   s    r?   r   zC4.__repr__      +/664663t9EEr@   )r   r   r   r  r
  r
  r   r  r`
  r   rx  r  s   @r?   r  r    s0    :(D %
    Fr@   r  c                   N     e Zd ZdZdZddiZdZdd fd
Zed	        Z	d
 Z
 xZS )rs
  z/An int subclass copyable via __getnewargs_ex__.r  r  rk   Fr   rF	  c                D    t         |   | |      }||_        ||_        |S r   r
  r
  s        r?   r   z
C5.__new__  r
  r@   c                 2    | j                   | j                  fS r   )r
  KWARGSrG  s    r?   rk
  zC5.__getnewargs_ex__  s    #**--r@   c                 T    d| j                   d| j                  dt        |       dS )NzC5(r  r
  r&   r
  r   s    r?   r   zC5.__repr__  r
  r@   )r   r   r   r  r
  r
  r
  r   r  rk
  r   rx  r  s   @r?   rs
  rs
    s<    =Dq\F %,- 
 . .Fr@   rs
  )r   r
  r
  rg   rG  )r  r6   r  r  r-   r  rs
  r
  r
  r
  r/	  rH   r
  rS
  r   r
  r
  rI   r  r   )
r:   test_classespickle_copiersr   r
  r<   r   rS
  r
  objcopy2s
             r?   test_reduce_copyingz!PicklingTests.test_reduce_copyingF  s   		7 		7	G 	G*	G 	G*	F 	F 	F 	F  BB+668"+"3"3L."Q 	8C#]C 8 h3388.v.%++',,S1$$S'2
 A:c&;&;$$**,,11':H((h78 8	8"   	8C#& 8 h3388.v."3-$$S'2
 ,,$$**,'0H((h78 8	8!8 8"8 8s   !BG*B G7*G4	7H 	c                      G d dt                G fdd      dd l}|j                  fd ddifd d f}| j                          j	                  d      |       y )	Nc                       e Zd Zy)(PicklingTests.test_issue24097.<locals>.SNrM  r   r@   r?   re  r
    rO  r@   re  c                   .    e Zd Z W d      gZ fdZy)(PicklingTests.test_issue24097.<locals>.Ar   c                 H    |dk(  r d      gj                   d d  yt        )Nr   r   )__slotnames__r  )r:   ru  r}  re  s     r?   r  z4PicklingTests.test_issue24097.<locals>.A.__getattr__  s'    6>*+F)AOOA&((r@   N)r   r   r   r
  r  )r}  re  s   r?   r}  r
    s    vYKM)r@   r}  r   r   r   rg   )r>  rK
  rM
  rE   rJ
  )r:   rK
  r  r}  re  s      @@r?   test_issue24097zPicklingTests.test_issue24097  s\    	 		) 	) 	&&tfb\.BD$O**1-x8r@   c                    t               j                          | j                  t              5  t               j                  d       d d d        t               j	                  d       | j                  t              5  t               j	                          d d d        | j                  t              5  t               j	                  d        d d d        y # 1 sw Y   xY w# 1 sw Y   MxY w# 1 sw Y   y xY wr   )r`  rR
  r  r   rJ
  r   s    r?   test_object_reducez PicklingTests.test_object_reduce  s     	y) 	#H"	# 	q!y) 	%H""$	%y) 	)H""4(	) 	)	# 	#	% 	%	) 	)s#   C>C#4C/C #C,/C8r   )r   r   r   rX
  r
  r5  r
  rh  r
  r
  r
  r
  r
  r   r@   r?   rH
  rH
  '  sS    -/$ $=<y@v?<4 E E0A+Fz8x9")r@   rH
  c                   0    e Zd Zej                  d        Zy)SharedKeyTestsc                 Z    G d d      } G d d|      }t        d      D cg c]  } |        |       f c}  |        |       }}| j                  t        j                  t	        |            t        j                  t	        |                   | j                  t        j                  t	        |            t        j                  ddi             t        d      \  |_        |_        |_        |_	        |_
        |_        | j                  t        j                  t	        |            t        j                  t	        |                    |       }| j                  t        j                  t	        |            t        j                  t	        |                   | j                  t        j                  t	        |            t        j                  ddi             | j                  t        j                  t	        |            t        j                  ddi             y c c}w )	Nc                       e Zd Zy))SharedKeyTests.test_subclasses.<locals>.ANrM  r   r@   r?   r}  r     rO  r@   r}  c                       e Zd Zy))SharedKeyTests.test_subclasses.<locals>.BNrM  r   r@   r?   r  r    rO  r@   r  r  rB   rf   r   )r   rE   r   r)  vars
assertLessr  r  rW  wr   r  r  assertGreater)r:   r}  r  rs  rB   rT   r   s          r?   test_subclasseszSharedKeyTests.test_subclasses  sg   	 		 	 #2Y'!#qs'sAC1tAw/tAw1GHd1g.s1g0FG (-Qx$QS!#qsACCMM$q'2CMM$q'4JKS3==a13==b3JKd2h/Aw1GHd1g.s1g0FG 	(s   H(N)r   r   r   r   r
  r  r   r@   r?   r
  r
    s    H Hr@   r
  c                       e Zd ZdZd Zd Zy)DebugHelperMetaz<
    Sets default __doc__ and simplifies repr() output.
    c                 ^    |j                  d      ||d<   t        j                  | |||      S )Nr  )r   rG   r   )r  r=   rU  r  s       r?   r   zDebugHelperMeta.__new__  s0    99Y'#E)||D$u55r@   c                 ,    t        | j                        S r   )r   r   rG  s    r?   r   zDebugHelperMeta.__repr__  s    CLL!!r@   N)r   r   r   r  r   r   r   r@   r?   r	  r	    s    6"r@   r	  c                   R    e Zd ZdZd Zd Zd Zd Zd Zd Z	d Z
d	 Zd
 Zd Zd Zy)MroTestz
    Regressions for some bugs revealed through
    mcsl.mro() customization (typeobject.c: mro_internal()) and
    cls.__bases__ assignment (typeobject.c: type_set_bases()).
    c                      d| _         d| _        y )Nr   F)stepreadyr   s    r?   r
  zMroTest.setUp  s    	
r@   c                 R    | j                   |k  }|r| xj                   dz  c_         |S r   )r  )r:   limitrets      r?   
step_untilzMroTest.step_until  s%    yy5 IINI
r@   c                 @      G  fddt               } G d d|      }y)zM
        type_set_bases must be aware that type->tp_mro can be NULL.
        c                       e Zd Z fdZy)4MroTest.test_incomplete_set_bases_on_self.<locals>.Mc                     j                  d      r#| j                  J | xj                  dz  c_        t        j	                  |       S )Nrf   r   )r  r^  rJ   rG   r  rB  s    r?   r  z8MroTest.test_incomplete_set_bases_on_self.<locals>.M.mro  s;    ??1%;;...MMR'Mxx}$r@   Nr  r   s   r?   r  r    s    %r@   r  c                       e Zd Zy)4MroTest.test_incomplete_set_bases_on_self.<locals>.ANrM  r   r@   r?   r}  r  $  rO  r@   r}  rB  Nr	  r:   r  r}  s   `  r?   !test_incomplete_set_bases_on_selfz)MroTest.test_incomplete_set_bases_on_self  s    	% 	%	! 	r@   c                       G  fddt               } G d d|       G d d      }|xj                  dz  c_        y	)
z?
        Deep reentrancy must not over-decref old_mro.
        c                       e Zd Z fdZy)/MroTest.test_reent_set_bases_on_base.<locals>.Mc                     | j                   5| j                  dk(  r&j                  d      rxj                  dz  c_        t        j                  |       S )Nr  r  r   )r^  r   r  rJ   rG   r  )r   r}  r:   s    r?   r  z3MroTest.test_reent_set_bases_on_base.<locals>.M.mro,  s@    ;;*s||s/Br*r)xx}$r@   Nr  )r}  r:   s   r?   r  r   +  s    %r@   r  c                       e Zd Zy)/MroTest.test_reent_set_bases_on_base.<locals>.ANrM  r   r@   r?   r}  r#  4  rO  r@   r}  rB  c                       e Zd Zy)/MroTest.test_reent_set_bases_on_base.<locals>.BNrM  r   r@   r?   r  r%  6  rO  r@   r  r   N)r	  rJ   )r:   r  r  r}  s   `  @r?   test_reent_set_bases_on_basez$MroTest.test_reent_set_bases_on_base'  s5    	% 	%	! 		 		rr@   c                 l      G  fddt               } G d d|      } G d d|      } G d d	|      }y
)zU
        Similar to test_reent_set_bases_on_base, but may crash differently.
        c                       e Zd Z fdZy)6MroTest.test_reent_set_bases_on_direct_base.<locals>.Mc                     | j                   d   }|t        ur&j                  d      r|xj                   dz  c_         t        j	                  |       S )Nr   r   r   )rJ   r`  r  rG   r  )r   r  r:   s     r?   r  z:MroTest.test_reent_set_bases_on_direct_base.<locals>.M.mro?  sA    }}Q'v%q)",xx}$r@   Nr  r   s   r?   r  r)  >      %r@   r  c                       e Zd Zy)6MroTest.test_reent_set_bases_on_direct_base.<locals>.ANrM  r   r@   r?   r}  r-  G  rO  r@   r}  rB  c                       e Zd Zy)6MroTest.test_reent_set_bases_on_direct_base.<locals>.BNrM  r   r@   r?   r  r/  I  rO  r@   r  c                       e Zd Zy)6MroTest.test_reent_set_bases_on_direct_base.<locals>.CNrM  r   r@   r?   r   r1  K  rO  r@   r   Nr  )r:   r  r}  r  r   s   `    r?   #test_reent_set_bases_on_direct_basez+MroTest.test_reent_set_bases_on_direct_base:  s3    	% 	%	! 		 		 	r@   c                       G  fddt               } G d d|      } G d d|       G d d	|      d
 _         j                  t              5  xj                  dz  c_        ddd       y# 1 sw Y   yxY w)aM  
        type_set_bases must check for an inheritance cycle not only through
        MRO of the type, which may be not yet updated in case of reentrance,
        but also through tp_base chain, which is assigned before diving into
        inner calls to mro().

        Otherwise, the following snippet can loop forever:
            do {
                // ...
                type = type->tp_base;
            } while (type != NULL);

        Functions that rely on tp_base (like solid_base and PyType_IsSubtype)
        would not be happy in that case, causing a stack overflow.
        c                       e Zd Z fdZy)5MroTest.test_reent_set_bases_tp_base_cycle.<locals>.Mc                     j                   r.| j                  dk(  rf_        | j                  dk(  rf_        t        j	                  |       S )NB1B2r  r   rJ   rG   r  )r   r7  r8  r:   s    r?   r  z9MroTest.test_reent_set_bases_tp_base_cycle.<locals>.M.mro_  sB    ::||t+(*u||t+(*uxx}$r@   Nr  )r7  r8  r:   s   r?   r  r5  ^  s    %r@   r  c                       e Zd Zy)5MroTest.test_reent_set_bases_tp_base_cycle.<locals>.ANrM  r   r@   r?   r}  r;  g  rO  r@   r}  rB  c                       e Zd Zy)6MroTest.test_reent_set_bases_tp_base_cycle.<locals>.B1NrM  r   r@   r?   r7  r=  i  rO  r@   r7  c                       e Zd Zy)6MroTest.test_reent_set_bases_tp_base_cycle.<locals>.B2NrM  r   r@   r?   r8  r?  k  rO  r@   r8  Tr   N)r	  r  r  r   rJ   )r:   r  r}  r7  r8  s   `  @@r?   "test_reent_set_bases_tp_base_cyclez*MroTest.test_reent_set_bases_tp_base_cycleN  sr     	% 	% 	%	! 		 		 	 
y) 	LLBL	 	 	s   A44A=c                      G  fddt               } G d d|      } G d d|      } G d d	|       G d
 d|      d _        |f_        f|_         j                  j                  f        j                  j	                         g        j                  |j	                         g         j                  |j                  f        j                  j	                         |g       y)a  
        type_set_bases must check for reentrancy upon finishing its job
        by updating tp_subclasses of old/new bases of the type.
        Otherwise, an implicit inheritance cycle through tp_subclasses
        can break functions that recurse on elements of that field
        (like recurse_down_subclasses and mro_hierarchy) eventually
        leading to a stack overflow.
        c                       e Zd Z fdZy);MroTest.test_tp_subclasses_cycle_in_update_slots.<locals>.Mc                     j                   r| j                  dk(  rd_         f_        t        j	                  |       S Nr   Fr9  )r   r8  r   r:   s    r?   r  z?MroTest.test_tp_subclasses_cycle_in_update_slots.<locals>.M.mro|  s3    ::#,,#"5!&DJ#%%AKxx}$r@   Nr  )r8  r   r:   s   r?   r  rC  {  s    %r@   r  c                       e Zd Zy);MroTest.test_tp_subclasses_cycle_in_update_slots.<locals>.ANrM  r   r@   r?   r}  rG    rO  r@   r}  rB  c                       e Zd Zy)<MroTest.test_tp_subclasses_cycle_in_update_slots.<locals>.B1NrM  r   r@   r?   r7  rI    rO  r@   r7  c                       e Zd Zy)<MroTest.test_tp_subclasses_cycle_in_update_slots.<locals>.B2NrM  r   r@   r?   r8  rK    rO  r@   r8  c                       e Zd Zy);MroTest.test_tp_subclasses_cycle_in_update_slots.<locals>.CNrM  r   r@   r?   r   rM    rO  r@   r   TN)r	  r  rJ   rE   r?  )r:   r  r}  r7  r8  r   s   `   @@r?   (test_tp_subclasses_cycle_in_update_slotsz0MroTest.test_tp_subclasses_cycle_in_update_slotsr  s    	% 	% 	%	! 		 		 		 	 
etre,**,qc2**,b1t,))+bT2r@   c                      G d dt                G  fddt              } G d d|      } G d d	|      } G d
 d|       G d d|      d _         j                        5  |f_        ddd       f|_         j                  j                  f        j                  j                  t        t        j                                     y# 1 sw Y   gxY w)z
        The same as test_tp_subclasses_cycle_in_update_slots, but tests
        a code path executed on error (goto bail).
        c                       e Zd Zy)=MroTest.test_tp_subclasses_cycle_error_return_path.<locals>.ENrM  r   r@   r?   r  rQ    rO  r@   r  c                       e Zd Z fdZy)=MroTest.test_tp_subclasses_cycle_error_return_path.<locals>.Mc                     j                   r1| j                  dk(  r"j                  fk(  rd_         n
f_        t        j	                  |       S rE  r9  )r   r8  r   r  r:   s    r?   r  zAMroTest.test_tp_subclasses_cycle_error_return_path.<locals>.M.mro  sF    ::#,,#"5{{re+%*
')exx}$r@   Nr  )r8  r   r  r:   s   r?   r  rS    s    % %r@   r  c                       e Zd Zy)=MroTest.test_tp_subclasses_cycle_error_return_path.<locals>.ANrM  r   r@   r?   r}  rV    rO  r@   r}  rB  c                       e Zd Zy)>MroTest.test_tp_subclasses_cycle_error_return_path.<locals>.B1NrM  r   r@   r?   r7  rX    rO  r@   r7  c                       e Zd Zy)>MroTest.test_tp_subclasses_cycle_error_return_path.<locals>.B2NrM  r   r@   r?   r8  rZ    rO  r@   r8  c                       e Zd Zy)=MroTest.test_tp_subclasses_cycle_error_return_path.<locals>.CNrM  r   r@   r?   r   r\    rO  r@   r   TN)
r0  r	  r  r  rJ   rE   r^  r  rG   r  )r:   r  r}  r7  r8  r   r  s   `   @@@r?   *test_tp_subclasses_cycle_error_return_pathz2MroTest.test_tp_subclasses_cycle_error_return_path  s    
		 		% 	% 	%	! 		 		 		 	 
q! 	 %AK	 tre,E$((1+$67	  	 s   -	CC%c                 @      G  fddt               } G d d|      }y)z
        Extending an uninitialized type with type->tp_mro == NULL must
        throw a reasonable TypeError exception, instead of failing
        with PyErr_BadInternalCall.
        c                       e Zd Z fdZy))MroTest.test_incomplete_extend.<locals>.Mc                     | j                   8| j                  dk7  r)j                  t              5   G d d|       }d d d        t        j                  |       S # 1 sw Y   xY w)Nr  c                       e Zd Zy)8MroTest.test_incomplete_extend.<locals>.M.mro.<locals>.XNrM  r   r@   r?   r  rc    s     r@   )r^  r   r  r   rG   r  )r   r  r:   s     r?   r  z-MroTest.test_incomplete_extend.<locals>.M.mro  sW    ;;&3<<3+>**95 !! !! xx}$	! !s   AA$Nr  r   s   r?   r  r`    r+  r@   r  c                       e Zd Zy))MroTest.test_incomplete_extend.<locals>.ANrM  r   r@   r?   r}  re    rO  r@   r}  rB  Nr  r  s   `  r?   test_incomplete_extendzMroTest.test_incomplete_extend  s    	% 	%	! 	r@   c                 @      G  fddt               } G d d|      }y)z
        Attribute lookup on a super object must be aware that
        its target type can be uninitialized (type->tp_mro == NULL).
        c                   "     e Zd Z fdZ xZS )(MroTest.test_incomplete_super.<locals>.Mc                     | j                   (j                  t              5  t        | |    d d d        t
        j                  |       S # 1 sw Y   xY wr   )r^  r  r  ru  xxxrG   r  )r   r  r:   s    r?   r  z,MroTest.test_incomplete_super.<locals>.M.mro  sJ    ;;&**>: ,c3+, xx}$, ,s   AA)r   r   r   r  rx  rv  s   @r?   r  ri    s    % %r@   r  c                       e Zd Zy)(MroTest.test_incomplete_super.<locals>.ANrM  r   r@   r?   r}  rm    rO  r@   r}  rB  Nr  r  s   `  r?   test_incomplete_superzMroTest.test_incomplete_super  s    
	% 	%	! 	r@   c                      G d d       G fddt               | j                  t              5   G d d      }ddd       y# 1 sw Y   yxY w)	z
        gh-92112: A custom mro() returning a result conflicting with
        __bases__ and deleting itself caused a double free.
        c                       e Zd Zy)/MroTest.test_disappearing_custom_mro.<locals>.BNrM  r   r@   r?   r  rq    rO  r@   r  c                       e Zd Z fdZy)/MroTest.test_disappearing_custom_mro.<locals>.Mc                     ` fS r   )r  )r   r  r  s    r?   r  z3MroTest.test_disappearing_custom_mro.<locals>.M.mro  s    Etr@   Nr  )r  r  s   r?   r  rs    s    r@   r  c                       e Zd Zy)/MroTest.test_disappearing_custom_mro.<locals>.ANrM  r   r@   r?   r}  rv    r  r@   r}  rB  N)r	  r  r   )r:   r}  r  r  s     @@r?   test_disappearing_custom_mroz$MroTest.test_disappearing_custom_mro  sJ    
	 		 	
 y) 	a 	 	 	s   A

AN)r   r   r   r  r
  r  r  r&  r2  r@  rN  r]  rf  rn  rw  r   r@   r?   r  r    sA    &("H"3H 8D$ r@   r  __main__)#rM  rK
  rX  r
  r*  r
  r5  r7  r   r<  r2   rm  rm  r   r   
contextlibr   r  r   r  r  r   r3   r   r   r
  r,
  r5
  rH
  r
  rG   r	  r  r   mainr   r@   r?   <module>r{     s<     	      
      & 
uDH%% uDp^H 1 1 ^HBQ98X&& 98xH-- 21!! 16w)H%% w)tHX&& H4	"d 	"bh bJ zHMMO ov  I
  Is$   D D) D&%D&)D32D3