
    6bh                    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Zd dlm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
j0                        Z G d d	e
j0                  e      Z G d
 de
j0                        Z G d de
j0                        Z G d de
j0                        Z G d de
j0                        Z G d de
j0                        Z G d de       Z! G d de
j0                        Z"e#dk(  r e
jH                          yy# e$ r dZY w xY w# e$ r dZY w xY w)    N)deepcopy)redirect_stdout)support)ExtraAssertionsc                   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        9/opt/python-3.12.12/usr/lib/python3.12/test/test_descr.pyr5   zOperatorsTest.__init__!   s   ""49$9&9
3
3
 3
 c	

 s
 
 h
 4
 d
 d
 3
 3
 #
 5
 #
  $!
" $#
$ )
. t{{0023JD$||~h$ $DKK 4 

 tzz//12JD$||~e|}#DJJt 3    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;   rC   resr?   methdtmbms	            r@   	unop_testzOperatorsTest.unop_testQ   s    !HdA,GAt !**$AA !**$ 	Iq11::d3CD1s#Qs#rA   c                    ||d}| j                  t        ||      |       t        |      }t        ||      }||j                  vr|j
                  d   }||j                  vr| j                  t        |d|      |j                  |          | j                   |||      |       t        ||      }	| j                   |	|      |       y )NrC   br   rD   rE   )
r;   rC   rU   rL   r?   rM   rN   rO   rP   rQ   s
             r@   
binop_testzOperatorsTest.binop_testa   s    !dA,GAt!**$AA !**$ 	Iq11::d3CD1a#&QA$rA   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rC   rU   cr   rD   )rF   rG   rH   rI   rJ   rK   slice)r;   rC   rU   rY   rL   r?   rM   rN   rO   rP   rQ   s              r@   sliceop_testzOperatorsTest.sliceop_testp   s    !!$dA,GAt!**$AA !**$ 	Iq11::d3CD1eAqk*C0QE!QK#.rA   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 )NrT   rC   r   rD   r   execrF   rH   rI   rJ   rK   )
r;   rC   rU   rL   stmtrM   rN   rO   rP   rQ   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%rA   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 )NrX   rC   r   rD   r]   )r;   rC   rU   rY   rL   r_   rM   rN   rO   rP   rQ   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%rA   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)rC   rU   rY   rN   rC   r   rD   )r   r^   rF   rH   rJ   rK   rI   rZ   )r;   rC   rU   rY   rN   rL   r_   rM   
dictionaryrO   rP   rQ   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#.rA   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__rg   rh      b in a__contains__   r   a[b]__getitem__a[b:c]a+=b__iadd__rl   rg   rh   rg   rh   rg   rh   a*=b__imul__len(a)__len__a*b__mul__b*a__rmul__a[b]=c__setitem__rg   rh   rl   ro         rg   r   r   ro   a[b:c]=d)rV   r[   r`   rR   rb   re   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
%	'rA   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 )Nrh   ro   rg   rl   rg   rm   rn   r   rp   rq   rx   ry   rl   rk   r~   r   )rV   r7   keysappenditerrF   __iter__dictrR   rG   repr__repr__rb   )r;   rN   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-%	'rA   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 )NrT   z__%s__)r6   r8   hasattrrG   rV   r7   r:   rR   )r;   rC   rU   skipr   r>   r?   rL   s           r@   number_operatorszOperatorsTest.number_operators   s    Q++++-JD$4$1d#tT*COOAq#tT: . tzz//12JD$4$1d#tT*CNN1c46 3rA   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   rl   rg   r   c                       e Zd Zd Zy)"OperatorsTest.test_ints.<locals>.Cc                     t         S NNotImplementedr;   others     r@   rj   z*OperatorsTest.test_ints.<locals>.C.__add__       %%rA   N)__name__
__module____qualname__rj    rA   r@   Cr          &rA   r   r    z+NotImplemented should have caused TypeError)r   rF   __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)rA   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rA   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JrA   N)r   r   r   	__slots__r   r   __str__r   rA   r@   Numberr     s    IK GrA   r   gQ	@r   r   z3.14rh   z3.1g     Pm@z234.5r   )r   r   rF   r   r   )r;   r   rC   s      r@   test_complexeszOperatorsTest.test_complexes  s    fd 2O 	P	W 	 4a a&)#11a%(#5Ma'*$rA   c                     | j                  t        j                  dd      t        dd             | j                  t        j	                  dd      d       y )Nr   g      @r   rg   g       )rF   r   __radd__r/   __rsub__r   s    r@   test_explicit_reverse_methodsz+OperatorsTest.test_explicit_reverse_methods.  sA    ))"c2GC4EFQ/6rA   "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>.spamlist9  s    $==##rA   rg   rh   ri   rj   rk   rm   rn   ro   rp   rq   rr   rs   rt   rl   ru   rv   rw   rx   ry   rz   r{   r|   r}   r~   r   r   r   r   r   r   c                       e Zd Zd Zy)(OperatorsTest.test_spam_lists.<locals>.Cc                      yNrg   r   r   s    r@   fooz,OperatorsTest.test_spam_lists.<locals>.C.fooV      !rA   Nr   r   r   r   r   rA   r@   r   r   U      #rA   r   r   *   r   )copyr   _deepcopy_dispatchr   rV   r[   r`   rR   rb   re   rF   r   r   getstatesetstate)r;   r   r   r   r   rC   s         r@   test_spam_listszOperatorsTest.test_spam_lists3  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*rA   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   spamdictr7   r8   )rN   r   r   sdkvs         r@   r   z/OperatorsTest.test_spam_dicts.<locals>.spamdicte  s6    $BQWWY11 (IrA   rh   ro   r   rg   rm   rn   rp   rq   rx   ry   zrepr(a)r   rl   rk   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   rA   Nr   r   rA   r@   r   r     r   rA   r   barr   r   r   r   r   )r   r   r   r   rV   r7   r   r   r   rF   r   rH   rR   r   rb   r8   r   r   r   )r;   r   r   r   rN   r   r   r   	straightdspamdr   rC   s               r@   test_spam_dictszOperatorsTest.test_spam_dicts`  sU    	'	 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 0BAJ	#ua95ud9oy*EQ),aHA]4K]	,	$ 	$Caggi"-!$%aggi>*:;q)	

3s+rA   c                     | j                  t        t        j                        j	                         t        j                         y r   )rF   rangesysmaxsizery   r   s    r@   test_wrap_lenfunc_bad_castz(OperatorsTest.test_wrap_lenfunc_bad_cast  s(    s{{+335s{{CrA   )rx   ry   )ri   rj   )rr   rq   )rs   rt   )r~   r   )r   r   )r   r   r   r5   rR   rV   r[   r`   rb   re   r   r   r   r   r   r   r   r   impl_detailr3   skipIfr   r   r   r   r   rA   r@   r   r      s    .$`$ %/&&&&/&'"'< +- 7"E$*%B7
 W=>X__Y$&(CD)+ E ?)+V W=>X__Y$&(CD/, E ?/,bDrA   r   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d Zd Zd Zd Zd Zd Z fdZej.                  d        Z ej2                  d       ej6                  edu d      d               Zd Zej.                  d        Z ej2                  d       ej6                  edu d      d               Z d Z!d Z"d Z#ejH                  d        Z%d  Z&ejH                  d!        Z'd" Z(d# Z)d$ Z*d% Z+ ej2                  d&      d'        Z,d( Z-d) Z.d* Z/d+ Z0 ej6                  e1jd                  jf                  d,k\  d-      d.        Z4ejj                  d/        Z6d0 Z7d1 Z8d2 Z9 fd3Z:d4 Z;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\ Zc ej2                  d]      d^        Zdd_ Zed` Zfda Zgdb Zhdc Zidd Zj ej                  de      df        Zldg Zmdh 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 Z fdZ ej6                  edu d      d        Zd Zd Z xZS )ClassPropertiesAndMethodsc                      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 Nrg   r   )rF   lenstater7   r8   )
self_localrC   kwr   r   r;   s        r@   r5   z?ClassPropertiesAndMethods.test_python_dicts.<locals>.C.__init__  sP    $$SVQ/'(tJ$ $RXXZ 01()
1 !1 rA   c                 &    | j                  |d      S r   )r   r;   keys     r@   rq   zBClassPropertiesAndMethods.test_python_dicts.<locals>.C.__getitem__  s    xxQ''rA   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%8rA   c                     || _         y r   r  r;   r  s     r@   r   z?ClassPropertiesAndMethods.test_python_dicts.<locals>.C.setstate  	    "
rA   c                     | j                   S r   r  r   s    r@   r   z?ClassPropertiesAndMethods.test_python_dicts.<locals>.C.getstate      zz!rA   N)	r   r   r   r  r5   rq   r   r   r   r   s   r@   r   r     s!    E*(9#"rA   r   r   rg   rh   r   r   r   r   r   
   r      2   )
assertTrue
issubclassr   r
  rF   assertIs	__class__r  r   r   r   )	r;   rN   r   a1a2rC   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#.  rA   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   )
isinstancerZ   startstopr7   rq   r;   r   s     r@   rq   zBClassPropertiesAndMethods.test_python_lists.<locals>.C.__getitem__  s6    a'77AFF?*''a0366rA   Nr   r   r   rq   r   rA   r@   r   r     s    7rA   r   r   rg   rh   r   r   rg   e   rh   f      )r   r+  )r7   extendrF   r;   r   rC   s      r@   test_python_listsz+ClassPropertiesAndMethods.test_python_lists  su    	7 	7
 C	1s#1s#1s#3sY/rA   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@   r5   z<ClassPropertiesAndMethods.test_metaclass.<locals>.C.__init__  	     rA   c                     | j                   S r   r3  r   s    r@   r   z<ClassPropertiesAndMethods.test_metaclass.<locals>.C.getstate      ||#rA   c                     || _         y r   r3  r  s     r@   r   z<ClassPropertiesAndMethods.test_metaclass.<locals>.C.setstate  	    $rA   Nr   r   r   r5   r   r   r   rA   r@   r   r1        !$%rA   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    CZrA   N)r   r   r   rB  r   rA   r@   
_metaclassr?    s    'rA   rC  c                       e Zd Zy3ClassPropertiesAndMethods.test_metaclass.<locals>.DNr   r   r   r   rA   r@   DrF        rA   rH  c                       e Zd Zd Zy)4ClassPropertiesAndMethods.test_metaclass.<locals>.M1c                 <    d|d<   t         j                  | |||      S )Nrg   __spam__rH   r   )r   r>   basesr   s       r@   r   z<ClassPropertiesAndMethods.test_metaclass.<locals>.M1.__new__  s!    #$Z ||Cud;;rA   Nr   r   r   r   r   rA   r@   M1rK    s    <rA   rQ  c                       e Zd Zyr1  NrG  r   rA   r@   r   z3ClassPropertiesAndMethods.test_metaclass.<locals>.C  rI  rA   rg   c                       e Zd Zy);ClassPropertiesAndMethods.test_metaclass.<locals>._instanceNrG  r   rA   r@   	_instancerU    rI  rA   rV  c                   (    e Zd Zed        Z fdZy)4ClassPropertiesAndMethods.test_metaclass.<locals>.M2c                 Z    t         j                  |       }||_        ||_        ||_        |S r   )objectr   r>   rO  r   )r   r>   rO  r   r;   s        r@   r   z<ClassPropertiesAndMethods.test_metaclass.<locals>.M2.__new__  s*    ~~c* 	"
 	rA   c           	                  }| j                   D ]>  }|j                  d      rt        ||| j                   |   j                  ||              @ |S )N__)r   
startswithsetattr__get__)r;   itr  rV  s      r@   __call__z=ClassPropertiesAndMethods.test_metaclass.<locals>.M2.__call__  sO    [99C~~d+ BTYYs^%;%;B%EF % 	rA   N)r   r   r   staticmethodr   ra  )rV  s   r@   M2rX    s     rA   rc  c                       e Zd Zd Zy)r1  c                      yNr   r   r   s    r@   r   z8ClassPropertiesAndMethods.test_metaclass.<locals>.C.spam      rA   Nr   r   r   r   r   rA   r@   r   z3ClassPropertiesAndMethods.test_metaclass.<locals>.C      rA   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 )Nrg   _z
_%s__super__super)superr   r^  )r=  r>   rO  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:.
rA   r   r   r   r   __classcell__)r  rp  s   @r@   rp  rk    s     rA   rp  c                       e Zd Zd Zy)3ClassPropertiesAndMethods.test_metaclass.<locals>.Ac                      yNAr   r   s    r@   rM   z8ClassPropertiesAndMethods.test_metaclass.<locals>.A.meth&      rA   Nr   r   r   rM   r   rA   r@   rw  rt  %      rA   rw  c                       e Zd Zd Zy)3ClassPropertiesAndMethods.test_metaclass.<locals>.Bc                 <    d| j                   j                         z   S NB	_B__superrM   r   s    r@   rM   z8ClassPropertiesAndMethods.test_metaclass.<locals>.B.meth)      T\\..000rA   Nry  r   rA   r@   r  r|  (      1rA   r  c                       e Zd Zd Zy)r1  c                 <    d| j                   j                         z   S Nr   	_C__superrM   r   s    r@   rM   z8ClassPropertiesAndMethods.test_metaclass.<locals>.C.meth,  r  rA   Nry  r   rA   r@   r   z3ClassPropertiesAndMethods.test_metaclass.<locals>.C+  r  rA   c                       e Zd Zd Zy)rF  c                 <    d| j                   j                         z   S NrH  )	_D__superrM   r   s    r@   rM   z8ClassPropertiesAndMethods.test_metaclass.<locals>.D.meth/  r  rA   Nry  r   rA   r@   rH  z3ClassPropertiesAndMethods.test_metaclass.<locals>.D.  r  rA   DCBAc                       e Zd Zd Zy)3ClassPropertiesAndMethods.test_metaclass.<locals>.Ec                 <    d| j                   j                         z   S )NE)	_E__superrM   r   s    r@   rM   z8ClassPropertiesAndMethods.test_metaclass.<locals>.E.meth3  r  rA   Nry  r   rA   r@   r  r  2  r  rA   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_)r8   r]  r   propertyro  r   )r=  r>   rO  r   hitsr  valr   setr  autopropertys            r@   r   zFClassPropertiesAndMethods.test_metaclass.<locals>.autoproperty.__new__:  s     $

HC~~g.!!"g#'88C#>S!$'HS	0!!"g#'88C#>S!$'HS	 !- (,zz|OC#s (c 2DI (4\9=i<@%O OrA   rq  )r  r  s   @r@   r  r  7  s    O OrA   r  c                       e Zd Zd Zd Zy)rt  c                     | j                    S r   _A__xr   s    r@   _get_xz:ClassPropertiesAndMethods.test_metaclass.<locals>.A._get_xL  s    y rA   c                     | | _         y r   r  r;   xs     r@   _set_xz:ClassPropertiesAndMethods.test_metaclass.<locals>.A._set_xN  s    2rA   N)r   r   r   r  r  r   rA   r@   rw  z3ClassPropertiesAndMethods.test_metaclass.<locals>.AK  s    !rA   r  r   ic                       e Zd Zy)@ClassPropertiesAndMethods.test_metaclass.<locals>.multimetaclassNrG  r   rA   r@   multimetaclassr  V      rA   r  c                       e Zd Zd Zy)rt  c                      yrv  r   r   s    r@   r  z:ClassPropertiesAndMethods.test_metaclass.<locals>.A._get_xZ  rx  rA   Nr   r   r   r  r   rA   r@   rw  z3ClassPropertiesAndMethods.test_metaclass.<locals>.AY  rz  rA   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_x]      T\\00222rA   Nr  r   rA   r@   r  z3ClassPropertiesAndMethods.test_metaclass.<locals>.B\      3rA   c                       e Zd Zd Zy)r1  c                 <    d| j                   j                         z   S r  )r  r  r   s    r@   r  z:ClassPropertiesAndMethods.test_metaclass.<locals>.C._get_x`  r  rA   Nr  r   rA   r@   r   z3ClassPropertiesAndMethods.test_metaclass.<locals>.C_  r  rA   c                       e Zd Zd Zy)rF  c                 <    d| j                   j                         z   S r  )r  r  r   s    r@   r  z:ClassPropertiesAndMethods.test_metaclass.<locals>.D._get_xc  r  rA   Nr  r   rA   r@   rH  z3ClassPropertiesAndMethods.test_metaclass.<locals>.Db  r  rA   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@   r5   z<ClassPropertiesAndMethods.test_metaclass.<locals>.T.__init__j  s    		Q	rA   N)r   r   r   r  r5   )r  s   r@   r  r  h  s    GrA   r  c                       e Zd ZyrS  rG  r   rA   r@   r   z3ClassPropertiesAndMethods.test_metaclass.<locals>.Cl  rI  rA   c                       e Zd ZyrS  rG  r   rA   r@   r   z3ClassPropertiesAndMethods.test_metaclass.<locals>.Cs      rA   z5calling object w/o call method should raise TypeErrorc                       e Zd Zd Zy)rt  c                  ,    t        j                  | i |S r   rN  r<   r=   s     r@   r   z;ClassPropertiesAndMethods.test_metaclass.<locals>.A.__new__|  s    ||T4V44rA   NrP  r   rA   r@   rw  z3ClassPropertiesAndMethods.test_metaclass.<locals>.A{      5rA   c                       e Zd Zyr|  NrG  r   rA   r@   r  z3ClassPropertiesAndMethods.test_metaclass.<locals>.B  rI  rA   c                       e Zd ZyrS  rG  r   rA   r@   r   z3ClassPropertiesAndMethods.test_metaclass.<locals>.C  rI  rA   c                       e Zd ZyrE  rG  r   rA   r@   rH  z3ClassPropertiesAndMethods.test_metaclass.<locals>.D  rI  rA   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   ro  r   mclsr>   rO  nsr  	new_callss       r@   r   z?ClassPropertiesAndMethods.test_metaclass.<locals>.AMeta.__new__  &      )wtT5"==rA   c                     i S r   r   )r  r>   rO  s      r@   __prepare__zCClassPropertiesAndMethods.test_metaclass.<locals>.AMeta.__prepare__  s    	rA   r   r   r   rb  r   classmethodr  rr  r  r  s   @r@   r  r    s)    > >  rA   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  rA   c                 2    t         |   ||      }d|d<   |S )NTBMeta_was_here)ro  r  )r  r>   rO  r  r  s       r@   r  zCClassPropertiesAndMethods.test_metaclass.<locals>.BMeta.__prepare__  s$    W(u5'+#$	rA   r  r  s   @r@   r  r    s)    > >  rA   r  c                       e Zd Zyrt  NrG  r   rA   r@   rw  z3ClassPropertiesAndMethods.test_metaclass.<locals>.A  rI  rA   c                       e Zd Zyr  rG  r   rA   r@   r  z3ClassPropertiesAndMethods.test_metaclass.<locals>.B  rI  rA   c                       e Zd ZyrS  rG  r   rA   r@   r   z3ClassPropertiesAndMethods.test_metaclass.<locals>.C  rI  rA   r  c                       e Zd Zy4ClassPropertiesAndMethods.test_metaclass.<locals>.C2NrG  r   rA   r@   C2r    rI  rA   r  c                       e Zd ZyrE  rG  r   rA   r@   rH  z3ClassPropertiesAndMethods.test_metaclass.<locals>.D  rI  rA   c                       e Zd Zyr  NrG  r   rA   r@   r  z3ClassPropertiesAndMethods.test_metaclass.<locals>.E  rI  rA   c                      S r   r   )r<   r=   markers     r@   funcz6ClassPropertiesAndMethods.test_metaclass.<locals>.func  s    MrA   c                       e Zd Zy3ClassPropertiesAndMethods.test_metaclass.<locals>.XNrG  r   rA   r@   Xr    rI  rA   r  c                       e Zd Zy)3ClassPropertiesAndMethods.test_metaclass.<locals>.YNrG  r   rA   r@   Yr    rI  rA   r  c                       e Zd Zy)3ClassPropertiesAndMethods.test_metaclass.<locals>.ZNrG  r   rA   r@   Zr    rI  rA   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,,rA   c                 *    j                  d       i S r  r   )r  r>   rO  prepare_callss      r@   r  zFClassPropertiesAndMethods.test_metaclass.<locals>.ANotMeta.__prepare__  s    $$Z0	rA   r   r   r   r   r  r  rr  r  r  r  s   @r@   r  r    s    -  rA   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  rA   c                 F    j                  d       t        | 	  ||      S r  )r   ro  r  )r  r>   rO  r  r  s      r@   r  zFClassPropertiesAndMethods.test_metaclass.<locals>.BNotMeta.__prepare__  s#    $$Z0w*477rA   r  r   s   @r@   r  r    s    - 8 8rA   r  c                       e Zd Zyr  rG  r   rA   r@   rw  z3ClassPropertiesAndMethods.test_metaclass.<locals>.A  rI  rA   c                       e Zd Zyr  rG  r   rA   r@   r  z3ClassPropertiesAndMethods.test_metaclass.<locals>.B  rI  rA   c                       e Zd ZyrS  rG  r   rA   r@   r   z3ClassPropertiesAndMethods.test_metaclass.<locals>.C  rI  rA   c                       e Zd Zyr  rG  r   rA   r@   r  z4ClassPropertiesAndMethods.test_metaclass.<locals>.C2  rI  rA   c                       e Zd ZyrE  rG  r   rA   r@   rH  z3ClassPropertiesAndMethods.test_metaclass.<locals>.D      rA   c                       e Zd Zyr  rG  r   rA   r@   r  z3ClassPropertiesAndMethods.test_metaclass.<locals>.E  rI  rA   c                       e Zd Zy)3ClassPropertiesAndMethods.test_metaclass.<locals>.FNrG  r   rA   r@   Fr    rI  rA   r  c                       e Zd Zy)4ClassPropertiesAndMethods.test_metaclass.<locals>.F2NrG  r   rA   r@   F2r     rI  rA   r  c                       e Zd Zyr  rG  r   rA   r@   r  z3ClassPropertiesAndMethods.test_metaclass.<locals>.X+  r  rA   c                       e Zd Zyr  rG  r   rA   r@   r  z3ClassPropertiesAndMethods.test_metaclass.<locals>.X.  r  rA   )rH   rF   r   r   rB  r  rM  rZ  r>   rO  assertInr   r   rM   assertNotHasAttrr  r  r  r   r   r  clearrJ   assertRaisesr.   )r;   r   rC   rC  rH  rN   rQ  rY   rc  rw  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  rV  r  rp  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   )r5   )r;   r>   MTs     r@   r5   zEClassPropertiesAndMethods.test_module_subclasses.<locals>.MM.__init__6  s    D$'rA   c                 N    j                  d|f       j                  | |      S )NrI   )r   __getattribute__r;   r>   r  logs     r@   r!  zMClassPropertiesAndMethods.test_module_subclasses.<locals>.MM.__getattribute__8  s'    

It,-**466rA   c                 T    j                  d||f       j                  | ||       y )Nr^  )r   __setattr__)r;   r>   r  r  r#  s      r@   r%  zHClassPropertiesAndMethods.test_module_subclasses.<locals>.MM.__setattr__;  s&    

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

It,-tT*rA   N)r   r   r   r5   r!  r%  r(  )r  r#  s   r@   MMr  5  s    (72+rA   r)  rC   r   ))r^  r   r   rI   r   )r'  r   c                       e Zd Zy)@ClassPropertiesAndMethods.test_module_subclasses.<locals>.ModuleNrG  r   rA   r@   Moduler,  K  r  rA   r-  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   rA   r@   random_namezEClassPropertiesAndMethods.test_module_subclasses.<locals>.random_nameT  s"    776>>&*>*>"EFFrA   c                       e Zd Zy);ClassPropertiesAndMethods.test_module_subclasses.<locals>.ANrG  r   rA   r@   rw  r6  V  rI  rA   rw  r   )rH   r   r   rF   types
ModuleTypestrr   r   r   __subclasses__)r;   r)  rC   r  r-  r4  rw  r   
subclassesr  r#  s            @@r@   test_module_subclassesz0ClassPropertiesAndMethods.test_module_subclasses1  s    #Y	+ 	+ sGEEE 3 	4
	%))3 
 II $ %	G	 	=B3ZHZd;=1$3Z
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   r3  r   s    r@   r5   zGClassPropertiesAndMethods.test_multiple_inheritance.<locals>.C.__init__^  r5  rA   c                     | j                   S r   r3  r   s    r@   r   zGClassPropertiesAndMethods.test_multiple_inheritance.<locals>.C.getstate`  r7  rA   c                     || _         y r   r3  r  s     r@   r   zGClassPropertiesAndMethods.test_multiple_inheritance.<locals>.C.setstateb  r9  rA   Nr:  r   rA   r@   r   r?  ]  r;  rA   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   r5   r   s    r@   r5   zGClassPropertiesAndMethods.test_multiple_inheritance.<locals>.D.__init__i  s    d#

4 rA   Nr   r   r   r5   r   s   r@   rH  rD  h  s    !rA   rH  worldhello)rI  rH  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__x  s    488:&rA   c                      y)N23r   r   s    r@   r   zEClassPropertiesAndMethods.test_multiple_inheritance.<locals>.Node.fooz      rA   N)r   r   r   rM  r   r   rA   r@   NoderK  w  s    'rA   rQ  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}  rP  rA   Nr   r   rA   r@   FragrS  |      rA   rV     r   )rZ  rF   r   r   r   r7   r   r8   __mro__rM  r.   )r;   rC   rH  rN   rQ  rV  r   s         @r@   test_multiple_inheritancez3ClassPropertiesAndMethods.test_multiple_inheritance[  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)rA   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rv  r   r   s    r@   r   zBClassPropertiesAndMethods.test_diamond_inheritance.<locals>.A.spam      3rA   Nrh  r   rA   r@   rw  r]    s    &rA   rw  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      #rA   c                      yr~  r   r   s    r@   r   zBClassPropertiesAndMethods.test_diamond_inheritance.<locals>.B.spam  r_  rA   N)r   r   r   rc  r   r   rA   r@   r  ra    s    %&rA   r  c                       e Zd Zd Zy)=ClassPropertiesAndMethods.test_diamond_inheritance.<locals>.Cc                      yr  r   r   s    r@   rc  zAClassPropertiesAndMethods.test_diamond_inheritance.<locals>.C.boo  rd  rA   N)r   r   r   rc  r   rA   r@   r   rg    s    %rA   r   c                       e Zd Zy)=ClassPropertiesAndMethods.test_diamond_inheritance.<locals>.DNrG  r   rA   r@   rH  rj    r  rA   rH  c                       e Zd Zy)=ClassPropertiesAndMethods.test_diamond_inheritance.<locals>.ENrG  r   rA   r@   r  rl    r  rA   r  c                       e Zd Zy)=ClassPropertiesAndMethods.test_diamond_inheritance.<locals>.FNrG  r   rA   r@   r  rn    r  rA   r  z#expected MRO order disagreement (F)c                       e Zd Zy)=ClassPropertiesAndMethods.test_diamond_inheritance.<locals>.GNrG  r   rA   r@   Grp    r  rA   rq  z#expected MRO order disagreement (G))rZ  rF   r   rc  rY  r   r   )r;   rw  r  r   rH  r  r  rq  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>.ANrG  r   rA   r@   rw  ru    r  rA   rw  c                       e Zd Zy)<ClassPropertiesAndMethods.test_ex5_from_c3_switch.<locals>.BNrG  r   rA   r@   r  rw    r  rA   r  c                       e Zd Zy)<ClassPropertiesAndMethods.test_ex5_from_c3_switch.<locals>.CNrG  r   rA   r@   r   ry    r  rA   r   c                       e Zd Zy)<ClassPropertiesAndMethods.test_ex5_from_c3_switch.<locals>.XNrG  r   rA   r@   r  r{    r  rA   r  c                       e Zd Zy)<ClassPropertiesAndMethods.test_ex5_from_c3_switch.<locals>.YNrG  r   rA   r@   r  r}    r  rA   r  c                       e Zd Zy)<ClassPropertiesAndMethods.test_ex5_from_c3_switch.<locals>.ZNrG  r   rA   r@   r  r    r  rA   r  rZ  rF   rY  )r;   rw  r  r   r  r  r  s          r@   test_ex5_from_c3_switchz1ClassPropertiesAndMethods.test_ex5_from_c3_switch  s[    !AaQ1aAv$>?rA   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>.BoatNrG  r   rA   r@   Boatr    r  rA   r  c                       e Zd Zy)<ClassPropertiesAndMethods.test_monotonicity.<locals>.DayBoatNrG  r   rA   r@   DayBoatr    r  rA   r  c                       e Zd Zy)>ClassPropertiesAndMethods.test_monotonicity.<locals>.WheelBoatNrG  r   rA   r@   	WheelBoatr    r  rA   r  c                       e Zd Zy)?ClassPropertiesAndMethods.test_monotonicity.<locals>.EngineLessNrG  r   rA   r@   
EngineLessr    r  rA   r  c                       e Zd Zy)CClassPropertiesAndMethods.test_monotonicity.<locals>.SmallMultihullNrG  r   rA   r@   SmallMultihullr    r  rA   r  c                       e Zd Zy)CClassPropertiesAndMethods.test_monotonicity.<locals>.PedalWheelBoatNrG  r   rA   r@   PedalWheelBoatr    r  rA   r  c                       e Zd Zy)CClassPropertiesAndMethods.test_monotonicity.<locals>.SmallCatamaranNrG  r   rA   r@   SmallCatamaranr    r  rA   r  c                       e Zd Zy);ClassPropertiesAndMethods.test_monotonicity.<locals>.PedaloNrG  r   rA   r@   Pedalor    r  rA   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rA   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>.PaneNrG  r   rA   r@   Paner    r  rA   r  c                       e Zd Zy)KClassPropertiesAndMethods.test_consistency_with_epg.<locals>.ScrollingMixinNrG  r   rA   r@   ScrollingMixinr    r  rA   r  c                       e Zd Zy)IClassPropertiesAndMethods.test_consistency_with_epg.<locals>.EditingMixinNrG  r   rA   r@   EditingMixinr    r  rA   r  c                       e Zd Zy)KClassPropertiesAndMethods.test_consistency_with_epg.<locals>.ScrollablePaneNrG  r   rA   r@   ScrollablePaner    r  rA   r  c                       e Zd Zy)IClassPropertiesAndMethods.test_consistency_with_epg.<locals>.EditablePaneNrG  r   rA   r@   EditablePaner    r  rA   r  c                       e Zd Zy)SClassPropertiesAndMethods.test_consistency_with_epg.<locals>.EditableScrollablePaneNrG  r   rA   r@   EditableScrollablePaner    r  rA   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	7rA   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_detailr9  r]  )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>.ANrG  r   rA   r@   rw  r    r  rA   rw  c                       e Zd Zy):ClassPropertiesAndMethods.test_mro_disagreement.<locals>.BNrG  r   rA   r@   r  r    r  rA   r  c                       e Zd Zy):ClassPropertiesAndMethods.test_mro_disagreement.<locals>.CNrG  r   rA   r@   r   r    r  rA   r   zduplicate base class Ar  c                       e Zd Zy)CClassPropertiesAndMethods.test_mro_disagreement.<locals>.GridLayoutNrG  r   rA   r@   
GridLayoutr    r  rA   r  c                       e Zd Zy)GClassPropertiesAndMethods.test_mro_disagreement.<locals>.HorizontalGridNrG  r   rA   r@   HorizontalGridr    r  rA   r  c                       e Zd Zy)EClassPropertiesAndMethods.test_mro_disagreement.<locals>.VerticalGridNrG  r   rA   r@   VerticalGridr    r  rA   r  c                       e Zd Zy)?ClassPropertiesAndMethods.test_mro_disagreement.<locals>.HVGridNrG  r   rA   r@   HVGridr    r  rA   r  c                       e Zd Zy)?ClassPropertiesAndMethods.test_mro_disagreement.<locals>.VHGridNrG  r   rA   r@   VHGridr    r  rA   r  ConfusedGrid)rZ  r   rH   )r;   mro_err_msgr  rw  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	;rA   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 attributerJ   c                       e Zd Zy):ClassPropertiesAndMethods.test_object_class.<locals>.CdictNrG  r   rA   r@   Cdictr    rI  rA   r  rg   )rZ  rF   r  rH   assertNotEqualr  r   r   AttributeErrorr   rJ   )r;   rC   rU   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>.SubTyperg   Nr   r   r   rC   r   rA   r@   SubTyper    s    ArA   r  rP   rC   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   rA   r@   MyIntr  .      IrA   r  rg   c                       e Zd ZdZy)jClassPropertiesAndMethods.test_object_class_assignment_between_heaptypes_and_nonheaptypes.<locals>.MyFloatr   Nr  r   rA   r@   MyFloatr  3  r  rA   r        ?c                       e Zd ZdZy)lClassPropertiesAndMethods.test_object_class_assignment_between_heaptypes_and_nonheaptypes.<locals>.MyComplexr   Nr  r   rA   r@   	MyComplexr  8  r  rA   r  y      ?       @c                       e Zd ZdZy)hClassPropertiesAndMethods.test_object_class_assignment_between_heaptypes_and_nonheaptypes.<locals>.MyStrr   Nr  r   rA   r@   MyStrr  =  r  rA   r  c                       e Zd ZdZy)jClassPropertiesAndMethods.test_object_class_assignment_between_heaptypes_and_nonheaptypes.<locals>.MyBytesr   Nr  r   rA   r@   MyBytesr  B  r  rA   r     ac                       e Zd ZdZy)jClassPropertiesAndMethods.test_object_class_assignment_between_heaptypes_and_nonheaptypes.<locals>.MyTupler   Nr  r   rA   r@   MyTupler  G  r  rA   r  r   c                       e Zd ZdZy)nClassPropertiesAndMethods.test_object_class_assignment_between_heaptypes_and_nonheaptypes.<locals>.MyFrozenSetr   Nr  r   rA   r@   MyFrozenSetr  L  r  rA   r  )r7  r8  r  r  assertFalser   r.   r  r   r/   r   r9  bytestuple	frozenset)
r;   r  rP   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  s   	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)$/IK! *)= *)
 *)
 *)
 *)
 *)
 *)
 *)sT   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   rA   r@   C0r  S  r  rA   r  rJ   r   c                       e Zd ZdgZy)0ClassPropertiesAndMethods.test_slots.<locals>.C1rC   Nr  r   rA   r@   C1r  Y  	    IrA   r   rC   rg   c                       e Zd Zg dZy)0ClassPropertiesAndMethods.test_slots.<locals>.C3rX   Nr  r   rA   r@   C3r  e      'IrA   r  rU   rY   rh   rl   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@   r5   z9ClassPropertiesAndMethods.test_slots.<locals>.C4.__init__v  	     rA   c                     | j                   S r   r
  r   s    r@   r   z4ClassPropertiesAndMethods.test_slots.<locals>.C4.getx      xxrA   N)r   r   r   __doc__r   r5   r   r   rA   r@   C4r  s  s    (I! rA   r  r   r  r   z$Double underscored names not mangledc                       e Zd ZdgZy/ClassPropertiesAndMethods.test_slots.<locals>.CNr  r   rA   r@   r   r    s	    !F	rA   r   z[None] slots not caughtc                       e Zd ZdgZy)r  zfoo barNr  r   rA   r@   r   z/ClassPropertiesAndMethods.test_slots.<locals>.C  s	    &K	rA   z['foo bar'] slots not caughtc                       e Zd ZdgZy)r  zfoo barNr  r   rA   r@   r   z/ClassPropertiesAndMethods.test_slots.<locals>.C  s	    'L	rA   z['foo\0bar'] slots not caughtc                       e Zd ZdgZy)r  1Nr  r   rA   r@   r   z/ClassPropertiesAndMethods.test_slots.<locals>.C  s	     E	rA   z['1'] slots not caughtc                       e Zd ZdgZy)r  r   Nr  r   rA   r@   r   z/ClassPropertiesAndMethods.test_slots.<locals>.C  s	    D	rA   z[''] slots not caughtc                       e Zd Zg dZy)r  )rC   a_b_aA0123456789ZNr  r   rA   r@   r   z/ClassPropertiesAndMethods.test_slots.<locals>.C  s    :IrA   c                       e Zd ZdZyr  abcNr  r   rA   r@   r   z/ClassPropertiesAndMethods.test_slots.<locals>.C      IrA   c                       e Zd ZdZyr  r  r   rA   r@   r   z/ClassPropertiesAndMethods.test_slots.<locals>.C  r!  rA   r   c                       e Zd ZW  Zyr  r  )slotss   r@   r   z/ClassPropertiesAndMethods.test_slots.<locals>.C  s    IrA   r   c                       e Zd Z ed      gZy)r     N)r   r   r   chrr   r   rA   r@   r   z/ClassPropertiesAndMethods.test_slots.<locals>.C  s     XJ	rA   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@   r5   z>ClassPropertiesAndMethods.test_slots.<locals>.Counted.__init__      1$rA   c                 0    xj                   dz  c_         y r   r  r+  s    r@   __del__z=ClassPropertiesAndMethods.test_slots.<locals>.Counted.__del__  r-  rA   N)r   r   r   r  r5   r/  )r,  s   r@   r,  r)    s    G%%rA   r,  c                       e Zd Zg dZy)r  rX   Nr  r   rA   r@   r   z/ClassPropertiesAndMethods.test_slots.<locals>.C  r  rA   c                       e Zd Zy)/ClassPropertiesAndMethods.test_slots.<locals>.DNrG  r   rA   r@   rH  r2    rI  rA   rH  c                       e Zd ZdgZy)/ClassPropertiesAndMethods.test_slots.<locals>.EeNr  r   rA   r@   r  r4    r  rA   r  c                       e Zd ZddgZy)/ClassPropertiesAndMethods.test_slots.<locals>.FrC   rU   Nr  r   rA   r@   r  r7        c
IrA   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     rA   Nr   r   r   r=  r   rA   r@   rq  r;    s    !rA   rq  r  c                   &    e Zd ZddgZd Z fdZy)/ClassPropertiesAndMethods.test_slots.<locals>.HrC   rU   c                      d| _         d| _        y Nrg   rh   rT   r   s    r@   r5   z8ClassPropertiesAndMethods.test_slots.<locals>.H.__init__  s    rA   c                 v    j                  | j                  d       j                  | j                  d       y rB  )rF   rC   rU   )self_r;   s    r@   r/  z7ClassPropertiesAndMethods.test_slots.<locals>.H.__del__  s+      !,  !,rA   N)r   r   r   r   r5   r/  r   s   r@   Hr@  	  s    c
I-rA   rE  stderrr   c                       e Zd ZdZy/ClassPropertiesAndMethods.test_slots.<locals>.XrC   Nr  r   rA   r@   r  rI        IrA   r  c                       e Zd ZdZyrH  r  r   rA   r@   r  z/ClassPropertiesAndMethods.test_slots.<locals>.X  rJ  rA   z'X' object has no attribute 'a'c                       e Zd Zy)4ClassPropertiesAndMethods.test_slots.<locals>.SubStrNrG  r   rA   r@   SubStrrM  "  rI  rA   rN  c                   "    e Zd Z W  d      fZy)rI  r  Nr  )rN  s   r@   r  z/ClassPropertiesAndMethods.test_slots.<locals>.X$  s    IrA   ) rZ  r  rC   rF   rU   rY   r   _ClassPropertiesAndMethods__ar   r  r   r   r   r  rH   r9  UnicodeEncodeErrorr  r   
gc_collectzr5  r   gcr  r9  r   captured_outputgetvaluer  assertRaisesRegexr  )r;   r  r  r   r  r  r   rY   rH  r  r  srq  gorig_objectsr   new_objectsrE  hr  r,  rN  r$  s   `                   @@@r@   
test_slotsz$ClassPropertiesAndMethods.test_slotsQ  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 W	S 		' 	'##N4UVCEE WVO  		  		  		  		  		  		H -. 		P /. /. WV WVs   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>.DrJ   Nr  r   rA   r@   rH  r`  ,  	    #IrA   rH  rJ   __weakref__r   r   c                       e Zd ZdgZy)7ClassPropertiesAndMethods.test_slots_special.<locals>.Wrb  Nr  r   rA   r@   Wrd  4  	    &IrA   re  z!shouldn't be allowed to set a.fooc                       e Zd Zg Zy)8ClassPropertiesAndMethods.test_slots_special.<locals>.C1Nr  r   rA   r@   r   rh  @  r  rA   r   c                       e Zd Zg Zy)8ClassPropertiesAndMethods.test_slots_special.<locals>.C2Nr  r   rA   r@   r  rj  H  r  rA   r  )rZ  assertHasAttrr  r   rF   rJ   r   r  )r;   rH  rC   re  r   r  s         r@   test_slots_specialz,ClassPropertiesAndMethods.test_slots_special*  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  ro  r   )r   r>   rO  	namespaceattrr  r;   s        r@   r   zCClassPropertiesAndMethods.test_slots_special2.<locals>.Meta.__new__S  s&    dI.wsD%CCrA   rq  r  r;   s   @r@   Metaro  R  s    D DrA   rt  c                       e Zd Zd Zy)9ClassPropertiesAndMethods.test_slots_special2.<locals>.C1c                     d| _         y rf  )rU   r   s    r@   r5   zBClassPropertiesAndMethods.test_slots_special2.<locals>.C1.__init__X  s	    rA   NrF  r   rA   r@   r   rv  W  rW  rA   r   c                   $     e Zd ZdgZ fdZ xZS )9ClassPropertiesAndMethods.test_slots_special2.<locals>.C2rr  c                 "    t         |           y r   ro  r5   )r;   r  s    r@   r5   zBClassPropertiesAndMethods.test_slots_special2.<locals>.C2.__init__\  s     "rA   )r   r   r   r   r5   rr  r  s   @r@   r  ry  Z  s    ()I# #rA   r  rr  )r=  rr  r   c                       e Zd ZdZdgZy)9ClassPropertiesAndMethods.test_slots_special2.<locals>.C3r   rr  N)r   r   r   rr  r   r   rA   r@   r  r~  f  s     ",-	rA   r  c                       e Zd ZdgZy)9ClassPropertiesAndMethods.test_slots_special2.<locals>.Q1r   Nr  r   rA   r@   Q1r  j  s
    '(IrA   r  r   qc                        e Zd Z e       ZdgZy)9ClassPropertiesAndMethods.test_slots_special2.<locals>.Q2r   N)r   r   r   rZ  r   r   rA   r@   Q2r  t  s    %x+,	rA   r  )rH   r
  rJ   r7  MemberDescriptorTyperF   rU   r  rr  r  r   r   )	r;   rt  r   r  rY   r  r  r  r  s	   `        r@   test_slots_special2z-ClassPropertiesAndMethods.test_slots_special2P  sj   	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>.MyABCrC   Nr  r   rA   r@   MyABCr  |  rJ  rA   r  r<  c                       e Zd Zy)BClassPropertiesAndMethods.test_slots_descriptor.<locals>.UnrelatedNrG  r   rA   r@   	Unrelatedr    rI  rA   r  rl   )	r   ABCMetarZ  registerr
  r  r   rC   __set__)r;   r   r  r  us        r@   test_slots_descriptorz/ClassPropertiesAndMethods.test_slots_descriptorx  sd     		ckk 		 	y!Ka' 	)UWW__a;rA   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>.DNrG  r   rA   r@   rH  r    rI  rA   rH  c                       e Zd Zy)2ClassPropertiesAndMethods.test_dynamics.<locals>.ENrG  r   rA   r@   r  r    rI  rA   r  c                       e Zd Zy)2ClassPropertiesAndMethods.test_dynamics.<locals>.FNrG  r   rA   r@   r  r    rI  rA   r  rg   c                       e Zd Zy)2ClassPropertiesAndMethods.test_dynamics.<locals>.CNrG  r   rA   r@   r   r    rI  rA   r   foobarrh   c                      yrf  r   r   s    r@   <lambda>z9ClassPropertiesAndMethods.test_dynamics.<locals>.<lambda>  s    rA   r   c                      y)NC()r   r   s    r@   r  z9ClassPropertiesAndMethods.test_dynamics.<locals>.<lambda>  s    %rA   r  c                      yr"  r   r   s    r@   r  z9ClassPropertiesAndMethods.test_dynamics.<locals>.<lambda>  s    rA   r   r   c                     |dk(  ryt         Nr   r  r;   r>   s     r@   	mygetattrz:ClassPropertiesAndMethods.test_dynamics.<locals>.mygetattr  s    v~  rA   r   c                 F    |dk(  rt         t        j                  | ||      S r  )r  rZ  r%  )r;   r>   r  s      r@   	mysetattrz:ClassPropertiesAndMethods.test_dynamics.<locals>.mysetattr  s$    v~$$%%dD%88rA   znot spamc                       e Zd Zyr  rG  r   rA   r@   rH  z2ClassPropertiesAndMethods.test_dynamics.<locals>.D  rI  rA   c                       e Zd Zy)2ClassPropertiesAndMethods.test_dynamics.<locals>.INrG  r   rA   r@   Ir    rI  rA   r  rC   aarl   r   c                       e Zd Zy)AClassPropertiesAndMethods.test_dynamics.<locals>.dynamicmetaclassNrG  r   rA   r@   dynamicmetaclassr    rI  rA   r  c                       e Zd Zy):ClassPropertiesAndMethods.test_dynamics.<locals>.someclassNrG  r   rA   r@   	someclassr    rI  rA   r  r<  )rZ  r   rF   r  r  methodr   r   rM  r.   __getattr__r   newr%  r  r  rH   r  )r;   rH  r  r  r   rC   r  r  rN   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>.CNrG  r   rA   r@   r   r    r  rA   r   z5inheritance from both list and dict should be illegalc                       e Zd Zyr  rG  r   rA   r@   r   z0ClassPropertiesAndMethods.test_errors.<locals>.C  r  rA   z+inheritance from non-type should be illegalc                       e Zd Zy)6ClassPropertiesAndMethods.test_errors.<locals>.ClassicNrG  r   rA   r@   Classicr    rI  rA   r  c                       e Zd Zyr  rG  r   rA   r@   r   z0ClassPropertiesAndMethods.test_errors.<locals>.C  r  rA   z,inheritance from CFunction should be illegalc                       e Zd ZdZyr  rg   Nr  r   rA   r@   r   z0ClassPropertiesAndMethods.test_errors.<locals>.C  s    	rA   z__slots__ = 1 should be illegalc                       e Zd ZdgZyr  r  r   rA   r@   r   z0ClassPropertiesAndMethods.test_errors.<locals>.C  s	    C	rA   z!__slots__ = [1] should be illegalc                       e Zd Zy)1ClassPropertiesAndMethods.test_errors.<locals>.M1NrG  r   rA   r@   rQ  r    rI  rA   rQ  c                       e Zd Zy)1ClassPropertiesAndMethods.test_errors.<locals>.M2NrG  r   rA   r@   rc  r    rI  rA   rc  c                       e Zd Zy)1ClassPropertiesAndMethods.test_errors.<locals>.A1NrG  r   rA   r@   A1r    rI  rA   r  r<  c                       e Zd Zy)1ClassPropertiesAndMethods.test_errors.<locals>.A2NrG  r   rA   r@   A2r    rI  rA   r  c                       e Zd Zy)0ClassPropertiesAndMethods.test_errors.<locals>.BNrG  r   rA   r@   r  r    r  rA   r  z5finding the most derived metaclass should have failed)r7   r   r   r   rZ  rH   r  )r;   r   r  rQ  rc  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   rC   s    r@   r   z:ClassPropertiesAndMethods.test_classmethods.<locals>.C.foo      rA   Nr   r   r   r   r  goor   rA   r@   r   r  
      !c"CrA   r   rg   c                       e Zd Zy)6ClassPropertiesAndMethods.test_classmethods.<locals>.DNrG  r   rA   r@   rH  r    rI  rA   rH  c                 
    | |fS )f docstringr   )r   args     r@   fz6ClassPropertiesAndMethods.test_classmethods.<locals>.f  s    :rA   r   r   r  z)classmethod shouldn't accept keyword argsr  r  )__annotations__r  r   r   r   r  )rZ  rF   r  r   r  r_  r.   __self__ro  r  r   r   r   HAVE_DOCSTRINGSr   r   rJ   r  r  )r;   r   rY   rH  rN   r  ffrM   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   r5   assertAlmostEqual)r;   r  r  refs_beforer   s        r@   %test_refleaks_in_classmethod___init__z?ClassPropertiesAndMethods.test_refleaks_in_classmethod___init__F  s`    "006HI&(sAKK /1K?"MrA   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   rk   r   {   	classmethc                       e Zd Zy)AClassPropertiesAndMethods.test_classmethods_in_c.<locals>.SubSpamNrG  r   rA   r@   SubSpamr  c  r  rA   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  rF   rJ   r  r   r9  	exceptionr7   r_  )r;   r   rC   rN   r  r  d1spam_cmx2r  d2r  r  expected_errmsgs                 r@   test_classmethods_in_cz0ClassPropertiesAndMethods.test_classmethods_in_cO  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  rA   N)r   r   r   r   rb  r  r   rA   r@   r   r    s    !s#CrA   r   rg   )rg   c                       e Zd Zy)7ClassPropertiesAndMethods.test_staticmethods.<locals>.DNrG  r   rA   r@   rH  r    rI  rA   rH  r  r   )r  r  r  )rZ  rF   r  r   rb  rJ   r  r  )r;   r   rY   rH  rN   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#&rA   c                     t        j                  t        d      }t        d       } |       }t	        d      D ]  }|j                  d         | j                   |       |z
  dd       y r  )r   r  r   rb  r   r5   r  )r;   r  r  r  r   s        r@   &test_refleaks_in_staticmethod___init__z@ClassPropertiesAndMethods.test_refleaks_in_staticmethod___init__  s`    "006HI$&(sAKK /1K?"MrA   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   rk   r   r  )r   r   
staticmethrF   )r;   r   rC   rN   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rA   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  rA   Nr  r   rA   r@   r   r    r  rA   r   rg   c                       e Zd Zy)1ClassPropertiesAndMethods.test_classic.<locals>.DNrG  r   rA   r@   rH  r    rI  rA   rH  c                   (    e Zd ZW  j                  Zy)1ClassPropertiesAndMethods.test_classic.<locals>.ENr   rG  s   r@   r  r        %%CrA   r  <bound method )rF   r  r   __func__r  r   r_  r]  )r;   rY   rH  rN   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NrA   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@   r5   zNClassPropertiesAndMethods.test_compattr.<locals>.C.computed_attribute.__init__  s    !$DJ!$DJ$*DMrA   c                 $    | j                  |      S r   )r  )r;   objrH   s      r@   r_  zMClassPropertiesAndMethods.test_compattr.<locals>.C.computed_attribute.__get__  s    ::c?*rA   c                 &    | j                  ||      S r   )r   r;   r$  r  s      r@   r  zMClassPropertiesAndMethods.test_compattr.<locals>.C.computed_attribute.__set__  s    ::c511rA   c                 $    | j                  |      S r   )r!  r;   r$  s     r@   
__delete__zPClassPropertiesAndMethods.test_compattr.<locals>.C.computed_attribute.__delete__  s    ==--rA   r  r   )r   r   r   r5   r_  r  r)  r   rA   r@   computed_attributer    s    ++2.rA   r*  c                     d| _         y r   _C__xr   s    r@   r5   z;ClassPropertiesAndMethods.test_compattr.<locals>.C.__init__  	    rA   c                 2    | j                   }|dz   | _         |S r   r,  r  s     r@   __get_xz:ClassPropertiesAndMethods.test_compattr.<locals>.C.__get_x  s    HHQ3rA   c                     || _         y r   r,  r  s     r@   __set_xz:ClassPropertiesAndMethods.test_compattr.<locals>.C.__set_x  r.  rA   c                     | ` y r   r,  r   s    r@   
__delete_xz=ClassPropertiesAndMethods.test_compattr.<locals>.C.__delete_x      HrA   N)
r   r   r   rZ  r*  r5   	_C__get_x	_C__set_x_C__delete_xr  r   rA   r@   r   r    s0    
.V 
."7GZ@ArA   r   r   rg   r     r  )rZ  rF   r  r  r-  s      r@   test_compattrz'ClassPropertiesAndMethods.test_compattr  s    	A 	A. Ca a b!b!Ca%rA   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   )r7   r   r   r   r;   s     r@   r   z:ClassPropertiesAndMethods.test_newslots.<locals>.C.__new__  s    ||C(rA   c                 ,    | j                   dz   | _         y Nrh   r   r   s    r@   r5   z;ClassPropertiesAndMethods.test_newslots.<locals>.C.__init__  s    88a<rA   Nr   r   r   r   r5   r   rA   r@   r   r=    s    (rA   r   rl   c                       e Zd Zy)2ClassPropertiesAndMethods.test_newslots.<locals>.DNrG  r   rA   r@   rH  rE    rI  rA   rH  )r7   rF   r   r  )r;   r   rC   rH  rU   s        r@   test_newslotsz'ClassPropertiesAndMethods.test_newslots  sz    	( 	( C"a(	 	C"a(rA   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   r7   r   r   rA   r@   r   rJ    s    llGrA   r   c                   $    e Zd Zej                  ZyrI  )r   r   r   rZ  r   r   rA   r@   r   z1ClassPropertiesAndMethods.test_bad_new.<locals>.C  s    nnGrA   )r  r   rZ  r   r7   r   s     r@   test_bad_newz&ClassPropertiesAndMethods.test_bad_new  s    )V^^4)V^^R8)T\\6:)V^^T:	# 	#)Q'	% 	%)Q'rA   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>.ANrG  r   rA   r@   rw  rO  
  rI  rA   rw  r   c                       e Zd Zd Zy)rO  c                     || _         y r   rB  r;   r   s     r@   r5   z=ClassPropertiesAndMethods.test_object_new.<locals>.A.__init__  	    rA   NrF  r   rA   r@   rw  z4ClassPropertiesAndMethods.test_object_new.<locals>.A      rA   rl   c                       e Zd Zd Zy)rO  c                 ,    t         j                  |       S r   rZ  r   r   r   s     r@   r   z<ClassPropertiesAndMethods.test_object_new.<locals>.A.__new__      ~~c**rA   NrP  r   rA   r@   rw  z4ClassPropertiesAndMethods.test_object_new.<locals>.A  s    +rA   c                       e Zd Zd Zd Zy)rO  c                 ,    t         j                  |       S r   rW  rX  s     r@   r   z<ClassPropertiesAndMethods.test_object_new.<locals>.A.__new__"  rY  rA   c                     || _         y r   rB  rR  s     r@   r5   z=ClassPropertiesAndMethods.test_object_new.<locals>.A.__init__$  rS  rA   NrC  r   rA   r@   rw  z4ClassPropertiesAndMethods.test_object_new.<locals>.A!  s    +rA   )rZ  r   r  r   r5   r;   rw  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>rA   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__.  s    $$rA   NrP  r   rA   r@   rw  ra  -      %rA   rw  c                   *    e Zd Zej                  Zd Zy)=ClassPropertiesAndMethods.test_restored_object_new.<locals>.Bc                     || _         y r   rB  rR  s     r@   r5   zFClassPropertiesAndMethods.test_restored_object_new.<locals>.B.__init__3  rS  rA   N)r   r   r   rZ  r   r5   r   rA   r@   r  rg  1  s    nnGrA   r  errorrl   )rZ  r  rd  warningscatch_warningssimplefilterDeprecationWarningrF   r   r  r   )r;   rw  r  rU   s       r@   test_restored_object_newz2ClassPropertiesAndMethods.test_restored_object_new+  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rv  r   r   s    r@   r  z2ClassPropertiesAndMethods.test_altmro.<locals>.A.fF      rA   Nr   r   r   r  r   rA   r@   rw  rq  E  r   rA   rw  c                       e Zd Zy)0ClassPropertiesAndMethods.test_altmro.<locals>.BNrG  r   rA   r@   r  rv  G  rI  rA   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.fJ  rs  rA   Nrt  r   rA   r@   r   rx  I  r   rA   r   c                       e Zd Zy)0ClassPropertiesAndMethods.test_altmro.<locals>.DNrG  r   rA   r@   rH  r{  K  rI  rA   rH  c                       e Zd Zd Zy)?ClassPropertiesAndMethods.test_altmro.<locals>.PerverseMetaTypec                 P    t         j                  |       }|j                          |S r   )rH   mroreverse)r   Ls     r@   r  zCClassPropertiesAndMethods.test_altmro.<locals>.PerverseMetaType.mroX  s    HHSM		rA   Nr   r   r   r  r   rA   r@   PerverseMetaTyper}  W  s    rA   r  c                       e Zd Zy0ClassPropertiesAndMethods.test_altmro.<locals>.XNrG  r   rA   r@   r  r  \  rI  rA   r  r<  c                       e Zd Zd Zy)9ClassPropertiesAndMethods.test_altmro.<locals>._metaclassc                     | t         t        gS r   )r   rZ  r   s    r@   r  z=ClassPropertiesAndMethods.test_altmro.<locals>._metaclass.mroc  s     $//rA   Nr  r   rA   r@   rC  r  b  s    0rA   rC  c                       e Zd Zyr  rG  r   rA   r@   r  z0ClassPropertiesAndMethods.test_altmro.<locals>.Xe  r  rA   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.mrov  s	    3JrA   Nr  r   rA   r@   rC  z9ClassPropertiesAndMethods.test_altmro.<locals>._metaclassu  s    rA   c                       e Zd Zyr  rG  r   rA   r@   r  z0ClassPropertiesAndMethods.test_altmro.<locals>.Xx  r  rA   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    rA   Nr  r   rA   r@   rC  z9ClassPropertiesAndMethods.test_altmro.<locals>._metaclass  s    rA   c                       e Zd Zyr  rG  r   rA   r@   r  z0ClassPropertiesAndMethods.test_altmro.<locals>.X  r  rA   z$non-sequence mro() return not caught)	rZ  rF   r  rY  r  rH   r   r   r   )	r;   rw  r  r   rH  r  r  rC  r  s	            r@   test_altmroz%ClassPropertiesAndMethods.test_altmroC  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   rA   r@   r  r    s    JrA   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   rI   r  r  s     r@   r  zAClassPropertiesAndMethods.test_overloading.<locals>.C.__getattr__  s    5=%t,,((rA   c                 H    |dk(  r
||f| _         y j                  | ||      S Nr   )r^  r%  )r;   r>   r  r  s      r@   r%  zAClassPropertiesAndMethods.test_overloading.<locals>.C.__setattr__  s(    5=$(%=DL==tU;;rA   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4rA   c                 
    d|fS )Ngetitemr   r  s     r@   rq   zAClassPropertiesAndMethods.test_overloading.<locals>.C.__getitem__  s    !3''rA   c                     ||f| _         y r   )setitem)r;   r  r  s      r@   r   zAClassPropertiesAndMethods.test_overloading.<locals>.C.__setitem__  s     #U|rA   c                     || _         y r   )delitemr  s     r@   __delitem__zAClassPropertiesAndMethods.test_overloading.<locals>.C.__delitem__  s	    "rA   N)	r   r   r   r  r%  r(  rq   r   r  )r  s   r@   r   r    s!    )
<
5(,#rA   r   r*  r   )r   r   r   )r  r      )r   r  r   r  r  )rZ  rF   r   r^  r'  r  r  rZ   )r;   r   rC   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\3rA   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 Nrm  )r.   lstripr;   rr  s     r@   r  zRClassPropertiesAndMethods.test_load_attr_extended_arg.<locals>.Numbers.__getattr__  s    4;;s+,,rA   Nr   r   r   r  r   rA   r@   Numbersr    s    -rA   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   )r/  r   r^   rF   r7   )r;   r  attrscoder  r  rm  s          r@   test_load_attr_extended_argz5ClassPropertiesAndMethods.test_load_attr_extended_arg  sz    	- 	- 		<s<<4UG2>T2.)rA\')4d5:6FG rA   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@   r5   z:ClassPropertiesAndMethods.test_methods.<locals>.C.__init__  	    rA   c                     | j                   S r   r  r   s    r@   r   z5ClassPropertiesAndMethods.test_methods.<locals>.C.foo  s    vvrA   N)r   r   r   r5   r   r   rA   r@   r   r    s    rA   r   rg   c                   B    e Zd ZW  j                  ZW j                  Zy)1ClassPropertiesAndMethods.test_methods.<locals>.DN)r   r   r   r   rc  r  )r   c1s   r@   rH  r    s    %%C&&CrA   rH  rh   c                   (    e Zd ZW  j                  Zy)1ClassPropertiesAndMethods.test_methods.<locals>.ENr   rG  s   r@   r  r    r  rA   r  r  )
rZ  rF   r   rc  r  r  r  r   r_  r]  )r;   rH  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OrA   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   rF   r  r<   r_  )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    KrA   c                      y)Ns   hellor   r   s    r@   rI  zCClassPropertiesAndMethods.test_special_method_lookup.<locals>.hello  s    rA   c                     g S r   r   r   s    r@   	empty_seqzGClassPropertiesAndMethods.test_special_method_lookup.<locals>.empty_seq   s    IrA   c                      yr   r   r   s    r@   zerozBClassPropertiesAndMethods.test_special_method_lookup.<locals>.zero  s    rA   c                      y)N              ?r   r   s    r@   complex_numzIClassPropertiesAndMethods.test_special_method_lookup.<locals>.complex_num  s    rA   c                     t         r   )StopIterationr   s    r@   r%  zBClassPropertiesAndMethods.test_special_method_lookup.<locals>.stop  s    rA   c                      y)NTr   )r;   things     r@   return_truezIClassPropertiesAndMethods.test_special_method_lookup.<locals>.return_true  s    rA   c                 "    t        t        |       S r   )r#  r.   r$  s    r@   do_isinstancezKClassPropertiesAndMethods.test_special_method_lookup.<locals>.do_isinstance
      c3''rA   c                 "    t        t        |       S r   )r  r.   r  s    r@   do_issubclasszKClassPropertiesAndMethods.test_special_method_lookup.<locals>.do_issubclass  r  rA   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>.DictSubNrG  r   rA   r@   DictSubr    r  rA   r  hiro   )r  r   rF   )checkerr  r;   s     r@   do_dict_missingzMClassPropertiesAndMethods.test_special_method_lookup.<locals>.do_dict_missing  s-    '++T WYt_a0rA   c                 *    j                  |d       y)Nr  ro   rF   )rD  r  r;   s     r@   some_numberzIClassPropertiesAndMethods.test_special_method_lookup.<locals>.some_number  s    S$'rA   c                       y r   r   r<   s    r@   swallowzEClassPropertiesAndMethods.test_special_method_lookup.<locals>.swallow  s    DrA   c                      yNrI  r   )r;   specs     r@   format_implzIClassPropertiesAndMethods.test_special_method_lookup.<locals>.format_impl  s    rA   	__bytes____reversed____length_hint__)r   __next__
__sizeof____instancecheck____missing__r|  __subclasscheck__rK   	__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;   rr  tests      r@   r  zQClassPropertiesAndMethods.test_special_method_lookup.<locals>.Checker.__getattr__3  s    		7>>tDErA   c                 x    |vr |j                  dj                  |             t        j                  | |      S )Nz __getattribute__ called with {0})r   r  rZ  r!  )r;   rr  r	  oks      r@   r!  zVClassPropertiesAndMethods.test_special_method_lookup.<locals>.Checker.__getattribute__5  s5    r>II@GGMN..tT::rA   Nr   r   r   r  r!  )r  r;   s   r@   Checkerr  2  s    -1 F26 ;rA   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@   r5   zSClassPropertiesAndMethods.test_special_method_lookup.<locals>.SpecialDescr.__init__:  	     	rA   c                 ^    j                  d       | j                  j                  ||      S r   )r   r  r_  )r;   r$  ownerrecords      r@   r_  zRClassPropertiesAndMethods.test_special_method_lookup.<locals>.SpecialDescr.__get__<  s&    a yy((e44rA   N)r   r   r   r5   r_  )r  s   r@   SpecialDescrr  9  s    !5rA   r  c                       e Zd Zy)IClassPropertiesAndMethods.test_special_method_lookup.<locals>.MyExceptionNrG  r   rA   r@   MyExceptionr  ?  rI  rA   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@   r_  zNClassPropertiesAndMethods.test_special_method_lookup.<locals>.ErrDescr.__get__B  s	    !!rA   Nr   r   r   r_  )r  s   r@   ErrDescrr  A      "rA   r  c                       e Zd Zy?ClassPropertiesAndMethods.test_special_method_lookup.<locals>.XNrG  r   rA   r@   r  r"  F  r  rA   r  c                       e Zd Zyr!  rG  r   rA   r@   r  z?ClassPropertiesAndMethods.test_special_method_lookup.<locals>.XN  r  rA   rg   c                       e Zd Zyr!  rG  r   rA   r@   r  z?ClassPropertiesAndMethods.test_special_method_lookup.<locals>.XV  r  rA   r   )r  r  reversedr7   r   	getsizeofr   r  mathfloortruncceildirroundrZ  	Exceptionr8   r^  rF   r  )r;   r  r  rI  r  r  r  r%  r  r  r  r  r  r  r  specialsr  r  r  r>   runner	meth_implenvr  rr  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,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- 19rA   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@   rq   z>ClassPropertiesAndMethods.test_specials.<locals>.C.__getitem__c      ;B;q;  j rA   Nr'  r   rA   r@   r   r5  b      !rA   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         r7  r8  r&  s     r@   rq   z>ClassPropertiesAndMethods.test_specials.<locals>.D.__getitem__z  r:  rA   Nr'  r   rA   r@   rH  r=  y  r;  rA   rH  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@   r5   z?ClassPropertiesAndMethods.test_specials.<locals>.Proxy.__init__  r  rA   c                     | j                     S r   r  r   s    r@   r   z?ClassPropertiesAndMethods.test_specials.<locals>.Proxy.__bool__  s    #vv:~%rA   c                 ,    t        | j                        S r   )hashr  r   s    r@   __hash__z?ClassPropertiesAndMethods.test_specials.<locals>.Proxy.__hash__  s    DFF|#rA   c                      | j                   |k(  S r   r  r   s     r@   r=  z=ClassPropertiesAndMethods.test_specials.<locals>.Proxy.__eq__      vv&rA   c                      | j                   |k7  S r   r  r   s     r@   __ne__z=ClassPropertiesAndMethods.test_specials.<locals>.Proxy.__ne__  rG  rA   c                      | j                   |k\  S r   r  r   s     r@   __ge__z=ClassPropertiesAndMethods.test_specials.<locals>.Proxy.__ge__  rG  rA   c                      | j                   |kD  S r   r  r   s     r@   __gt__z=ClassPropertiesAndMethods.test_specials.<locals>.Proxy.__gt__      vv~%rA   c                      | j                   |k  S r   r  r   s     r@   __le__z=ClassPropertiesAndMethods.test_specials.<locals>.Proxy.__le__  rG  rA   c                      | j                   |k  S r   r  r   s     r@   __lt__z=ClassPropertiesAndMethods.test_specials.<locals>.Proxy.__lt__  rN  rA   c                      d| j                   z  S )NzProxy:%sr  r   s    r@   r   z>ClassPropertiesAndMethods.test_specials.<locals>.Proxy.__str__  s    !DFF**rA   c                      d| j                   z  S )Nz	Proxy(%r)r  r   s    r@   r   z?ClassPropertiesAndMethods.test_specials.<locals>.Proxy.__repr__  s    "TVV++rA   c                     || j                   v S r   r  r  s     r@   rn   zCClassPropertiesAndMethods.test_specials.<locals>.Proxy.__contains__  s    &rA   N)r   r   r   r5   r   rE  r=  rI  rK  rM  rP  rR  r   r   rn   r   rA   r@   Proxyr@    s>    &$'''&'&+,'rA   rV  rg   zProxy:0zProxy(0))rZ  r  r  idrD  rF   r  assertGreaterEqualr9  findr   assertNotInr   r  )r;   r   r  c2r   rH  r  r  rV  p0p1p_1p10s                r@   test_specialsz'ClassPropertiesAndMethods.test_specials]  si   
	! 	! 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!rA   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>.CNrG  r   rA   r@   r   rc    rI  rA   r   c                       e Zd ZdgZy)7ClassPropertiesAndMethods.test_weakrefs.<locals>.NoWeakr   Nr  r   rA   r@   NoWeakre    s	    IrA   rf  z!weakref.ref(no) should be illegalzweak referencec                       e Zd ZddgZy)5ClassPropertiesAndMethods.test_weakrefs.<locals>.Weakr   rb  Nr  r   rA   r@   Weakrh    s    .IrA   ri  )
weakrefrZ  refrF   r   rR  r   r   r  r9  )
r;   rj  r   rY   rrf  nor  ri  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  rA   c                     || _         y r   r,  r  s     r@   setxz9ClassPropertiesAndMethods.test_properties.<locals>.C.setx  r  rA   c                     | ` y r   r,  r   s    r@   delxz9ClassPropertiesAndMethods.test_properties.<locals>.C.delx  r5  rA   I'm the x property.docN)r   r   r   rt  rv  rx  r  r  r   rA   r@   r   rr    s"     !tT/DEArA   r   r  r   r-  r   r  fgetfsetfdelry  rt  rv  rx  )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   )rX  s    r@   r  z=ClassPropertiesAndMethods.test_properties.<locals>.D.<lambda>	  s    QqSrA   N)r   r   r   r  rq   r   rA   r@   rH  r  	  s    "=1KrA   rH  z,expected ZeroDivisionError from bad property)rZ  r  r  rF   r-  r  r_  r)  rJ   r
  r  r+  r  r  r  r|  r}  r~  r^  r   r  r9  rY  ZeroDivisionError)
r;   r   rC   rawr  rr  r  rH  rN   r   s
             r@   test_propertiesz)ClassPropertiesAndMethods.test_properties  sw   	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*D7T2& 		 /156 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rh   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    rA   c                      y)zsetter methodNr   )rD  r  s     r@   setterzFClassPropertiesAndMethods.test_properties_doc_attrib.<locals>.E.setter$	      rA   r  )r}  N)
r   r   r   r  r  r  proprF   r  prop2r   s   r@   r  r   	  sK     F#DT\\?;&)EU]]D1rA   r  rZ  )r;   r  s   ` r@   test_properties_doc_attribz4ClassPropertiesAndMethods.test_properties_doc_attrib	  s    
	2 
	2rA   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  4	  s    Y::;rA   r  )r  rZ  ImportError)r;   r  r  s     @r@   test_testcapi_no_segfaultz3ClassPropertiesAndMethods.test_testcapi_no_segfault,	  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>.CrI  rz  c                     | j                   S r   _foor   s    r@   r   z=ClassPropertiesAndMethods.test_properties_plus.<locals>.C.foo:	      yy rA   c                 $    t        |      | _        y r   r,   r  r  s     r@   r   z=ClassPropertiesAndMethods.test_properties_plus.<locals>.C.foo=	      J	rA   c                     | ` y r   r  r   s    r@   r   z=ClassPropertiesAndMethods.test_properties_plus.<locals>.C.foo@	      IrA   N)r   r   r   r  r   r  r  deleterr   rA   r@   r   r  8	  sN    w'CZZ! !ZZ' '[[ rA   r   rI  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.fooO	  s    	% s    	N)r   r   r   r   r  rG  s   r@   rH  r  N	  s    UU]] rA   rH  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.foo\	  r  rA   c                     t         r   )RuntimeErrorr  s     r@   r   z=ClassPropertiesAndMethods.test_properties_plus.<locals>.E.foo_	  s    ""rA   c                 $    t        |      | _        y r   r  r  s     r@   r   z=ClassPropertiesAndMethods.test_properties_plus.<locals>.E.foob	  r  rA   Nc                     | ` y r   r  r  s     r@   r   z=ClassPropertiesAndMethods.test_properties_plus.<locals>.E.fooe	  r  rA   r   )r   r   r   r  r   r  r  r   rA   r@   r  r  [	  sV    ! !ZZ# #ZZ' '[[ rA   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.fooo	  r  rA   c                 &    t        d|      | _        y r   )maxr  r  s     r@   r   z=ClassPropertiesAndMethods.test_properties_plus.<locals>.F.foor	  s    5M	rA   N)r   r   r   r   r  r  )r  s   r@   r  r  n	  s3    UU]] ZZ* *rA   r  r   )rZ  rF   r   r  r  rk  r  )	r;   rY   rH  rN   r5  r  r  r   r  s	          @@r@   test_properties_plusz.ClassPropertiesAndMethods.test_properties_plus7	  sH   
	 
	 C0a'1f%$#Ea(a'	 	 C#EE	 	 C#E	* 	* C"ErA   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)#Nrh   rU   )rg   rC   rg   )onetwor  )r  )r  rh   )r  )r  r   )r  r+  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>.Mappingrh   ro   r  )rg   rl   rC   N)r   r   r   r   r   rA   r@   Mappingr  	  s    1"%DrA   r  z*no TypeError from dict(incomplete mapping)c                 H    t        | j                  j                               S r   )r7   r   r   r   s    r@   r  zBClassPropertiesAndMethods.test_dict_constructors.<locals>.<lambda>	  s    D)9$:rA   c                      | j                   |   S r   )r   r&  s     r@   r  zBClassPropertiesAndMethods.test_dict_constructors.<locals>.<lambda>	  s    diilrA   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@   r5   zSClassPropertiesAndMethods.test_dict_constructors.<locals>.AddressBookEntry.__init__	  s    "
 	rA   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4rA   N)r   r   r   r5   r   r   rA   r@   AddressBookEntryr  	  s    !5rA   r  TimWarsawBarryPeters)r  r  ro   r   )tooshort)toolongzby 1zno ValueError from dict(%r)r   )r   rF   r7   r8   r   r   r   
ValueErrorr  r   rq   zipr   )r;   rN   badargr  r  r   bads          r@   test_dict_constructorsz0ClassPropertiesAndMethods.test_dict_constructorsz	  s5   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$.FAV 		6?@ /  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!=Hq1ac(H!=>? "?%<$==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;   rh   y               @g       @2   2)rh   c                 P    | D cg c]  }|j                  d      r| c}S c c}w r  )r]  )stringsrX  s     r@   interestingz7ClassPropertiesAndMethods.test_dir.<locals>.interesting	  s%    &@w!all3.?Aw@@@s   ##c                       e Zd ZdZd Zy)-ClassPropertiesAndMethods.test_dir.<locals>.Crg   c                      y r   r   r   s    r@   Cmethodz5ClassPropertiesAndMethods.test_dir.<locals>.C.Cmethod	      trA   N)r   r   r   Cdatar  r   rA   r@   r   r  	  
    E#rA   r   r  r  c                      yr   r   r   s    r@   r  z4ClassPropertiesAndMethods.test_dir.<locals>.<lambda>	      rA   cdatacmethodc                       e Zd ZdZd Zy)-ClassPropertiesAndMethods.test_dir.<locals>.Arg   c                      y r   r   r   s    r@   Amethodz5ClassPropertiesAndMethods.test_dir.<locals>.A.Amethod	  r  rA   N)r   r   r   Adatar  r   rA   r@   rw  r  	  r  rA   rw  r  r  r   c                      y)Nrl   r   r   s    r@   r  z4ClassPropertiesAndMethods.test_dir.<locals>.<lambda>	  r  rA   adataamethodc                       e Zd Zy)-ClassPropertiesAndMethods.test_dir.<locals>.MNrG  r   rA   r@   Mr  	  rI  rA   r  rP   rg   )r   r  __package__
__loader____spec__rC   rU   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    $rA   N)r   r   r   r  r  rJ   r   rA   r@   rc  r  
  s    %(HrA   rc  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@   r5   z<ClassPropertiesAndMethods.test_dir.<locals>.Wrapper.__init__
  	     
rA   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7rA   c                 .     | j                   |         S r   r  )r;   r  Wrappers     r@   rq   z?ClassPropertiesAndMethods.test_dir.<locals>.Wrapper.__getitem__
  s    tzz#//rA   c                 ,    t        | j                        S r   )r  r   r   s    r@   ry   z;ClassPropertiesAndMethods.test_dir.<locals>.Wrapper.__len__
  s    4::&rA   c                 <     t        | j                  |            S r   )rI   r   )r;   r>   r  s     r@   r  z?ClassPropertiesAndMethods.test_dir.<locals>.Wrapper.__getattr__
  s    wtzz4899rA   N)r   r   r   r5   r   rq   ry   r  r  s   r@   r  r  
  s    !80':rA   r  c                   (    e Zd Z fdZ ee      Zy)r  c                 &     t        |             S r   )rH   )r;   r  s    r@   
__getclassz8ClassPropertiesAndMethods.test_dir.<locals>.C.__getclass
  s    tDz**rA   N)r   r   r   _C__getclassr  r  r  s   r@   r   z-ClassPropertiesAndMethods.test_dir.<locals>.C
  s    + ,IrA   )rF   r+  rH   test_dirrZ  r  r  r  r  r   rU   rC   rJ   r  r   Ellipsis)r;   r  r  r  r   cstuffrY   rw  astuffrC   r  	minstancedefault_attributesr  namesrc  
m2instancer  s                    @r@   r  z"ClassPropertiesAndMethods.test_dir	  so    01 aS1#sD$1tT]]RCH S
	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JNqa7I.IN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;   rC   s     r@   rM   z5ClassPropertiesAndMethods.test_supers.<locals>.A.meth)
  s    {"rA   Nry  r   rA   r@   rw  r  (
      #rA   rw  rg   zA(1)c                   (     e Zd Z fdZd Z xZS )0ClassPropertiesAndMethods.test_supers.<locals>.Bc                 (    t        |       | _        y r   )ro  r  )r;   r  r  s    r@   r5   z9ClassPropertiesAndMethods.test_supers.<locals>.B.__init__/
  s    $Q~rA   c                 D    d|z  | j                   j                  |      z   S )NzB(%r)r  r  s     r@   rM   z5ClassPropertiesAndMethods.test_supers.<locals>.B.meth1
       {T\\%6%6q%999rA   )r   r   r   r5   rM   rr  )r  r  s   @r@   r  r  .
  s    .:rA   r  rh   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@   rM   z5ClassPropertiesAndMethods.test_supers.<locals>.C.meth7
  r  rA   Nry  r   rA   r@   r   r   6
  s    :rA   r   rl   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))ro  rM   )r;   rC   rH  r  s     r@   rM   z5ClassPropertiesAndMethods.test_supers.<locals>.D.meth>
  s    {U1d%8%;;;rA   )r   r   r   rM   rr  )r  rH  s   @r@   rH  r#  =
      < <rA   rH  ro   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@   r5   z?ClassPropertiesAndMethods.test_supers.<locals>.mysuper.__init__F
  s    Wd4d;;rA   )r   r   r   r5   rr  )r  r)  s   @r@   r)  r'  E
  r%  rA   r)  c                       e Zd Z fdZy)0ClassPropertiesAndMethods.test_supers.<locals>.Ec                 @    d|z   |       j                  |      z   S )NzE(%r))rM   )r;   rC   r  r)  s     r@   rM   z5ClassPropertiesAndMethods.test_supers.<locals>.E.methJ
  s$    {WQ%5%:%:1%===rA   Nry  )r  r)  s   r@   r  r+  I
  s    >rA   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   rM   )r;   rC   rX  s      r@   rM   z5ClassPropertiesAndMethods.test_supers.<locals>.F.methP
  s-    LL&')=)=>JJrA   Nry  r   rA   r@   r  r.  O
  s    KrA   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rf  r   r   s    r@   rt  z:ClassPropertiesAndMethods.test_supers.<locals>.DDbase.getxy
  s    2rA   Nr   r   r   rt  r  r  r   rA   r@   DDbaser3  x
  s    %ArA   r6  c                   "    e Zd Zd Z ee      Zy)4ClassPropertiesAndMethods.test_supers.<locals>.DDsubc                      yr  r   r   s    r@   rt  z9ClassPropertiesAndMethods.test_supers.<locals>.DDsub.getx}
  s    7rA   Nr5  r   rA   r@   DDsubr8  |
  s    *ArA   r:  rI  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>
  s    %rA   N)r   r   r   r  aPropr   rA   r@   Baser<  
  s    /0ErA   r?  c                   ,     e Zd Ze fd       Z xZS )2ClassPropertiesAndMethods.test_supers.<locals>.Subc                     t         |   S r   )ro  r>  )klassSubr  s    r@   r	  z7ClassPropertiesAndMethods.test_supers.<locals>.Sub.test
  s    S--rA   )r   r   r   r  r	  rr  )r  rD  s   @r@   rD  rA  
  s    . .rA   rD  r  )rZ  rF   rM   ro  r  r1  r   r   r_  r  r	  r>  r  )r;   rw  r   r  r6  r:  ddr?  r  rH  r  rD  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 rA   c                 <     t         j                  | |            S r   )r.   rj   )r;   r   hexints     r@   rj   zHClassPropertiesAndMethods.test_basic_inheritance.<locals>.hexint.__add__
  s    ckk$677rA   N)r   r   r   r   rj   )rN  s   r@   rN  rI  
  s    !8rA   rN     	   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__
  rL  rA   c                 @    | j                  t        |   |            S r   )r  ro  rj   )r;   r   r  octlongs     r@   rj   zIClassPropertiesAndMethods.test_basic_inheritance.<locals>.octlong.__add__
  s    ~~eGT&B5&IJJrA   )r   r   r   r   r   rj   r   rr  )r  rX  s   @r@   rX  rT  
  s    I!KHrA   rX  rl   r   0o10i  0o5675rg   r   c                       e Zd Zy)CClassPropertiesAndMethods.test_basic_inheritance.<locals>.longcloneNrG  r   rA   r@   	longcloner\  
  rI  rA   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@   r5   zLClassPropertiesAndMethods.test_basic_inheritance.<locals>.precfloat.__init__
  s    I	rA   c                 $    d| j                   | fz  S )Nr   r   r   s    r@   r   zLClassPropertiesAndMethods.test_basic_inheritance.<locals>.precfloat.__repr__
  s    D 111rA   N)r   r   )r   r   r   r   r5   r   r   rA   r@   	precfloatr_  
  s    I&2rA   rb  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(>>>rA   N)r   r   r   r   r   rA   r@   
madcomplexrd  
  s    ?rA   rg  ro   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   )_revr7   r  r  r;   r  s     r@   revzFClassPropertiesAndMethods.test_basic_inheritance.<locals>.madtuple.rev  sB    99(99$J		 NN1-	yy rA   r   r   r   rl  rn  r   rA   r@   madtuplerj        D!rA   rp  )
rg   rh   rl   ro   r   r   rO     rP  r   )
r   rP  rr  rO  r   r   ro   rl   rh   rg   i   )rg   rh   rl   ro   r   r   rh   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   rl  r7   r  r  r/  rm  s     r@   rn  zGClassPropertiesAndMethods.test_basic_inheritance.<locals>.madstring.rev'  J    99(99$J		 NN2771:6	yy rA   ro  r   rA   r@   	madstringrt  %  rq  rA   ry  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 rv  rw  rm  s     r@   rn  zHClassPropertiesAndMethods.test_basic_inheritance.<locals>.madunicode.revg  rx  rA   ro  r   rA   r@   
madunicoder  e  rq  rA   r  ABCDEFFEDCBAxyc                       e Zd Zy)AClassPropertiesAndMethods.test_basic_inheritance.<locals>.sublistNrG  r   rA   r@   sublistr    rI  rA   r  rI  r         r  r  )!r.   rF   r   r  r  rD  r9  r,   rJ   r/   r   r  rn  r   r/  mapr'  stripr  rstrip	translatereplaceljustr  rjustcenterlowerupper
capitalizetitler7   r   r,  )r;   rC   r]  rb  rg  baserp  r   rO   r  r   ry  rX  identitytabr  r  rN  rX  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/rA   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 argumentrg   r  rh   r   i  rf  i  r  500   abcstrict)rZ  errorsr   rl   )sequencer(  )bogus_keyword_argz4expected TypeError from bogus keyword argument to %r)rW  r   r.   r/   boolrF   r   r9  r  r   r7   r   )r;   constructors     r@   test_keywordsz'ClassPropertiesAndMethods.test_keywords  si   ##I/AB!H C##I/ABAJ C##I/AB1I Cbs3WS"5EFC%0F8<eD##I/AB58$ C##I/AB)$ C  Wc3!4)K+a0 		P)* +) CBBBBB
 CBBB  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  	canonicalrD  hashcoder  s     r@   r5   zOClassPropertiesAndMethods.test_str_subclass_as_dict_key.<locals>.cistr.__init__  s    !& $T^^ 4rA   c                 ^    t        |      s |      }| j                  |j                  k(  S r   )r#  r  )r;   r   cistrs     r@   r=  zMClassPropertiesAndMethods.test_str_subclass_as_dict_key.<locals>.cistr.__eq__	  s)    !%/!%LE~~88rA   c                     | j                   S r   )r  r   s    r@   rE  zOClassPropertiesAndMethods.test_str_subclass_as_dict_key.<locals>.cistr.__hash__  s    }}$rA   N)r   r   r   r  r5   r=  rE  )r  s   r@   r  r    s    
59
%rA   r  ABCr   aBcr  rg   r  rh   tHreerl   tWoTHrEEONethrEE)r9  rF   r  r   )r;   rN   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~.2rA   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>.classicNrG  r   rA   r@   classicr    rI  rA   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@   r5   zFClassPropertiesAndMethods.test_classic_comparisons.<locals>.C.__init__#      !$UDJrA   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@   r=  zDClassPropertiesAndMethods.test_classic_comparisons.<locals>.C.__eq__%  H    !%+#zzU[[88!%-E31G#zzU22))rA   c                     t        |      r| j                  |j                  k7  S t        |t              st        |t              r| j                  |k7  S t        S r   r  r  s     r@   rI  zDClassPropertiesAndMethods.test_classic_comparisons.<locals>.C.__ne__+  r  rA   c                     t        |      r| j                  |j                  k  S t        |t              st        |t              r| j                  |k  S t        S r   r  r  s     r@   rR  zDClassPropertiesAndMethods.test_classic_comparisons.<locals>.C.__lt__1  H    !%+#zzEKK77!%-E31G#zzE11))rA   c                     t        |      r| j                  |j                  k  S t        |t              st        |t              r| j                  |k  S t        S r   r  r  s     r@   rP  zDClassPropertiesAndMethods.test_classic_comparisons.<locals>.C.__le__7  r  rA   c                     t        |      r| j                  |j                  kD  S t        |t              st        |t              r| j                  |kD  S t        S r   r  r  s     r@   rM  zDClassPropertiesAndMethods.test_classic_comparisons.<locals>.C.__gt__=  r  rA   c                     t        |      r| j                  |j                  k\  S t        |t              st        |t              r| j                  |k\  S t        S r   r  r  s     r@   rK  zDClassPropertiesAndMethods.test_classic_comparisons.<locals>.C.__ge__C  r  rA   N)
r   r   r   r5   r=  rI  rR  rP  rM  rK  rG  s   r@   r   r  "  s&    ,******rA   r   rg   rh   rl   rk   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.   rZ  rF   rG   )r;   r  r  r  r[  c3rY   r  yopr   s             @r@   test_classic_comparisonsz2ClassPropertiesAndMethods.test_classic_comparisons  s   	 	 c6*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%:< ? ! ] +rA   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>.ZNrG  r   rA   r@   r  r  ^  rI  rA   r  rg   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@   r=  zBClassPropertiesAndMethods.test_rich_comparisons.<locals>.ZZ.__eq__d  s(    *te|,44*))s    Nr>  r   rA   r@   ZZr  c  s    *rA   r  gׇP  ?c                       e Zd Zy)@ClassPropertiesAndMethods.test_rich_comparisons.<locals>.classicNrG  r   rA   r@   r  r  m  rI  rA   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@   r5   zCClassPropertiesAndMethods.test_rich_comparisons.<locals>.C.__init__q  r  rA   c                 (    j                  d       y )Nzshouldn't call __cmp__)r   )rD  r   r;   s     r@   __cmp__zBClassPropertiesAndMethods.test_rich_comparisons.<locals>.C.__cmp__s  s    II67rA   c                     t        |      r| j                  |j                  k(  S t        |t              st        |t              r| j                  |k(  S t        S r   r  r  s     r@   r=  zAClassPropertiesAndMethods.test_rich_comparisons.<locals>.C.__eq__u  r  rA   c                     t        |      r| j                  |j                  k7  S t        |t              st        |t              r| j                  |k7  S t        S r   r  r  s     r@   rI  zAClassPropertiesAndMethods.test_rich_comparisons.<locals>.C.__ne__{  r  rA   c                     t        |      r| j                  |j                  k  S t        |t              st        |t              r| j                  |k  S t        S r   r  r  s     r@   rR  zAClassPropertiesAndMethods.test_rich_comparisons.<locals>.C.__lt__  r  rA   c                     t        |      r| j                  |j                  k  S t        |t              st        |t              r| j                  |k  S t        S r   r  r  s     r@   rP  zAClassPropertiesAndMethods.test_rich_comparisons.<locals>.C.__le__  r  rA   c                     t        |      r| j                  |j                  kD  S t        |t              st        |t              r| j                  |kD  S t        S r   r  r  s     r@   rM  zAClassPropertiesAndMethods.test_rich_comparisons.<locals>.C.__gt__  r  rA   c                     t        |      r| j                  |j                  k\  S t        |t              st        |t              r| j                  |k\  S t        S r   r  r  s     r@   rK  zAClassPropertiesAndMethods.test_rich_comparisons.<locals>.C.__ge__  r  rA   N)r   r   r   r5   r  r=  rI  rR  rP  rM  rK  )r   r;   s   r@   r   r  p  s+    ,8******rA   r   rh   rl   rk   r  r  r  r  r  r  )r   rF   r.   rZ  r7   rG   )r;   r  rS  r  zzr  r  r  r[  r  rY   r  r  r  r   s   `             @r@   test_rich_comparisonsz/ClassPropertiesAndMethods.test_rich_comparisons\  s   	 	aDD!q!	* 	* 	]T"r"	 	c640D(*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)>@ ? ! _ 1rA   c                 p     ddl m}  fd} ||j                  d        |t        j                  d       y )Nr   )FileIOc                 >    j                  | j                  |       y r   )rF   r  )descrwhatr;   s     r@   checkz6ClassPropertiesAndMethods.test_descrdoc.<locals>.check  s    U]]D1rA   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?@rA   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;   rZ  otypes      r@   r_  zGClassPropertiesAndMethods.test_doc_descriptor.<locals>.DocDescr.__get__  s3    #--66DF!NNE/5u==rA   Nr  r   rA   r@   DocDescrr    s    >rA   r  c                       e Zd Z W         Zy)?ClassPropertiesAndMethods.test_doc_descriptor.<locals>.NewClassNr  )r  s   r@   NewClassr    s
    jGrA   r  zobject=None; type=NewClassz'object=NewClass instance; type=NewClass)rZ  rF   r  )r;   r  r  s     @r@   test_doc_descriptorz-ClassPropertiesAndMethods.test_doc_descriptor  sI    	>v 	>	! 	!))+GH++-VWrA   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>.CNrG  r   rA   r@   r   r    r  rA   r   c                       e Zd Zy)3ClassPropertiesAndMethods.test_set_class.<locals>.DNrG  r   rA   r@   rH  r    r  rA   rH  c                       e Zd Zy)3ClassPropertiesAndMethods.test_set_class.<locals>.ENrG  r   rA   r@   r  r    r  rA   r  c                       e Zd Zy)3ClassPropertiesAndMethods.test_set_class.<locals>.FNrG  r   rA   r@   r  r    r  rA   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$rg   c                       e Zd Zg Zy)5ClassPropertiesAndMethods.test_set_class.<locals>.IntNr  r   rA   r@   Intr    s    B	rA   r	  Trh   c                       e Zd ZddgZy)3ClassPropertiesAndMethods.test_set_class.<locals>.GrC   rU   Nr  r   rA   r@   rq  r    r8  rA   rq  c                       e Zd ZddgZy)3ClassPropertiesAndMethods.test_set_class.<locals>.HrU   rC   Nr  r   rA   r@   rE  r    r8  rA   rE  c                       e Zd ZddgZy)3ClassPropertiesAndMethods.test_set_class.<locals>.IrC   rU   Nr  r   rA   r@   r  r    r8  rA   r  c                       e Zd ZddgZy)3ClassPropertiesAndMethods.test_set_class.<locals>.JrY   rU   Nr  r   rA   r@   Jr    r8  rA   r  c                       e Zd Zg dZy)3ClassPropertiesAndMethods.test_set_class.<locals>.K)rC   rU   rN   Nr  r   rA   r@   Kr    r  rA   r  c                       e Zd ZdgZy)3ClassPropertiesAndMethods.test_set_class.<locals>.Lr5  Nr  r   rA   r@   r  r    r  rA   r  c                       e Zd ZdgZy)3ClassPropertiesAndMethods.test_set_class.<locals>.Mr5  Nr  r   rA   r@   r  r    r  rA   r  c                       e Zd ZdgZy)3ClassPropertiesAndMethods.test_set_class.<locals>.Nrb  Nr  r   rA   r@   r  r    rf  rA   r  c                       e Zd ZdgZy)3ClassPropertiesAndMethods.test_set_class.<locals>.PrJ   Nr  r   rA   r@   Pr    ra  rA   r  c                       e Zd Zy)3ClassPropertiesAndMethods.test_set_class.<locals>.QNrG  r   rA   r@   Qr     rI  rA   r!  c                       e Zd ZddgZy)3ClassPropertiesAndMethods.test_set_class.<locals>.RrJ   rb  Nr  r   rA   r@   Rr#    s    #]3IrA   r$  z
assigning z as __class__ for z silently failedc                       e Zd Zy)3ClassPropertiesAndMethods.test_set_class.<locals>.ONrG  r   rA   r@   Or&    rI  rA   r'  c                       e Zd Z fdZy)3ClassPropertiesAndMethods.test_set_class.<locals>.Ac                     | _         y r   r|  )r;   r'  s    r@   r/  z;ClassPropertiesAndMethods.test_set_class.<locals>.A.__del__  s
    !"rA   Nr   r   r   r/  )r'  s   r@   rw  r)    s    #rA   rw  r   )
rZ  r  r  r7   r.   r  rH   rC   rF   r   )r;   r   rH  r  r  r   cls2r  r  r	  orq  rE  r  r  r  r  r  r  r  r!  r$  rw  r   r'  s   `                       @r@   test_set_classz(ClassPropertiesAndMethods.test_set_class  s   1aA:C1a
E"akk40!akk3/ # 	B 	QS$TVQQS!QS&VXtTVV&#&T3QHQQT
	# 	#	# 	#	# 	#	# 	#	( 	(	 		 		( 	(	% 	%	 		4 	4 a&1a&1a&1a&1a&AICAACAKMM!++tIMqQSQSS!$AKMM!++sILaPRQSS!$ B aAq!Q44C1aAq!Qc9$;SUD! : 5	 		# 	#  *%*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>.CNrG  r   rA   r@   r   r1    r  rA   r   rU   rg   c                 n    	 || _         j                  d| d|       y # t        t        f$ r Y y w xY w)Nr  z.__dict__ = )rJ   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>.BaseNrG  r   rA   r@   r?  r4  -  rI  rA   r?  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__rJ   z&dict_descr allowed access to %r's dictN)rJ   r   r  r   r  )r  
dict_descrr?  r  r;   s     r@   verify_dict_readonlyzEClassPropertiesAndMethods.test_set_dict.<locals>.verify_dict_readonly/  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>.Meta1NrG  r   rA   r@   Meta1r9  C  rI  rA   r:  c                       e Zd Zy)6ClassPropertiesAndMethods.test_set_dict.<locals>.Meta2NrG  r   rA   r@   Meta2r<  E  rI  rA   r=  c                       e Zd Zy)2ClassPropertiesAndMethods.test_set_dict.<locals>.DNrG  r   rA   r@   rH  r?  G  rI  rA   rH  r<  c                       e Zd Zy)2ClassPropertiesAndMethods.test_set_dict.<locals>.ENrG  r   rA   r@   r  rA  I  rI  rA   r  eggsr   z%r's __dict__ can be modifiedc                       e Zd Zy)8ClassPropertiesAndMethods.test_set_dict.<locals>.Module1NrG  r   rA   r@   Module1rD  V  rI  rA   rE  c                       e Zd Zy)8ClassPropertiesAndMethods.test_set_dict.<locals>.Module2NrG  r   rA   r@   Module2rG  X  rI  rA   rH  c                 4    	 | ` y# t        t        f$ r Y yw xY w)NTF)rJ   r   r  )r5  s    r@   can_delete_dictz@ClassPropertiesAndMethods.test_set_dict.<locals>.can_delete_dictc  s*    J  ~. s    c                       e Zd Zy);ClassPropertiesAndMethods.test_set_dict.<locals>.Exception1NrG  r   rA   r@   
Exception1rL  j  rI  rA   rM  c                       e Zd Zy);ClassPropertiesAndMethods.test_set_dict.<locals>.Exception2NrG  r   rA   r@   
Exception2rO  l  rI  rA   rP  rC   )rZ  rJ   rF   rU   rH   r   r   r7  r8  r-  rC   r  )r;   r   rC   r7  r:  r=  rH  r  r   
class_dictrE  rH  r8  r   rJ  rM  rP  ExceptionTyper5  r?  r  s   `                  @@r@   test_set_dictz'ClassPropertiesAndMethods.test_set_dict  s   C1X
a 	J 	QQQ
J	6 		H(	D$ 		D$ 		% 		% 	a7C %JA%+
6" 		9C?@ 	e&& 		dE,, 	!7*JV$C %#)CLL  +		D 		y 	&
J>MAqAJQSS!$_Q/1NO	 ?=  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__w  s    T**rA   c                 >     t        |       t        |      z         S r   rX  )r;   r   r  s     r@   rj   zJClassPropertiesAndMethods.test_binary_operator_override.<locals>.I.__add__y  s    TSZ/00rA   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BrA   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BrA   r   )r   r   r   r   rj   r   r]  r_  )r  s   r@   r  rV  v  s    +1HC
CrA   r  rg   rh   zI(3)rl   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@   r=  zIClassPropertiesAndMethods.test_binary_operator_override.<locals>.S.__eq__  s    zz|u{{}44rA   Nr>  r   rA   r@   Sra    r  rA   rc  )r.   rF   r   r   r9  )r;   rc  r  s     @r@   test_binary_operator_overridez7ClassPropertiesAndMethods.test_binary_operator_overridet  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 	5rA   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>.ANrG  r   rA   r@   rw  rh    rI  rA   rw  c                       e Zd Zy>ClassPropertiesAndMethods.test_subclass_propagation.<locals>.BNrG  r   rA   r@   r  rk    rI  rA   r  c                       e Zd Zy)>ClassPropertiesAndMethods.test_subclass_propagation.<locals>.CNrG  r   rA   r@   r   rm    rI  rA   r   c                       e Zd Zy)>ClassPropertiesAndMethods.test_subclass_propagation.<locals>.DNrG  r   rA   r@   rH  ro    rI  rA   rH  c                      yrf  r   r   s    r@   r  zEClassPropertiesAndMethods.test_subclass_propagation.<locals>.<lambda>  s    "rA   r   c                      y)N:  r   r   s    r@   r  zEClassPropertiesAndMethods.test_subclass_propagation.<locals>.<lambda>  rd  rA   rr  c                      y)N   r   r   s    r@   r  zEClassPropertiesAndMethods.test_subclass_propagation.<locals>.<lambda>  rd  rA   rt  c                      yr"  r   r   s    r@   r  zEClassPropertiesAndMethods.test_subclass_propagation.<locals>.<lambda>  rd  rA   r   c                 :    |dk(  ryt         j                  | |      S )Nr   r  )rZ  r!  r  s     r@   r!  zMClassPropertiesAndMethods.test_subclass_propagation.<locals>.__getattribute__  s    u}**466rA   r  c                 "    |dv ryt        |      )N)r   r   r   rI  r  r  s     r@   r  zHClassPropertiesAndMethods.test_subclass_propagation.<locals>.__getattr__  s    -- &&rA   rI  zd.foo should be undefined nowc                       e Zd Zyrg  rG  r   rA   r@   rw  z>ClassPropertiesAndMethods.test_subclass_propagation.<locals>.A  rI  rA   c                       e Zd Zyrj  rG  r   rA   r@   r  z>ClassPropertiesAndMethods.test_subclass_propagation.<locals>.B  rI  rA   c                       y r   r   r  s    r@   r  zEClassPropertiesAndMethods.test_subclass_propagation.<locals>.<lambda>  s    4rA   )rZ  rD  rE  rF   r  r   r   r   r!  r  r   r   r  r   rR  r   )	r;   rw  r  r   rH  rN   	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>.MyBytesNrG  r   rA   r@   r  r    rI  rA   r  r  c                       e Zd Zy)@ClassPropertiesAndMethods.test_buffer_inheritance.<locals>.MyIntNrG  r   rA   r@   r  r    rI  rA   r  r   z2subclass of int should not have a buffer interface)binasciir  rF   b2a_hexr.   r   r   )r;   r  r  r  rP   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MrA   c                     | dz   S )Nz reprr   r   s    r@   r   zPClassPropertiesAndMethods.test_str_of_str_subclass.<locals>.octetstring.__repr__  s    g~%rA   N)r   r   r   r   r   )r  s   r@   octetstringr    s    N&rA   r  rw  A   41zA repr)r  r9  rF   rH   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0rA   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>.StrSubNrG  r   rA   r@   StrSubr    rI  rA   r  c                       e Zd Zy)JClassPropertiesAndMethods.test_repr_with_module_str_subclass.<locals>.SomeNrG  r   rA   r@   Somer    rI  rA   r  example)r9  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0rA   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    (rA   r   r  u   abc½€latin1r  )encodingr  s   abc?)rF   ra  	bytearrayr5   )r;   r  bas      r@   test_keyword_argumentsz0ClassPropertiesAndMethods.test_keyword_arguments  sT    b)2.[2$,Y 	 	@[)rA   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>.ANrG  r   rA   r@   rw  r    rI  rA   rw  )rZ  ra  r  RecursionErrorr]  s     r@   test_recursive_callz-ClassPropertiesAndMethods.test_recursive_call  s<    	 	 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@   r/  z=ClassPropertiesAndMethods.test_delete_hook.<locals>.C.__del__*  s    

1rA   Nr+  )r#  s   r@   r   r  )  s    rA   r   rg   c                       e Zd Zy)5ClassPropertiesAndMethods.test_delete_hook.<locals>.DNrG  r   rA   r@   rH  r  2  r  rA   rH  r   z$invalid del() didn't raise TypeError)rZ  rF   r   rR  r   r   )r;   r   rY   rH  rN   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>.mydictNrG  r   rA   r@   mydictr  ;  rI  rA   r  z#hash() of dict subclass should failc                       e Zd Zy)?ClassPropertiesAndMethods.test_hash_inheritance.<locals>.mylistNrG  r   rA   r@   mylistr  E  rI  rA   r  z#hash() of list subclass should fail)r   rD  r   r   r7   )r;   r  rN   r  s       r@   test_hash_inheritancez/ClassPropertiesAndMethods.test_hash_inheritance8  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)NrC   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rg   rh   z%'%s' % (1, 2) doesn't raise TypeError%z#'%' % None doesn't raise ValueError534253rg   534253xz%c)r   r   splitr  r/  rindexrF   isdigitr   s    r@   test_str_operationsz-ClassPropertiesAndMethods.test_str_operationsO  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>.NodeNrG  r   rA   r@   rQ  r    rI  rA   rQ  )rU   rC   r   )r;   rQ  rC   rU   rS  s        r@   test_deepcopy_recursivez1ClassPropertiesAndMethods.test_deepcopy_recursive}  s1    	 	FFQKrA   c                 4   ddl m} |j                  |      }t        |       | j	                  |d       | j	                  |d       | j	                  |d       | j                  |j                         d|_        | j                  |j                  ddi       y )Nr   )r8  r   __file__r   rg   )	r7  r8  r   r9  r  r  rJ   r   rF   )r;   r  rP   s      r@   test_uninitialized_modulesz4ClassPropertiesAndMethods.test_uninitialized_modules  sz    )IIaLAa,a,a'$eQZ0rA   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 )Nrk   )r#  r9  r.   rZ  r   )r   r  rH  s     r@   r   z;ClassPropertiesAndMethods.test_funny_new.<locals>.C.__new__  s9    c3'	)9S)&..2C+C#^^C00rA   NrP  )rH  s   r@   r   r    s    1rA   r   c                       e Zd Zd Zy)3ClassPropertiesAndMethods.test_funny_new.<locals>.Dc                     || _         y r   rB  r;   r  s     r@   r5   z<ClassPropertiesAndMethods.test_funny_new.<locals>.D.__init__  rS  rA   NrF  r   rA   r@   rH  r    rT  rA   rH  r  rk   rg   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__      rA   N)r   r   r   rb  r   r   rA   r@   r   z3ClassPropertiesAndMethods.test_funny_new.<locals>.C  s     rA   rh   c                       e Zd Zyr  NrG  r   rA   r@   rH  z3ClassPropertiesAndMethods.test_funny_new.<locals>.D  rI  rA   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  rA   N)r   r   r   r  r   r   rA   r@   r   z3ClassPropertiesAndMethods.test_funny_new.<locals>.C  s     rA   c                       e Zd Zyr  rG  r   rA   r@   rH  z3ClassPropertiesAndMethods.test_funny_new.<locals>.D  rI  rA   )rZ  rF   r   r
  )r;   r   rN   rH  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,/rA   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@   rw   z;ClassPropertiesAndMethods.test_imul_bug.<locals>.C.__imul__  s    e}$rA   N)r   r   r   rw   r   rA   r@   r   r    re  rA   r   r  rh   rl   l                r   rZ  rF   )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'rA   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__foorR  s     r@   r5   z@ClassPropertiesAndMethods.test_copy_setstate.<locals>.C.__init__  s     
rA   c                     || _         y r   rB  rR  s     r@   setfooz>ClassPropertiesAndMethods.test_copy_setstate.<locals>.C.setfoo  rS  rA   c                     | j                   S r   )r  r   s    r@   getfooz>ClassPropertiesAndMethods.test_copy_setstate.<locals>.C.getfoo  r  rA   c                     | j                   gS r   rB  r   s    r@   __getstate__zDClassPropertiesAndMethods.test_copy_setstate.<locals>.C.__getstate__  s    z!rA   c                 ^    j                  t        |      d       |d   x| _        | _        y r  )rF   r  r  r   )rD  lstr;   s     r@   __setstate__zDClassPropertiesAndMethods.test_copy_setstate.<locals>.C.__setstate__  s)      S1-*-a&0eirA   r   )r   r   r   r5   r  r  r  r  r   s   r@   r   r    s    !""1rA   r   r   r  )r   rZ  r  rF   r   r  r   )r;   r   r   rC   rU   s   `    r@   test_copy_setstatez,ClassPropertiesAndMethods.test_copy_setstate  s    	1 	1 bE	#R(IIaL#R(MM!#R(rA   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 )NrI  ro   hellc                       e Zd Zd Zy)0ClassPropertiesAndMethods.test_slices.<locals>.Sc                 .    t         j                  | |      S r   )r9  rq   r  s     r@   rq   z<ClassPropertiesAndMethods.test_slices.<locals>.S.__getitem__  s    tQ//rA   Nr'  r   rA   r@   rc  r    s    0rA   rc  rk   rh   r  c                       e Zd Zd Zy)0ClassPropertiesAndMethods.test_slices.<locals>.Tc                 .    t         j                  | |      S r   )r  rq   r  s     r@   rq   z<ClassPropertiesAndMethods.test_slices.<locals>.T.__getitem__  s    ((q11rA   Nr'  r   rA   r@   r  r         2rA   r  rg   c                       e Zd Zd Zy)0ClassPropertiesAndMethods.test_slices.<locals>.Lc                 .    t         j                  | |      S r   )r7   rq   r  s     r@   rq   z<ClassPropertiesAndMethods.test_slices.<locals>.L.__getitem__  s    ''a00rA   Nr'  r   rA   r@   r  r  
  r  rA   r  rl   )rg   rl   rh   r   )rl   rg   rh   )rl   rh   rg   )rh   rl   rg   )rF   rZ   r9  rq   r  r7   r   )r;   rc  r  r  rC   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$rA   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@   r/  zFClassPropertiesAndMethods.test_subtype_resurrection.<locals>.C.__del__!  s    ""4(rA   N)r   r   r   r  r/  rG  s   r@   r   r    s    I)rA   r   r   rg   )rZ  rr  r   rR  rF   r  r  r/  )r;   rY   r   s     @r@   test_subtype_resurrectionz3ClassPropertiesAndMethods.test_subtype_resurrection  sP    	) 	) C
 Q[[)1- IrA   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@   r5   zBClassPropertiesAndMethods.test_slots_trash.<locals>.trash.__init__9  r  rA   N)r   r   r   r   r5   r   rA   r@   trashr  7  s    IrA   r  iP  )rZ  r   )r;   r  r-  r   s       r@   test_slots_trashz*ClassPropertiesAndMethods.test_slots_trash4  s/    	F 	 uAaA rA   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   rA   r@   rw  r	  B      IrA   rw  c                       e Zd Zy)DClassPropertiesAndMethods.test_slots_multiple_inheritance.<locals>.BNrG  r   rA   r@   r  r  D  rI  rA   r  c                       e Zd ZdZy)DClassPropertiesAndMethods.test_slots_multiple_inheritance.<locals>.Cr   Nr  r   rA   r@   r   r  F  r
  rA   r   rJ   rb  rh   )rZ  r   r  rF   __basicsize__rk  r  )r;   rw  r  r   s       r@   test_slots_multiple_inheritancez9ClassPropertiesAndMethods.test_slots_multiple_inheritance@  su    	 		 		! 	$$&Q__aoo>1j)1m,rA   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@   r{   z6ClassPropertiesAndMethods.test_rmul.<locals>.C.__mul__R      rA   c                      y)Nrmulr   r   s     r@   r}   z7ClassPropertiesAndMethods.test_rmul.<locals>.C.__rmul__T  s    rA   N)r   r   r   r{   r}   r   rA   r@   r   r  Q  s    rA   r   rh   r   g@r  r  r-  s      r@   	test_rmulz#ClassPropertiesAndMethods.test_rmulN  sg    	 	
 C1e$3&1f%Q'rA   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__`      rA   Nr   r   r   r  r   rA   r@   r   r  _      rA   r   rh   r  r-  s      r@   	test_ipowz#ClassPropertiesAndMethods.test_ipow\  s     	 	 C	arA   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__g  r   rA   Nr  r   rA   r@   rw  r$  f  r   rA   rw  c                       e Zd Zd Zy)FClassPropertiesAndMethods.test_ipow_returns_not_implemented.<locals>.Bc                      yr   r   r   s     r@   r_  zOClassPropertiesAndMethods.test_ipow_returns_not_implemented.<locals>.B.__rpow__k      rA   Nr   r   r   r_  r   rA   r@   r  r'  j      rA   r  c                       e Zd Zd Zy)FClassPropertiesAndMethods.test_ipow_returns_not_implemented.<locals>.Cc                      yrA  r   r   s     r@   r]  zNClassPropertiesAndMethods.test_ipow_returns_not_implemented.<locals>.C.__pow__o  r)  rA   Nr   r   r   r]  r   rA   r@   r   r-  n  r+  rA   r   rg   rh   r  )r;   rw  r  r   rC   rU   rY   s          r@   !test_ipow_returns_not_implementedz;ClassPropertiesAndMethods.test_ipow_returns_not_implementede  sm    	& 	&	 		 	 CCC	aA	aArA   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@   r_  z:ClassPropertiesAndMethods.test_no_ipow.<locals>.B.__rpow__}  r)  rA   Nr*  r   rA   r@   r  r3  |  r+  rA   r  rg   r  )r;   r  rC   rU   s       r@   test_no_ipowz&ClassPropertiesAndMethods.test_no_ipow{  s5    	 	 HC	aArA   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)Nrh   z#unsupported operand type(s) for **=z"unsupported operand type(s) for **)r  r   r  r9  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>.CNrG  r   rA   r@   r   r:    rI  rA   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 )NrC   rh   )ro  r!  )r;   rr  r  r  s     r@   r!  zIClassPropertiesAndMethods.test_mutable_bases.<locals>.C2.__getattribute__  s    3; T;DAArA   c                      yr   r   r   s    r@   rM   z=ClassPropertiesAndMethods.test_mutable_bases.<locals>.C2.meth  r)  rA   )r   r   r   r!  rM   rr  )r  r  s   @r@   r  r<    s    B
rA   r  c                       e Zd Zy)7ClassPropertiesAndMethods.test_mutable_bases.<locals>.DNrG  r   rA   r@   rH  r@    rI  rA   rH  c                       e Zd Zy)7ClassPropertiesAndMethods.test_mutable_bases.<locals>.ENrG  r   rA   r@   r  rB    rI  rA   r  rg   rh   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)
rZ  rK   rF   rM   rC   r:  r   r   r  r9  )r;   r   rH  r  rN   r5  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)NrK   rh   rg   c                       e Zd Zy)7ClassPropertiesAndMethods.test_builtin_bases.<locals>.LNrG  r   rA   r@   r  rF    rI  rA   r  c                       e Zd Zy)7ClassPropertiesAndMethods.test_builtin_bases.<locals>.CNrG  r   rA   r@   r   rH    rI  rA   r   c                       e Zd Zy)7ClassPropertiesAndMethods.test_builtin_bases.<locals>.DNrG  r   rA   r@   rH  rJ    rI  rA   rH  z/shouldn't turn list subclass into dict subclassz-shouldn't be able to assign to list.__bases__z#best_base calculation found wanting)builtinsrJ   valuesr#  rH   rZ  r!  ExceptionGrouprF   r  rK   r7   r   r   r   )r;   tpbuiltin_types	num_basesr  r   rH  s          r@   test_builtin_basesz,ClassPropertiesAndMethods.test_builtin_bases  sH    '/&7&7&>&>&@ 2&@&r40 &@ 2B##B4' !I !I  R\\!2IrB  	 		 		 		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>.XNrG  r   rA   r@   r  rU    r  rA   r  c                       e Zd ZyrT  rG  r   rA   r@   r  z>ClassPropertiesAndMethods.test_unsubclassable_types.<locals>.X  r  rA   c                       e Zd ZyrT  rG  r   rA   r@   r  z>ClassPropertiesAndMethods.test_unsubclassable_types.<locals>.X  r  rA   c                       e Zd Zy)>ClassPropertiesAndMethods.test_unsubclassable_types.<locals>.ONrG  r   rA   r@   r'  rY    rI  rA   r'  c                       e Zd ZyrT  rG  r   rA   r@   r  z>ClassPropertiesAndMethods.test_unsubclassable_types.<locals>.X	  r  rA   c                       e Zd ZyrT  rG  r   rA   r@   r  z>ClassPropertiesAndMethods.test_unsubclassable_types.<locals>.X  r  rA   c                       e Zd ZyrT  rG  r   rA   r@   r  z>ClassPropertiesAndMethods.test_unsubclassable_types.<locals>.X  rI  rA   )r  r   rH   rZ  rK   )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   )flagro  r   )r;   r>   rO  r  WorkOncer  s       r@   r   zWClassPropertiesAndMethods.test_mutable_bases_with_failing_mro.<locals>.WorkOnce.__new__  s"    	Xt4XtUBOOrA   c                     | j                   dkD  rt        d      | xj                   dz  c_         t        j                  |       S )Nr   bozorg   )rb  r  rH   r  r   s    r@   r  zSClassPropertiesAndMethods.test_mutable_bases_with_failing_mro.<locals>.WorkOnce.mro"  s3    99q=&v..IINI88D>)rA   )r   r   r   r   r  rr  )r  rc  s   @r@   rc  r`    s    P*rA   rc  c                       e Zd Zd Zy)QClassPropertiesAndMethods.test_mutable_bases_with_failing_mro.<locals>.WorkAlwaysc                 ,    t         j                  |       S r   )rH   r  r   s    r@   r  zUClassPropertiesAndMethods.test_mutable_bases_with_failing_mro.<locals>.WorkAlways.mro*  s    
 xx~%rA   Nr  r   rA   r@   
WorkAlwaysrg  )  s    &rA   ri  c                       e Zd Zy)HClassPropertiesAndMethods.test_mutable_bases_with_failing_mro.<locals>.CNrG  r   rA   r@   r   rk  1  rI  rA   r   c                       e Zd Zy)IClassPropertiesAndMethods.test_mutable_bases_with_failing_mro.<locals>.C2NrG  r   rA   r@   r  rm  4  rI  rA   r  c                       e Zd Zy)HClassPropertiesAndMethods.test_mutable_bases_with_failing_mro.<locals>.DNrG  r   rA   r@   rH  ro  7  rI  rA   rH  c                       e Zd Zy)HClassPropertiesAndMethods.test_mutable_bases_with_failing_mro.<locals>.ENrG  r   rA   r@   r  rq  :  rI  rA   r  c                       e Zd Zy)HClassPropertiesAndMethods.test_mutable_bases_with_failing_mro.<locals>.FNrG  r   rA   r@   r  rs  =  rI  rA   r  r<  c                       e Zd Zy)HClassPropertiesAndMethods.test_mutable_bases_with_failing_mro.<locals>.GNrG  r   rA   r@   rq  ru  @  rI  rA   rq  zexception not propagated)rH   rZ  rY  rK   r   r  rF   )r;   ri  r   r  rH  r  r  rq  E_mro_beforeD_mro_beforerc  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>.ANrG  r   rA   r@   rw  r{  T  rI  rA   rw  c                       e Zd Zy)JClassPropertiesAndMethods.test_mutable_bases_catch_mro_conflict.<locals>.BNrG  r   rA   r@   r  r}  W  rI  rA   r  c                       e Zd Zy)JClassPropertiesAndMethods.test_mutable_bases_catch_mro_conflict.<locals>.CNrG  r   rA   r@   r   r  Z  rI  rA   r   c                       e Zd Zy)JClassPropertiesAndMethods.test_mutable_bases_catch_mro_conflict.<locals>.DNrG  r   rA   r@   rH  r  ]  rI  rA   rH  c                       e Zd Zy)JClassPropertiesAndMethods.test_mutable_bases_catch_mro_conflict.<locals>.ENrG  r   rA   r@   r  r  `  rI  rA   r  zdidn't catch MRO conflict)rZ  rK   r   r   )r;   rw  r  r   rH  r  s         r@   %test_mutable_bases_catch_mro_conflictz?ClassPropertiesAndMethods.test_mutable_bases_catch_mro_conflictR  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>.CNrG  r   rA   r@   r   r  l  rI  rA   r   rH  zD.E)rZ  r   r   rF   )r;   r   r   s      r@   test_mutable_namesz,ClassPropertiesAndMethods.test_mutable_namesj  si    	 	 ll
!,,

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

3c5\BrA   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@   r/  zDClassPropertiesAndMethods.test_evil_type_name.<locals>.Nasty.__del__}  s
    $
rA   Nr+  rG  s   r@   Nastyr  |  s    %rA   r  c                       e Zd Zy)8ClassPropertiesAndMethods.test_evil_type_name.<locals>.CNrG  r   rA   r@   r   r    rI  rA   r   r   normal)r9  r   )r;   r  r   s     @r@   test_evil_type_namez-ClassPropertiesAndMethods.test_evil_type_namex  s-    	%C 	%	 	 5\

rA   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__      'rA   c                      y)NB.__rfloordiv__r   r   s     r@   __rfloordiv__zIClassPropertiesAndMethods.test_subclass_right_op.<locals>.B.__rfloordiv__      (rA   Nr   r   r   r  r  r   rA   r@   r  r        ()rA   r  rg   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  rA   c                      y)NC.__rfloordiv__r   r   s     r@   r  zIClassPropertiesAndMethods.test_subclass_right_op.<locals>.C.__rfloordiv__  r  rA   Nr  r   rA   r@   r   r    r  rA   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  rA   c                      y)ND.__rfloordiv__r   r   s     r@   r  zIClassPropertiesAndMethods.test_subclass_right_op.<locals>.D.__rfloordiv__  r  rA   Nr  r   rA   r@   rH  r    r  rA   rH  r  r  c                       e Zd Zy);ClassPropertiesAndMethods.test_subclass_right_op.<locals>.ENrG  r   rA   r@   r  r    rI  rA   r  )r.   rF   rZ  r  )r;   r  r   rH  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6rA   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)Nrk   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))rF   r   r  rJ   r_  r   r   r.   )r;   r  rL   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@   r5   zEClassPropertiesAndMethods.test_isinst_isclass.<locals>.Proxy.__init__  r  rA   c                 |    |j                  d      rt        j                  | |      S t        | j                  |      S N_Proxy__r]  rZ  r!  rI   r  r  s     r@   r!  zMClassPropertiesAndMethods.test_isinst_isclass.<locals>.Proxy.__getattribute__  2    ??:.!224>>"4::t44rA   Nr   r   r   r5   r!  r   rA   r@   rV  r        !5rA   rV  c                       e Zd Zy8ClassPropertiesAndMethods.test_isinst_isclass.<locals>.CNrG  r   rA   r@   r   r    rI  rA   r   c                       e Zd Zy8ClassPropertiesAndMethods.test_isinst_isclass.<locals>.DNrG  r   rA   r@   rH  r    rI  rA   rH  c                       e Zd Zyr  rG  r   rA   r@   r   z8ClassPropertiesAndMethods.test_isinst_isclass.<locals>.C  rI  rA   c                       e Zd Zyr  rG  r   rA   r@   rH  z8ClassPropertiesAndMethods.test_isinst_isclass.<locals>.D  rI  rA   )rZ  r
  )r;   rV  r   rC   parH  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!$rA   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@   r5   zBClassPropertiesAndMethods.test_proxy_super.<locals>.Proxy.__init__  r  rA   c                 |    |j                  d      rt        j                  | |      S t        | j                  |      S r  r  r  s     r@   r!  zJClassPropertiesAndMethods.test_proxy_super.<locals>.Proxy.__getattribute__  r  rA   Nr  r   rA   r@   rV  r    r  rA   rV  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  rA   Nrt  r   rA   r@   r  r    s    rA   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)ro  r  )r;   r   r  s    r@   r  z7ClassPropertiesAndMethods.test_proxy_super.<locals>.C.f  s    Q')G33rA   )r   r   r   r  rr  )r  r   s   @r@   r   r    s    4 4rA   r   r  zB.f->C.f)rZ  rF   rJ   )r;   rV  r  r$  r  r   s        @r@   test_proxy_superz*ClassPropertiesAndMethods.test_proxy_super  sX    	5F 	5	 		4 	4 c#JC+Z8rA   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!)rZ  r%  r9  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   )rH   r%  r   r  r  s      r@   r%  zTClassPropertiesAndMethods.test_carloverre_multi_inherit_valid.<locals>.A.__setattr__4  s      c51rA   Nr   r   r   r%  r   rA   r@   rw  r  3  r  rA   rw  c                       e Zd Zy)HClassPropertiesAndMethods.test_carloverre_multi_inherit_valid.<locals>.BNrG  r   rA   r@   r  r  7  rI  rA   r  c                       e Zd Zy)HClassPropertiesAndMethods.test_carloverre_multi_inherit_valid.<locals>.CNrG  r   rA   r@   r   r  :  rI  rA   r   rH  Tz1setattr through direct base types should be legal)rH   rZ  r	  r   r   r;   rw  r  r   r$  s        r@   #test_carloverre_multi_inherit_validz=ClassPropertiesAndMethods.test_carloverre_multi_inherit_valid2  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   )rZ  r%  r  s      r@   r%  zVClassPropertiesAndMethods.test_carloverre_multi_inherit_invalid.<locals>.A.__setattr__E  s    ""3U3rA   Nr  r   rA   r@   rw  r  D  s    4rA   rw  c                       e Zd Zy)JClassPropertiesAndMethods.test_carloverre_multi_inherit_invalid.<locals>.BNrG  r   rA   r@   r  r  H  rI  rA   r  c                       e Zd Zy)JClassPropertiesAndMethods.test_carloverre_multi_inherit_invalid.<locals>.CNrG  r   rA   r@   r   r  K  rI  rA   r   rH  Tz6setattr through indirect base types should be rejected)rH   rZ  r	  r   r   r  s        r@   %test_carloverre_multi_inherit_invalidz?ClassPropertiesAndMethods.test_carloverre_multi_inherit_invalidC  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   rk  )r;   	referrentrj  s     r@   r5   zJClassPropertiesAndMethods.test_weakref_segfault.<locals>.Provoker.__init__\  s    &7;;y1rA   c                 $    | j                         }y r   r  r  s     r@   r/  zIClassPropertiesAndMethods.test_weakref_segfault.<locals>.Provoker.__del___  s    HHJrA   N)r   r   r   r5   r/  )rj  s   r@   Provokerr  [  s    2rA   r  c                       e Zd Zy)=ClassPropertiesAndMethods.test_weakref_segfault.<locals>.OopsNrG  r   rA   r@   Oopsr  b  rI  rA   r  )rj  rZ  whatever)r;   r  r  r-  rj  s       @r@   test_weakref_segfaultz/ClassPropertiesAndMethods.test_weakref_segfaultV  s5     		 		6 	 Fa[
rA   cpuc                 F    d }t        d      D ]  }|j                  } d }y )Nc                       y r   r   r   rA   r@   r  zAClassPropertiesAndMethods.test_wrapper_segfault.<locals>.<lambda>l  s    4rA   i@B )r   ra  )r;   r  r   s      r@   test_wrapper_segfaultz/ClassPropertiesAndMethods.test_wrapper_segfaulti  s%     wA

A  rA   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__t  s      ^^
"%DTF#KLLrA   Nr  r   rA   r@   StdoutGuardr  s  s    MrA   r	  zOops!)r   r  r  print)r;   r	  s     r@   test_file_faultz)ClassPropertiesAndMethods.test_file_faultq  sL    	M 	M
 []+""<0g 1 ,+00 ,+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 )Nrr  rD  r   s    r@   rE  zQClassPropertiesAndMethods.test_vicious_descriptor_nonsense.<locals>.Evil.__hash__  s    F|#rA   c                 *    	 ` y# t        $ r Y yw xY wr   )rr  r  r  s     r@   r=  zOClassPropertiesAndMethods.test_vicious_descriptor_nonsense.<locals>.Evil.__eq__  s)      & s    	Nr   r   r   rE  r=  rG  s   r@   Evilr	    s    $rA   r	  c                       e Zd ZddZy)IClassPropertiesAndMethods.test_vicious_descriptor_nonsense.<locals>.DescrNc                      yr   r   )r;   obrH   s      r@   r_  zQClassPropertiesAndMethods.test_vicious_descriptor_nonsense.<locals>.Descr.__get__  r)  rA   r   r  r   rA   r@   Descrr	    s    rA   r	  c                       e Zd Z W         Zy)EClassPropertiesAndMethods.test_vicious_descriptor_nonsense.<locals>.CN)r   r   r   rr  r	  s   r@   r   r	    s
    7DrA   r   r   rg   rr  )rZ  rJ   rF   rr  r   rR  r  )r;   r	  rY   r   r	  s      @@r@    test_vicious_descriptor_nonsensez:ClassPropertiesAndMethods.test_vicious_descriptor_nonsense|  sp    		6 			F 		 	 C

46#a(rA   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@   r5   z9ClassPropertiesAndMethods.test_init.<locals>.Foo.__init__  rg  rA   NrF  r   rA   r@   Foor	    ri  rA   r	  z'did not test __init__() for None return)rZ  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;   rC   rU   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 )Nrj   )r  rj   r  r{   r	  rF   r   r  r  __objclass__r7   r  rD  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rA   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	  rF   r   r  r  r  r7   rD  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rA   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 )Nrj   r   )r  r7   rj   r  r{   r	  rF   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..5rA   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    !!rA   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  sO    $!q1!!),T+, - 21,, 21s!   AAAA	AA"rg   ))rj   zx + yzx += y)__sub__zx - yzx -= y)r{   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 ^= yrw  r   __rrh   r  __ir   )r   r   rH   )r;   r+	  r  N1N2r>   r?   iexprrw  rC   rnamer  rU   inamer   rY   s   `               r@   test_not_implementedz.ClassPropertiesAndMethods.test_not_implemented  sn   	"	- [[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"GrA   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__.  r  rA   N)r   r   r   r   r   rA   r@   r   rB	  -  r  rA   r   rl   rg   rh   )rZ  rF   r  )r;   r   rY   s      r@   test_assign_slicez+ClassPropertiesAndMethods.test_assign_slice(  s6    
	# 	# C!A!$rA   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@   r5   zEClassPropertiesAndMethods.test_set_and_no_get.<locals>.Descr.__init__:  r  rA   c                 6    ||j                   | j                  <   y r   )rJ   r>   r&  s      r@   r  zDClassPropertiesAndMethods.test_set_and_no_get.<locals>.Descr.__set__=  s    */TYY'rA   N)r   r   r   r5   r  r   rA   r@   r	  rI	  8  s    !0rA   r	  rC   c                       e Zd ZW  Zy8ClassPropertiesAndMethods.test_set_and_no_get.<locals>.XNr  r  s   r@   r  rN	  A  s    ArA   r  r   c                       e Zd Zy);ClassPropertiesAndMethods.test_set_and_no_get.<locals>.MetaNrG  r   rA   r@   rt  rQ	  J  rI  rA   rt  c                       e Zd ZyrM	  rG  r   rA   r@   r  z8ClassPropertiesAndMethods.test_set_and_no_get.<locals>.XL  rI  rA   r<  )rZ  r  rC   rF   rH   )r;   r	  r  r  rt  r  s        @r@   test_set_and_no_getz-ClassPropertiesAndMethods.test_set_and_no_get5  s    	0F 	0 c
	 	 Cacc5!b!	4 		$ 	sb!rA   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>.getterX  s    LLA%L(..rA   r   )r;   r$  objtyper  s   `   r@   r_  zHClassPropertiesAndMethods.test_getattr_hooks.<locals>.Descriptor.__get__W  s    / rA   r   )r   r   r   r  r_  r   rA   r@   
DescriptorrV	  U  s    GrA   rZ	  c                       e Zd ZW  Zy)7ClassPropertiesAndMethods.test_getattr_hooks.<locals>.AN)r   r   r   r!  rO	  s   r@   rw  r\	  ^  s	    $rA   rw  c                       e Zd ZW  Zy)7ClassPropertiesAndMethods.test_getattr_hooks.<locals>.BNr  rO	  s   r@   r  r^	  `  s    KrA   r  c                       e Zd ZW  ZW  Zy)7ClassPropertiesAndMethods.test_getattr_hooks.<locals>.CN)r   r   r   r!  r  rO	  s   r@   r   r`	  b  s    $KrA   r   rr  rg   rh   ro   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__o  s    $T**rA   c                 f    ` t        d      D ]  }t        j                           t	        |      Nr   )r  r   rT  collectr  )r;   r>   r   EvilGetattributes      r@   r!  zWClassPropertiesAndMethods.test_getattr_hooks.<locals>.EvilGetattribute.__getattribute__q  s+    $0qAJJL "$T**rA   Nr  )rg	  s   r@   rg	  rb	  m  s    ++rA   rg	  )rZ  r  r  rI   rF   r  )r;   rZ	  rw  r  r   rg	  r  s        @@r@   test_getattr_hooksz,ClassPropertiesAndMethods.test_getattr_hooksR  s    	 	 	% 	%	  	 	  	  	.'13?*.'13?*.'13?*	+v 	+ 	.'3C3EvNrA   c                 `    | j                  t        t        j                  t        t               y r   )r  r   rH   r!  r7   r   s    r@   test_type___getattribute__z4ClassPropertiesAndMethods.test_type___getattribute__y  s    )T%:%:D$GrA   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>.metaNrG  r   rA   r@   metarn	    rI  rA   ro	  c                       e Zd Zy)9ClassPropertiesAndMethods.test_abstractmethods.<locals>.XNrG  r   rA   r@   r  rq	    rI  rA   r  )r  r  rI   rH   rZ  rl	  )r;   ro	  r  s      r@   test_abstractmethodsz.ClassPropertiesAndMethods.test_abstractmethods|  sd    .'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   r9  r  r   rA   r@   FakeStrru	    rJ  rA   rv	  r   )r
  r9  r  r   r  rj   )r;   rv	  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>.ThingNrG  r   rA   r@   Thingr{	    rI  rA   r|	  r  r   )deque)r   r  r   r7   sortr9  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>.FooNrG  r   rA   r@   r	  r	    rI  rA   r	  )r   r   r  r  r9  r   )r;   r	  r   s      r@   test_repr_as_strz*ClassPropertiesAndMethods.test_repr_as_str  sB    	 	{{e.#s3.$4rA   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   rA   r@   r  r	    s    **KiiGrA   r  r   r  )r   r  rF   )r;   r  r  s      r@   test_mixing_slot_wrappersz3ClassPropertiesAndMethods.test_mixing_slot_wrappers  sD    	  	  C3$QBrA   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   r9  r=  rj   r   rA   r@   rw  r	    s    ZZFkkGrA   rw  )r.   r  r   )r;   rw  rC   s      r@   test_wrong_class_slot_wrapperz7ClassPropertiesAndMethods.test_wrong_class_slot_wrapper  s^    	" 	" 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   rA   r@   r  r	    s    "G	rA   r  z0'foo' in __slots__ conflicts with class variable)r  r  r9  r  rF   )r;   r  r  rP   s       r@    test_slot_shadows_class_variablez:ClassPropertiesAndMethods.test_slot_shadows_class_variable  sK    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   rA   r@   r  r	    s    rA   r  bananar  blahz7cannot set '__doc__' attribute of immutable type 'list'z7cannot delete '__doc__' attribute of immutable type 'X')r  rF   r  r   rH   r7   rJ   r  r  r9  r  r)  )r;   r  r  s      r@   test_set_docz&ClassPropertiesAndMethods.test_set_doc  s    	 		H-y)RJ	*224@ *OQTUWUaUaQbcy)RGY'2215 *OQTUWUaUaQbcH- *) *)s   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>.XNrG  r   rA   r@   r  r	    rI  rA   r  r   Oinkc                        e Zd Z G d d      Zy)r  c                       e Zd Zy)Y.InsideNrG  r   rA   r@   Insider	    r  rA   r	  N)r   r   r   r	  r   rA   r@   r  r    s     rA   r  r	  )r9  r  r   r   r/   r.   rj   r  rF   rH   r   r!	  r   r  r   rJ   r  r  r	  )r;   descriptorsr7  rN   r  qualnamer  s          r@   test_qualnamez'ClassPropertiesAndMethods.test_qualname  s   yy',,

CKKH9 U+DAqT!W--q=/@A , A~~22S81::EHQ^^X6  	//=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   rg   )rH   rF   r   rZ  rJ   r  r   )r;   r  rN  s      r@   test_qualname_dictz,ClassPropertiesAndMethods.test_qualname_dict  sw    k*%R +65nk:;a )T5"b9rA   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   r5   rJ   r   s    r@   r5   zEClassPropertiesAndMethods.test_cycle_through_dict.<locals>.X.__init__  s    d# $rA   NrF  r   rA   r@   r  r	    s    %rA   r  r   )r   rr  rj  rk  r   rR  assertIsNonerT  r9  assertIsNotrH   )r;   r  r  wrr-  s        r@   test_cycle_through_dictz1ClassPropertiesAndMethods.test_cycle_through_dict  so    	% 	% C[[^"$!AT!Wa( "rA   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>.OverrideNeitherNrG  r   rA   r@   OverrideNeitherr	  #  rI  rA   r	  rg   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   rW  )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9rA   Nr  rP  r   rA   r@   OverrideNewr	  '  s    :rA   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   )rZ  r5   )r;   r   r  r<   r=   s        r@   r5   zaClassPropertiesAndMethods.test_object_new_and_init_with_parameters.<locals>.OverrideInit.__init__+  s    t=d=f==rA   Nr  rF  r   rA   r@   OverrideInitr	  *  s    >rA   r	  c                       e Zd Zy)XClassPropertiesAndMethods.test_object_new_and_init_with_parameters.<locals>.OverrideBothNrG  r   rA   r@   OverrideBothr	  -  rI  rA   r	  rh   rl   rB  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!;	 <rA   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>.BaseNrG  r   rA   r@   r?  r	  6  rI  rA   r?  c                       e Zd Zy)[ClassPropertiesAndMethods.test_subclassing_does_not_duplicate_dict_descriptors.<locals>.SubNrG  r   rA   r@   rD  r	  8  rI  rA   rD  rJ   )r  rJ   rZ  )r;   r?  rD  s      r@   4test_subclassing_does_not_duplicate_dict_descriptorszNClassPropertiesAndMethods.test_subclassing_does_not_duplicate_dict_descriptors5  s>    	 		$ 	j$--0S\\2rA   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.method?  r  rA   Nr   r   r   r  r   rA   r@   r	  r	  >  r   rA   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.methodF  r  rA   Nr	  r   rA   r@   r?  r	  E  r   rA   r?  c                       e Zd Zy)BClassPropertiesAndMethods.test_bound_method_repr.<locals>.Derived1NrG  r   rA   r@   Derived1r	  H  rI  rA   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.methodK  r  rA   Nr	  r   rA   r@   Derived2r	  J  r   rA   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   rA  s    r@   r  zDClassPropertiesAndMethods.test_bound_method_repr.<locals>.Foo.method[  r  rA   N)r   r   r   r  r  r   rA   r@   r	  z=ClassPropertiesAndMethods.test_bound_method_repr.<locals>.FooZ  s     rA   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@   ra  zMClassPropertiesAndMethods.test_bound_method_repr.<locals>.MyCallable.__call__f  r  rA   N)r   r   r   ra  r   rA   r@   
MyCallabler	  e  r   rA   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  ro  rZ  r7  
MethodTyper   r   )r;   r	  r?  r	  r	  r  derived1derived2super_d2r   r	  r  instancer  r  s                 r@   test_bound_method_reprz0ClassPropertiesAndMethods.test_bound_method_repr=  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rA   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_getr_  r   rA   r@   r	  r	  y  s    ''GrA   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'  rh   )r  r   r  )r   r   s     r@   r   z:ClassPropertiesAndMethods.test_bpo25750.<locals>.X.__new__~  s*     	).u6A1a466s   *N)r   r   r   r  r   r	  s   r@   r  r	  |  s    GE7rA   r  rO	  )r;   r  r	  s     @r@   test_bpo25750z'ClassPropertiesAndMethods.test_bpo25750t  s     
	( 	(	7 	7 	
rA   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>.ParentNrG  r   rA   r@   Parentr	    rI  rA   r	  c                       e Zd Zy)=ClassPropertiesAndMethods.test_remove_subclass.<locals>.ChildNrG  r   rA   r@   Childr	    rI  rA   r	  )rF   r:  rT  rf	  )r;   r	  r	  s      r@   test_remove_subclassz.ClassPropertiesAndMethods.test_remove_subclass  sq    
	 	..0"5	F 	..05':


..0"5rA   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     ''rA   c                 $    | j                  d      S )Nasdf)r  r   s    r@   r   zIClassPropertiesAndMethods.test_attr_raise_through_property.<locals>.A.foo  s    ''//rA   N)r   r   r   r  r  r   r   rA   r@   rw  r	    s    ( 0 0rA   rw  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     ''rA   c                     t        d      )NBAR)NotImplementedErrorr   s    r@   r   zIClassPropertiesAndMethods.test_attr_raise_through_property.<locals>.B.foo  s    )%00rA   N)r   r   r   r  r  r   r   rA   r@   r  r 
    s(    ( ( 1 1rA   r  r
  )rW  r  r   r
  )r;   rw  r  s      r@    test_attr_raise_through_propertyz:ClassPropertiesAndMethods.test_attr_raise_through_property  sn    	0 	0 ##J6CGG 7	1 	1 ##$7?CGG @? 76 @?s   A6B6A?B)r   r   r   r  r.  r  r<  rZ  rr  r  r  r  r  r  r  r]  rl  r  r  r  r  r  r   refcount_testr  r   r3   r   r   r  r  r	  r  r  r:  rF  expectedFailurerL  r^  rn  r  r  r  r  r  r2  r`  ro  r  r   flagsoptimizer  cpython_onlyr  r  r  r  rF  r  r  r  r  r  r  r  r.  rS  rd  r|  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r   r  r  r  r!  r0  r5  r7  rC  rQ  r]  rx  r  r  r  r  r  r  r  r  r  r  r  requires_resourcer  r	  r	  r	  r	  r#	  r&	  r(	  r?	  rF	  rS	  rh	  rj	  rr	  rx	  r	  r	  r	  r	  r	  r	  r	  r	  r	  r	  r	  r	  r  r	  r	  r
  rr  r|  s   @r@   r   r     sL   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"rA   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@   rM   z$DictProxyTests.setUp.<locals>.C.meth  r  rA   Nry  r   rA   r@   r   r
    r   rA   r   )rZ  r   r   s     r@   setUpzDictProxyTests.setUp  s    	 	 rA   gettracez#trace function introduces __local__c                     | j                   j                  j                         }| j                  |t               t	        |      }|j                          | j                  |g d       y )NrJ   r  r   rb  rM   )r   rJ   r   assertNotIsInstancer7   r~	  rF   )r;   r`  r   s      r@   test_iter_keyszDictProxyTests.test_iter_keys  sQ     VV__!!#  T*Bx		  7 	8rA   c                     | j                   j                  j                         }| j                  |t               t	        |      }| j                  t        |      d       y re	  )r   rJ   rL  r
  r7   rF   r  )r;   r`  rL  s      r@   test_iter_valueszDictProxyTests.test_iter_values  sG     VV__##%  T*bVa(rA   c                     | j                   j                  j                         }| j                  |t               |D cg c]  }|d   	 }}|j                          | j                  |g d       y c c}w )Nr   r
  )r   rJ   r8   r
  r7   r~	  rF   )r;   r`  itemr   s       r@   test_iter_itemszDictProxyTests.test_iter_items  se     VV__""$  T*$&'BDQB'		  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>.BNrG  r   rA   r@   r  r
    rI  rA   r  c                       e Zd Zy)7DictProxyTests.test_dict_type_with_metaclass.<locals>.MNrG  r   rA   r@   r  r!
    rI  rA   r  c                       e Zd Zy)7DictProxyTests.test_dict_type_with_metaclass.<locals>.CNrG  r   rA   r@   r   r#
    r  rA   r   r<  )rZ  rH   rF   rJ   )r;   r  r  r   s       r@   test_dict_type_with_metaclassz,DictProxyTests.test_dict_type_with_metaclass  sJ    	 		 		! 	 	ajj)4

+;<rA   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   rJ   r  r]  endswithr8   r  r  )r;   rl  r   r   s       r@   	test_reprzDictProxyTests.test_repr  s}     !_5q9

3+FFOO))+DAqMM,--a3Q7 ,rA   N)r   r   r   r
  r3   r   r   r   r
  r
  r
  r
  r$
  r(
  r   rA   r@   r
  r
    s     X__WS*-@,#,,.=?8?8 X__WS*-@,#,,.=?)?) X__WS*-@,#,,.=?8?8	=8rA   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  rA   Nr/  r   rA   r@   UserLongr-
    r   rA   r0
  r   )rZ  r   rH   r  r  )r;   r0
  s     r@   test_pytype_long_readyz,AAAPTypesLongInitTest.test_pytype_long_ready  s8    	v 		8:q! 		s	   = AN)r   r   r   r1
  r   rA   r@   r*
  r*
    s    
rA   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@   rE  z@MiscTests.test_type_lookup_mro_reference.<locals>.MyKey.__hash__  s    G}$rA   c                     f_         y r   r  )r;   r   Base2r  s     r@   r=  z>MiscTests.test_type_lookup_mro_reference.<locals>.MyKey.__eq__  s    $hrA   Nr	  )r:
  r  s   r@   MyKeyr6
  
  s    %'rA   r;
  c                       e Zd ZdZdZy)6MiscTests.test_type_lookup_mro_reference.<locals>.Base	from BaseNr   r   r   r8
  mykey2r   rA   r@   r?  r=
    s    E FrA   r?  c                       e Zd ZdZdZy)7MiscTests.test_type_lookup_mro_reference.<locals>.Base2
from Base2Nr?
  r   rA   r@   r:
  rB
    s     E!FrA   r:
  r  r   r>
  rC
  )rZ  rH   rF   r8
  r@
  )r;   r;
  r?  r:
  r  s      @@r@   test_type_lookup_mro_referencez(MiscTests.test_type_lookup_mro_reference  sg    	'F 	'	!6 	!	"F 	" tg|,+.<0rA   N)r   r   r   rD
  r   rA   r@   r3
  r3
    s    1rA   r3
  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 )Nrh   r   rg   rl   ro   )__reduce_ex__rF   copyreg__newobj_ex__rH   
__newobj__assertListEqualr7   r	  assertDictEqualr   __base___reconstructorrZ  
__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^^-|<rA   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).Nrg   )ir   i7i)baconfishcheeseioc                       e Zd Z fdZy)%PicklingTests.test_reduce.<locals>.C1c                     S r   r   r/
  s    r@   __getnewargs__z4PicklingTests.test_reduce.<locals>.C1.__getnewargs__G  s    rA   Nr   r   r   r^
  r  s   r@   r   r\
  F  s    rA   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__S      !rA   Nr_
  r   rA   r@   r  ra
  R      "rA   r  rh   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__\  s    f~%rA   Nr   r   r   ri
  r  s   r@   r  rg
  [  s    &rA   r  c                       e Zd Z fdZy)%PicklingTests.test_reduce.<locals>.C4c                     dfS )Nzbad dictr   r/
  s    r@   ri
  z7PicklingTests.test_reduce.<locals>.C4.__getnewargs_ex__d  s    j))rA   Nrj
  r  s   r@   r  rl
  c  s    *rA   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@   ri
  z7PicklingTests.test_reduce.<locals>.C5.__getnewargs_ex__g  s    #V,,rA   Nrj
  )r=   s   r@   C5ro
  f  s    -rA   rq
  c                       e Zd Zd Zy)%PicklingTests.test_reduce.<locals>.C6c                      y)Nr   r   r   s    r@   ri
  z7PicklingTests.test_reduce.<locals>.C6.__getnewargs_ex__j  rg  rA   Nrj
  r   rA   r@   C6rs
  i  ri  rA   ru
  c                       e Zd Zd Zy)%PicklingTests.test_reduce.<locals>.C7c                      yrc
  r   r   s    r@   ri
  z7PicklingTests.test_reduce.<locals>.C7.__getnewargs_ex__m  rd
  rA   Nrj
  r   rA   r@   C7rw
  l  re
  rA   ry
  c                       e Zd Z fdZy)%PicklingTests.test_reduce.<locals>.C9c                     i fS r   r   r/
  s    r@   ri
  z7PicklingTests.test_reduce.<locals>.C9.__getnewargs_ex__w  s    bz!rA   Nrj
  r  s   r@   C9r{
  v  r  rA   r}
  c                       e Zd Zd Zy)&PicklingTests.test_reduce.<locals>.C10c                     t         r   r8  r   s    r@   ri
  z8PicklingTests.test_reduce.<locals>.C10.__getnewargs_ex__~        rA   Nrj
  r   rA   r@   C10r
  }      !rA   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    rA   Nr   r   r   r  r  s   r@   C11r
    s    rA   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__  rd
  rA   Nr
  r   rA   r@   C12r
    re
  rA   r
  r
  c                       e Zd Zd Zy)&PicklingTests.test_reduce.<locals>.C13c                     t         r   r8  r   s    r@   r  z3PicklingTests.test_reduce.<locals>.C13.__getstate__  r
  rA   Nr
  r   rA   r@   C13r
    r
  rA   r
  c                   *    e Zd Z eW        Z fdZy)&PicklingTests.test_reduce.<locals>.C14c                 P    j                         D ]  \  }}t        | ||        y r   r8   r^  )r;   r>   r  r  s      r@   r5   z/PicklingTests.test_reduce.<locals>.C14.__init__  s#    #(;;=KD%D$. $1rA   N)r   r   r   r  r   r5   r  s   r@   C14r
    s    eI/rA   r
  c                       e Zd Zy)&PicklingTests.test_reduce.<locals>.C15NrG  r   rA   r@   C15r
    rI  rA   r
  quebeci)rS
  c                       e Zd Zy)&PicklingTests.test_reduce.<locals>.C16NrG  r   rA   r@   C16r
    rI  rA   r
  yukon)rR
  )r   pickleHIGHEST_PROTOCOLrV
  r8   r^  r  r   rH
  r  r9  rP
  r   r7   )r;   	protocolsr   r$  rQ
  r>   r  r  r  r  rq
  ru
  ry
  r   r}
  r
  r
  r
  r
  r
  r
  r
  r<   r=   r  s                         @@@r@   test_reducezPicklingTests.test_reduce@  s   &11A56	.4 	 	 dEuc40  !;;=KD%Cu% )Euc4u= 	" 	" dEz&&y1%%e, 21 
	& 	& dEz""5#tV< 	* 	*	- 	-	 		" 	" E2r2~eA:**Iz+BC))%0 DC & 	" 	" dEuc40 	! 	! eEz&&z2%%e, 32 
	 	 eEuc7 	" 	" eEuc< 	! 	! eE"":.!!%( /qy&&z2NN$ 32	 	/ 	/ eEz""5#dE]"C&&y1%%e, 2&&y1NN$ 21 	$ 	8T"#EucT#Y? 	$ 	7)nEucT#Y? A 216 DC  32, /. 32 2111sT   
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 )Nrg   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    	rA   c                 "    |dv rt        |      y )N)r^
  ri
  rc  r  s     r@   r  zCPicklingTests.test_special_method_lookup.<locals>.Picky.__getattr__  s    BB(..rA   N)r   r   r   r  r  r   rA   r@   Pickyr
    s    rA   r
  rh   r  )r   r
  r
  rV
  )r;   r
  r
  protocolr  s        r@   r2  z(PicklingTests.test_special_method_lookup  sQ    &11A56		 	 "H"a-BTEx> "rA   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  rJ   r   )r  rH   r   rZ  r  r	  r  r   rM
  rJ   rL
  r   rF   rI   r   )r;   r$  objcopyr  slots        r@   _assert_is_copyzPicklingTests._assert_is_copy  sh    ;.55c7CC90
  = > >g3/d3igC83
#  w/?/?S IS\\7+;+;E3$  0A0As K  C&(>C ! I  dD!9!($!=3 ! H &
 	cDMs;rA   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   )rQ
  dumpsloads)r;   rQ
  r
  r
  s       r@   r5   zEPicklingTests._generate_pickle_copiers.<locals>.PickleCopier.__init__  s    "
"
"
rA   c                 X    | j                  | j                  || j                              S r   )r
  r
  rQ
  r(  s     r@   r   zAPicklingTests._generate_pickle_copiers.<locals>.PickleCopier.copy  s     zz$**S$**"=>>rA   c                     dj                  | j                  | j                  j                  | j                  j                  | j
                  j                  | j
                  j                        S )Nz0PickleCopier(proto={}, dumps={}.{}, loads={}.{}))r  rQ
  r
  r   r   r
  r   s    r@   r   zEPicklingTests._generate_pickle_copiers.<locals>.PickleCopier.__repr__  sQ     K

 $

 5 5tzz7N7N $

 5 5tzz7N7NPQrA   N)r   r   r   r  r5   r   r   r   rA   r@   PickleCopierr
    s    4#?QrA   r
  c              3   (   K   | ]	  } |   y wr   r   )r  r<   r
  s     r@   r  z9PicklingTests._generate_pickle_copiers.<locals>.<genexpr>  s%      ED )-d#Ds   rg   )		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rA   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   rC   Nr  r   rA   r@   r   r     r  rA   r   r   c                       e Zd Zy)rH  NrG  r   rA   r@   rH  rH    rI  rA   rH  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.rC   c                     t        | di       j                         }t        |       j                  D ]3  }|j                  j                  dd      D ]  }	 t        | |      ||<    5 |S # t        $ r Y $w xY w)NrJ   r   r   )rI   r   rH   rY  rJ   r   r  )r;   r  r   r
  s       r@   r  zC.__getstate__  sy    j"5::<:--C # 0 0b A!*1$*=E$K !B .   . ! !s   A))	A54A5c                 N    |j                         D ]  \  }}t        | ||        y r   r
  )r;   r  r   r   s       r@   r  zC.__setstate__  s"    !KKMDAqD!Q' *rA   c                 T    t        |       j                  d| j                         dS )Nz()<r'   )rH   r   r  r   s    r@   r   z
C.__repr__  s     %)$Z%8%8$:K:K:MNNrA   N)r   r   r   r  r   r  r  r   r   rA   r@   r   r     s    EI(OrA   c                       e Zd ZdZy)rH  z!A subclass of a class with slots.Nr  r   rA   r@   rH  rH    s    /rA   c                       e Zd ZdZdgZy)r  zA subclass with an extra slot.rU   N)r   r   r   r  r   r   rA   r@   r  r  $  s    ,IrA   r  )pickle_copierr   r   r   )r   r  r   r
  r
  rH  r  r
  r-	  r   r
  rC   rU   )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   )ro  r5   rC   rU   )r;   rC   rU   r  s      r@   r5   zC1.__init__F  s     "rA   c                 <    d| j                   d| j                  dS )NzC1(r  r&
  rT   r   s    r@   r   zC1.__repr__J  s    '+vvtvv66rA   )	r   r   r   r  ARGSNEED_DICT_COPYINGr5   r   rr  r|  s   @r@   r   r   B  s    HD $7rA   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   ro  r   rC   rU   )r   rC   rU   r;   r  s       r@   r   z
C2.__new__R  s$    ws+rA   c                 D    t         |           | j                  d       y NrZ
  )ro  r5   r   )r;   r<   r  s     r@   r5   zC2.__init__W  s     " H%rA   c                     | j                   S r   r
  rA  s    r@   r^
  zC2.__getnewargs__\      xxrA   c                 T    d| j                   d| j                  dt        |       dS )NzC2(r  )<r'   rC   rU   r7   r   s    r@   r   zC2.__repr___      +/664664:FFrA   )r   r   r   r  r
  r
  r   r5   r  r^
  r   rr  r|  s   @r@   r  r  N  s5    :D %
&
    GrA   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
  )rC   rU   r   r	  s      r@   r5   zC3.__init__g  s     H%rA   c                     | j                   S r   r
  rA  s    r@   r  zC3.__getstate__m  r
  rA   c                 *    |\  }}|| _         || _        y r   rT   )r;   r  rC   rU   s       r@   r  zC3.__setstate__p  s    1rA   c                 T    d| j                   d| j                  dt        |       dS )NzC3(r  r
  r'   r
  r   s    r@   r   zC3.__repr__t  r
  rA   N)r   r   r   r  r
  r
  r5   r  r  r  r   r   rA   r@   r  r  c  s4    8D %&    GrA   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__.)rI  rH  rg   Fc                 D    t         |   | |      }||_        ||_        |S r   r
  r   rC   rU   r  r;   r  s        r@   r   z
C4.__new__|  &    wsE2rA   c                     | j                   S r   r
  rA  s    r@   r^
  zC4.__getnewargs__  r
  rA   c                 T    d| j                   d| j                  dt        |       dS )NzC4(r  r
  r'   rC   rU   r.   r   s    r@   r   zC4.__repr__      +/664663t9EErA   )r   r   r   r  r
  r
  r   r  r^
  r   rr  r|  s   @r@   r  r  x  s0    :(D %
    FrA   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 )rq
  z/An int subclass copyable via __getnewargs_ex__.r  r  rl   Fr   rD	  c                D    t         |   | |      }||_        ||_        |S r   r
  r
  s        r@   r   z
C5.__new__  r
  rA   c                 2    | j                   | j                  fS r   )r
  KWARGSrA  s    r@   ri
  zC5.__getnewargs_ex__  s    #**--rA   c                 T    d| j                   d| j                  dt        |       dS )NzC5(r  r
  r'   r
  r   s    r@   r   zC5.__repr__  r
  rA   )r   r   r   r  r
  r
  r
  r   r  ri
  r   rr  r|  s   @r@   rq
  rq
    s<    =Dq\F %,- 
 . .FrA   rq
  )r   r
  r
  rh   rA  )r   r7   r  r  r.   r  rq
  r
  r
  r
  r-	  rI   r
  rQ
  r   r
  r
  rJ   r  r   )
r;   test_classespickle_copiersr   r
  r=   r$  rQ
  r
  objcopy2s
             r@   test_reduce_copyingz!PicklingTests.test_reduce_copying?  s   		7 		7	G 	G*	G 	G*	F 	F 	F 	F  BB+668"+"3"3L."QC#]C h3388.v.%++',,S1$$S'2
 A:c&;&;$$**,,11':H((h7 DC #R"  C#& h3388.v."3-$$S'2
 ,,$$**,'0H((h7 '&  ! DC" '&s   !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>.SNrG  r   rA   r@   rc  r
    rI  rA   rc  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;   rr  rw  rc  s     r@   r  z4PicklingTests.test_issue24097.<locals>.A.__getattr__  s'    6>*+F)AOOA&((rA   N)r   r   r   r
  r  )rw  rc  s   r@   rw  r
    s    vYKM)rA   rw  r   r   r   rh   )r9  rI
  rK
  rF   rH
  )r;   rI
  r  rw  rc  s      @@r@   test_issue24097zPicklingTests.test_issue24097  s\    	 		) 	) 	&&tfb\.BD$O**1-x8rA   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   )rZ  rP
  r  r   rH
  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   rV
  r
  r2  r
  rb  r
  r
  r
  r
  r
  r   rA   r@   rF
  rF
     sS    -/$ $=<y@v?<4 E E0A+Fz8x9")rA   rF
  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>.ANrG  r   rA   r@   rw  r
    rI  rA   rw  c                       e Zd Zy))SharedKeyTests.test_subclasses.<locals>.BNrG  r   rA   r@   r  r     rI  rA   r  r  rC   rg   r   )r   rF   r   r&  vars
assertLessr  r  rS  wr   r  r  assertGreater)r;   rw  r  rm  rC   rU   r  s          r@   test_subclasseszSharedKeyTests.test_subclasses  sk   	 		 	 #2Y'Y!#qsY'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   rA   r@   r
  r
    s    H HrA   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   rH   r   )r  r>   rO  r  s       r@   r   zDebugHelperMeta.__new__  s0    99Y'#E)||D$u55rA   c                 ,    t        | j                        S r   )r   r   rA  s    r@   r   zDebugHelperMeta.__repr__  s    CLL!!rA   N)r   r   r   r  r   r   r   rA   r@   r  r    s    6"rA   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    	
rA   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
rA   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                 z    j                  d      r| xj                  dz  c_        t        j                  |       S )Nrg   r   )r  rK   rH   r  r?  s    r@   r  z8MroTest.test_incomplete_set_bases_on_self.<locals>.M.mro  s+    ??1%MMR'Mxx}$rA   Nr  r   s   r@   r  r    s    %rA   r  c                       e Zd Zy)4MroTest.test_incomplete_set_bases_on_self.<locals>.ANrG  r   rA   r@   rw  r    rI  rA   rw  r<  Nr  r;   r  rw  s   `  r@   !test_incomplete_set_bases_on_selfz)MroTest.test_incomplete_set_bases_on_self  s    	% 	%	! 	rA   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   )rY  r   r  rK   rH   r  )r   rw  r;   s    r@   r  z3MroTest.test_reent_set_bases_on_base.<locals>.M.mro%  s@    ;;*s||s/Br*r)xx}$rA   Nr  )rw  r;   s   r@   r  r  $  s    %rA   r  c                       e Zd Zy)/MroTest.test_reent_set_bases_on_base.<locals>.ANrG  r   rA   r@   rw  r!  -  rI  rA   rw  r<  c                       e Zd Zy)/MroTest.test_reent_set_bases_on_base.<locals>.BNrG  r   rA   r@   r  r#  /  rI  rA   r  r   N)r  rK   )r;   r  r  rw  s   `  @r@   test_reent_set_bases_on_basez$MroTest.test_reent_set_bases_on_base   s5    	% 	%	! 		 		rrA   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   )rK   rZ  r  rH   r  )r   r  r;   s     r@   r  z:MroTest.test_reent_set_bases_on_direct_base.<locals>.M.mro8  sA    }}Q'v%q)",xx}$rA   Nr  r   s   r@   r  r'  7      %rA   r  c                       e Zd Zy)6MroTest.test_reent_set_bases_on_direct_base.<locals>.ANrG  r   rA   r@   rw  r+  @  rI  rA   rw  r<  c                       e Zd Zy)6MroTest.test_reent_set_bases_on_direct_base.<locals>.BNrG  r   rA   r@   r  r-  B  rI  rA   r  c                       e Zd Zy)6MroTest.test_reent_set_bases_on_direct_base.<locals>.CNrG  r   rA   r@   r   r/  D  rI  rA   r   Nr  )r;   r  rw  r  r   s   `    r@   #test_reent_set_bases_on_direct_basez+MroTest.test_reent_set_bases_on_direct_base3  s3    	% 	%	! 		 		 	rA   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   rK   rH   r  )r   r5  r6  r;   s    r@   r  z9MroTest.test_reent_set_bases_tp_base_cycle.<locals>.M.mroX  sB    ::||t+(*u||t+(*uxx}$rA   Nr  )r5  r6  r;   s   r@   r  r3  W  s    %rA   r  c                       e Zd Zy)5MroTest.test_reent_set_bases_tp_base_cycle.<locals>.ANrG  r   rA   r@   rw  r9  `  rI  rA   rw  r<  c                       e Zd Zy)6MroTest.test_reent_set_bases_tp_base_cycle.<locals>.B1NrG  r   rA   r@   r5  r;  b  rI  rA   r5  c                       e Zd Zy)6MroTest.test_reent_set_bases_tp_base_cycle.<locals>.B2NrG  r   rA   r@   r6  r=  d  rI  rA   r6  Tr   N)r  r  r  r   rK   )r;   r  rw  r5  r6  s   `  @@r@   "test_reent_set_bases_tp_base_cyclez*MroTest.test_reent_set_bases_tp_base_cycleG  si     	% 	% 	%	! 		 		 	 
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   Fr7  )r   r6  r   r;   s    r@   r  z?MroTest.test_tp_subclasses_cycle_in_update_slots.<locals>.M.mrou  s3    ::#,,#"5!&DJ#%%AKxx}$rA   Nr  )r6  r   r;   s   r@   r  rA  t  s    %rA   r  c                       e Zd Zy);MroTest.test_tp_subclasses_cycle_in_update_slots.<locals>.ANrG  r   rA   r@   rw  rE  {  rI  rA   rw  r<  c                       e Zd Zy)<MroTest.test_tp_subclasses_cycle_in_update_slots.<locals>.B1NrG  r   rA   r@   r5  rG  }  rI  rA   r5  c                       e Zd Zy)<MroTest.test_tp_subclasses_cycle_in_update_slots.<locals>.B2NrG  r   rA   r@   r6  rI    rI  rA   r6  c                       e Zd Zy);MroTest.test_tp_subclasses_cycle_in_update_slots.<locals>.CNrG  r   rA   r@   r   rK    rI  rA   r   TN)r  r  rK   rF   r:  )r;   r  rw  r5  r6  r   s   `   @@r@   (test_tp_subclasses_cycle_in_update_slotsz0MroTest.test_tp_subclasses_cycle_in_update_slotsk  s    	% 	% 	%	! 		 		 		 	 
etre,**,qc2**,b1t,))+bT2rA   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>.ENrG  r   rA   r@   r  rO    rI  rA   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 rC  r7  )r   r6  r   r  r;   s    r@   r  zAMroTest.test_tp_subclasses_cycle_error_return_path.<locals>.M.mro  sF    ::#,,#"5{{re+%*
')exx}$rA   Nr  )r6  r   r  r;   s   r@   r  rQ    s    % %rA   r  c                       e Zd Zy)=MroTest.test_tp_subclasses_cycle_error_return_path.<locals>.ANrG  r   rA   r@   rw  rT    rI  rA   rw  r<  c                       e Zd Zy)>MroTest.test_tp_subclasses_cycle_error_return_path.<locals>.B1NrG  r   rA   r@   r5  rV    rI  rA   r5  c                       e Zd Zy)>MroTest.test_tp_subclasses_cycle_error_return_path.<locals>.B2NrG  r   rA   r@   r6  rX    rI  rA   r6  c                       e Zd Zy)=MroTest.test_tp_subclasses_cycle_error_return_path.<locals>.CNrG  r   rA   r@   r   rZ    rI  rA   r   TN)
r-  r  r  r  rK   rF   rY  r  rH   r  )r;   r  rw  r5  r6  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>.XNrG  r   rA   r@   r  ra    s     rA   )rY  r   r  r   rH   r  )r   r  r;   s     r@   r  z-MroTest.test_incomplete_extend.<locals>.M.mro  sP    ;;&3<<3+>**95! ! 6 xx}$	 65s   AA$Nr  r   s   r@   r  r^    r)  rA   r  c                       e Zd Zy))MroTest.test_incomplete_extend.<locals>.ANrG  r   rA   r@   rw  rc    rI  rA   rw  r<  Nr  r  s   `  r@   test_incomplete_extendzMroTest.test_incomplete_extend  s    	% 	%	! 	rA   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   )rY  r  r  ro  xxxrH   r  )r   r  r;   s    r@   r  z,MroTest.test_incomplete_super.<locals>.M.mro  sC    ;;&**>:c3+ ; xx}$ ;:s   AA)r   r   r   r  rr  rs  s   @r@   r  rg    s    % %rA   r  c                       e Zd Zy)(MroTest.test_incomplete_super.<locals>.ANrG  r   rA   r@   rw  rk    rI  rA   rw  r<  Nr  r  s   `  r@   test_incomplete_superzMroTest.test_incomplete_super  s    
	% 	%	! 	rA   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>.BNrG  r   rA   r@   r  ro    rI  rA   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rA   Nr  )r  r  s   r@   r  rq    s    rA   r  c                       e Zd Zy)/MroTest.test_disappearing_custom_mro.<locals>.ANrG  r   rA   r@   rw  rt    r  rA   rw  r<  N)r  r  r   )r;   rw  r  r  s     @@r@   test_disappearing_custom_mroz$MroTest.test_disappearing_custom_mro  sA    
	 		 	
 y)a  *))s   A

AN)r   r   r   r  r
  r  r  r$  r0  r>  rL  r[  rd  rl  ru  r   rA   r@   r  r     sA    &("H"3H 8D$ rA   r  __main__)%rK  rI
  rT  r
  r'  r
  r0  r2  r   r7  r3   rj  rj  r   r   
contextlibr   r	  r   test.support.testcaser   r  r  r   r4   r   r   r
  r*
  r3
  rF
  r
  rH   r  r  r   mainr   rA   r@   <module>rz     sA     	      
      &  1
uDH%% uDpVH 1 1? VHrP98X&& 98xH-- 21!! 16w)H%% w)tHX&& H4	"d 	"bh bJ zHMMO _v  I
  Is$   D# D0 #D-,D-0D:9D: