+
    BiH                         R t ^ RIt^ RIt^ RIHtHtHt ^ RIHt  ! R R]P                  4      t
 ! R R]P                  4      t]R8X  d   ]P                  ! 4        R# R# )	z
Test suite for PEP 380 implementation

adapted from original tests written by Greg Ewing
see <http://www.cosc.canterbury.ac.nz/greg.ewing/python/yield-from/YieldFrom-Python3.1.2-rev5.zip>
N)captured_stderr
disable_gc
gc_collect)supportc                      a  ] tR t^t o RtR tR tR tR tR t	R t
R tR	 tR
 tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR t R t!R t"R  t#R! t$R" t%R# t&R$ t'R%t(V t)R&# )'TestPEP380Operationz
Test semantics.
c                   aa . oVV3R lpV3R loV! 4        F  pSP                  RV: 24       K  	  V P                  S. RO4       R# )z8
Test delegation of initial next() call to subgenerator
c               3   v   <"   SP                  R 4       S ! 4        Rj  xL
  SP                  R4       R#  L5iStarting g1NFinishing g1appendg2traces   +/usr/lib/python3.14/test/test_yield_from.pyg1OTestPEP380Operation.test_delegation_of_initial_next_to_subgenerator.<locals>.g1   s,     LL'tOOLL(    979c               3   \   <"   S P                  R 4       ^*x  S P                  R4       R# 5i)Starting g2Finishing g2Nr   r   s   r   r   OTestPEP380Operation.test_delegation_of_initial_next_to_subgenerator.<locals>.g2   s#     LL'HLL(s   ),Yielded N)r   r   z
Yielded 42r   r   r   assertEqualselfr   xr   r   s   &  @@r   /test_delegation_of_initial_next_to_subgeneratorCTestPEP380Operation.test_delegation_of_initial_next_to_subgenerator   sF     	)	) ALL,-   
 	    c                0  aa . oVV3R lpV3R lo V! 4        F  pSP                  RV: 24       K  	  V P                  R4       V P                  S. RO4       R#   \         d.   pT P                  TP                  ^ ,          R4        Rp?LIRp?ii ; i)z/
Test raising exception in initial next() call
c               3      <"    SP                  R 4       S ! 4        Rj  xL
  SP                  R4       R#  L  SP                  R4       i ; i5ir
   r   r   s   r   r   KTestPEP380Operation.test_raising_exception_in_initial_next_call.<locals>.g11   s>     -]+4^,  ^,s%   A: 8: A: AAc                  j   <  S P                  R 4       \        R4      h  S P                  R4       i ; i)r   spanish inquisition occurredr   r   
ValueErrorr   s   r   r   KTestPEP380Operation.test_raising_exception_in_initial_next_call.<locals>.g27   s.    -]+ !?@@^,s    2r   'subgenerator failed to raise ValueErrorr(   N)r   r   r   r   r   failr*   r   argsr   r   r    er   r   s   &   @@r   +test_raising_exception_in_initial_next_call?TestPEP380Operation.test_raising_exception_in_initial_next_call,   s     	-	-	ATQ01 
 II?@  
 		  	HQVVAY(FGG	H   #A B(#BBc                   aa . oVV3R lpV3R loV! 4        F  pSP                  RV: 24       K  	  V P                  S. RO4       R# )z0
Test delegation of next() call to subgenerator
c               3      <"   SP                  R 4       Rx  S ! 4        Rj  xL
  Rx  SP                  R4       R#  L5ir   g1 hamNg1 eggsr   r   r   s   r   r   LTestPEP380Operation.test_delegation_of_next_call_to_subgenerator.<locals>.g1P   s6     LL'NtOOOLL( s    A?Ac               3   d   <"   S P                  R 4       Rx  Rx  S P                  R4       R# 5ir   g2 spamg2 more spamr   Nr   r   s   r   r   LTestPEP380Operation.test_delegation_of_next_call_to_subgenerator.<locals>.g2V   s)     LL'O  LL(   -0r   N)r   Yielded g1 hamr   Yielded g2 spamYielded g2 more spamr   Yielded g1 eggsr   r   r   s   &  @@r   ,test_delegation_of_next_call_to_subgenerator@TestPEP380Operation.test_delegation_of_next_call_to_subgeneratorK   sF     	)	)
 ALL,-  	 
 		r#   c                0  aa . oVV3R lpV3R lo V! 4        F  pSP                  RV: 24       K  	  V P                  R4       V P                  S. RO4       R#   \         d.   pT P                  TP                  ^ ,          R4        Rp?LIRp?ii ; i)z1
Test raising exception in delegated next() call
c               3      <"    SP                  R 4       Rx  S ! 4        Rj  xL
  Rx  SP                  R4       R#  L  SP                  R4       i ; i5ir7   r   r   s   r   r   MTestPEP380Operation.test_raising_exception_in_delegated_next_call.<locals>.g1m   J     -]+4^,   ^,+   AA A A A A AAc               3   z   <"    S P                  R 4       Rx  \        R4      h  S P                  R4       i ; i5i)r   r=   hovercraft is full of eelsr   r)   r   s   r   r   MTestPEP380Operation.test_raising_exception_in_delegated_next_call.<locals>.g2u   s7     -]+ !=>> ^,s   ; % 8;r   r,   rM   Nr   rA   r   rB   r   r   r-   r0   s   &   @@r   -test_raising_exception_in_delegated_next_callATestPEP380Operation.test_raising_exception_in_delegated_next_callh   s     	-	-	ATQ01 
 II?@  
 		  	FQVVAY(DEE	Fr4   c                   aa . oVV3R lpV3R loV! 4       p\        V4      p^p  VP                  V4      pSP                  RV: 24       V^,          pK2    \         d     Mi ; iT P	                  S. RO4       R# )z
Test delegation of send()
c               3      <"   SP                  R 4       Rx p SP                  RV : 24       S! 4        Rj  xL
  Rx p SP                  RV : 24       SP                  R4       R#  L05ir   r8   zg1 received Nr9   r   r   r    r   r   s    r   r   7TestPEP380Operation.test_delegation_of_send.<locals>.g1   X     LL'ALLQ01tOOALLQ01LL(    5A+A)1A+c               3      <"   SP                  R 4       Rx p SP                  RV : 24       Rx p SP                  RV : 24       SP                  R4       R# 5i)r   r=   g2 received r>   r   Nr   r    r   s    r   r   7TestPEP380Operation.test_delegation_of_send.<locals>.g2   sK     LL'ALLQ01$$ALLQ01LL(s   AAr   N)r   g1 received 1r   rB   g2 received 2rC   zg2 received 3r   rD   zg1 received 4r   )nextsendr   StopIterationr   )r   r   gyr    r   r   s   &    @@r   test_delegation_of_send+TestPEP380Operation.test_delegation_of_send   s     	)	) DG	FF1IQ01Q 		  
 	s   2A A'&A'c                   aaa . oVV3R loV3R loVV3R lpV P                  \        V4       V P                  S. RO4       R# )z1
Test handling exception while delegating 'send'
c               3      <"   SP                  R 4       Rx p SP                  RV : 24       S! 4        Rj  xL
  Rx p SP                  RV : 24       SP                  R4       R#  L05irT   r   rU   s    r   r   MTestPEP380Operation.test_handling_exception_while_delegating_send.<locals>.g1   rW   rX   c               3   v   <"   SP                  R 4       Rx p SP                  RV : 24       \        R4      h5i)r   r=   rZ   rM   r)   r[   s    r   r   MTestPEP380Operation.test_handling_exception_while_delegating_send.<locals>.g2   s4     LL'ALLQ019::s   69c                     < S! 4       p \        V 4      p^p  V P                  V4      pSP                  RV: 24       V^,          pK2    \         d    SP                  R4        R# i ; i)   r   ra   N)r_   r`   r   ra   )rb   rc   r    r   r   s      r   runNTestPEP380Operation.test_handling_exception_while_delegating_send.<locals>.run   s`    AQAA.q	ALL!45FA  ._-.s   2A	 	A)(A)N)r   r]   r   rB   r^   )assertRaisesr*   r   r   rm   r   r   r   s   & @@@r   -test_handling_exception_while_delegating_sendATestPEP380Operation.test_handling_exception_while_delegating_send   s@     	)	)
	. 	*S)  
 	r#   c                   aa . oVV3R lpV3R loV! 4       p\        ^4       F#  p\        V4      pSP                  RV: 24       K%  	  VP                  4        V P	                  S. RO4       R# )z
Test delegating 'close'
c               3      <"    SP                  R 4       Rx  S ! 4        Rj  xL
  Rx  SP                  R4       R#  L  SP                  R4       i ; i5ir7   r   r   s   r   r   5TestPEP380Operation.test_delegating_close.<locals>.g1   rJ   rK   c               3      <"    S P                  R 4       Rx  Rx  S P                  R4       R#   S P                  R4       i ; i5ir<   r   r   s   r   r   5TestPEP380Operation.test_delegating_close.<locals>.g2   :     -]+$$^,^,   A1 AAAr   NrO   )ranger_   r   closer   )r   r   rb   ir    r   r   s   &    @@r   test_delegating_close)TestPEP380Operation.test_delegating_close   sc     	-	- DqAQALL,-  	
	  
 	r#   c                  aa . oVV3R lpV3R lo V! 4       p\        ^4       F#  p\        V4      pSP                  RV: 24       K%  	  VP                  4        V P	                  R4       V P                  S. RO4       R#   \
         dN   pT P                  TP                  ^ ,          R4       T P                  TP                  \        4        Rp?LiRp?ii ; i)z2
Test handling exception while delegating 'close'
c               3      <"    SP                  R 4       Rx  S ! 4        Rj  xL
  Rx  SP                  R4       R#  L  SP                  R4       i ; i5ir7   r   r   s   r   r   MTestPEP380Operation.test_handing_exception_while_delegating_close.<locals>.g1	  rJ   rK   c               3      <"    S P                  R 4       Rx  Rx  S P                  R4       \        R4      h  S P                  R4       \        R4      h; i5i)r   r=   r>   r   "nybbles have exploded with delightr)   r   s   r   r   MTestPEP380Operation.test_handing_exception_while_delegating_close.<locals>.g2  sV     G]+$$^, !EFF ^, !EFFs   A: AAAr   r,   r   NrO   )rz   r_   r   r{   r.   r*   r   r/   assertIsInstance__context__GeneratorExitr   r   rb   r|   r    r1   r   r   s   &     @@r   -test_handing_exception_while_delegating_closeATestPEP380Operation.test_handing_exception_while_delegating_close  s     	-	G
	AA1XGQ01  GGI
 II?@  
 	  	@QVVAY(LM!!!--??	@s   A	B CACCc                  aa . oVV3R lpV3R lo V! 4       p\        ^4       F#  p\        V4      pSP                  RV: 24       K%  	  \        R4      pVP	                  V4       V P                  R4       V P                  S. RO4       R#   \         d.   pT P                  TP                  ^ ,          R4        Rp?LIRp?ii ; i)z
Test delegating 'throw'
c               3      <"    SP                  R 4       Rx  S ! 4        Rj  xL
  Rx  SP                  R4       R#  L  SP                  R4       i ; i5ir7   r   r   s   r   r   5TestPEP380Operation.test_delegating_throw.<locals>.g12  rJ   rK   c               3      <"    S P                  R 4       Rx  Rx  S P                  R4       R#   S P                  R4       i ; i5ir<   r   r   s   r   r   5TestPEP380Operation.test_delegating_throw.<locals>.g2:  rx   ry   r   tomato ejectedr,   NrO   rz   r_   r   r*   throwr.   r   r/   r   s   &     @@r   test_delegating_throw)TestPEP380Operation.test_delegating_throw-  s     	-	-
	AA1XGQ01  +,AGGAJ II?@  
 		  	:QVVAY(899	:s   AB C#CCc                   a . oV3R lp\        4       pV! V4       \        R4      pV! V4       RVn        V! V4       V P                  S. RO4       R# )z3
Test 'value' attribute of StopIteration exception
c                    < SP                  V P                  P                  : R V : 24       SP                  RV P                  : 24       R# )z: zvalue = N)r   	__class____name__value)r1   r   s   &r   pexPTestPEP380Operation.test_value_attribute_of_StopIteration_exception.<locals>.pexZ  s1    LLQ[[%9%91=>LL23r#   spameggsN)zStopIteration: zvalue = NoneStopIteration: spamzvalue = spamr   zvalue = eggs)ra   r   r   )r   r   r1   r   s   &  @r   /test_value_attribute_of_StopIteration_exceptionCTestPEP380Operation.test_value_attribute_of_StopIteration_exceptionU  sS     	4 OA&!AA  
 	r#   c                \   a V3R  lpR oV P                  \        V! 4       4      R.4       R# )c               3   2   <"   S ! 4        R j  xL
  R #  L5iN r   s   r   r   :TestPEP380Operation.test_exception_value_crash.<locals>.g1p  s     tOO   c               3      "   R x  ^*.# 5ir   r   r   r#   r   r   :TestPEP380Operation.test_exception_value_crash.<locals>.g2r  s     J4Ks   
r   N)r   list)r   r   r   s   & @r   test_exception_value_crash.TestPEP380Operation.test_exception_value_crashm  s'    		 	bddV,r#   c                   aa . oVV3R lpRV3R lloV! 4        F  pSP                  RV: 24       K  	  V P                  S. RO4       R# )z
Test generator return value
c               3   (  <"   SP                  R 4       Rx  S! 4        Rj  xL
 p SP                  RV : 24       ^R\        ^4      3 F(  pS! V4       Rj  xL
 p SP                  RV : 24       K*  	  Rx  SP                  R4       R#  Lj L65i)r   r8   Nzg2 returned r9   r      )r   ra   )retvr   r   s     r   r   ;TestPEP380Operation.test_generator_return_value.<locals>.g1}  s}     LL'NT/CLLS23mA..!#A&67 / OLL( " 's!    BB5BB5BBNc              3   x   <"   SP                  R 4       Rx  Rx  SP                  R4       V '       d   V # R# 5ir<   r   )r   r   s   &r   r   ;TestPEP380Operation.test_generator_return_value.<locals>.g2  s6     LL'O  LL( s   7:r   r   )r   rA   r   rB   rC   r   zg2 returned Noner   rB   rC   r   zg2 returned 1r   rB   rC   r   zg2 returned (2,)r   rB   rC   r   zg2 returned StopIteration(3)rD   r   r   r   s   &  @@r   test_generator_return_value/TestPEP380Operation.test_generator_return_valuex  sF     		)	 ALL,-   
 	r#   c                ~    . pR pV! 4        F  pVP                  RV: 24       K  	  V P                  V. RO4       R# )z,
Test delegation of next() to non-generator
c               3   8   "   \        ^4       Rj  xL
  R#  L5i   Nrz   r   r#   r   rb   GTestPEP380Operation.test_delegation_of_next_to_non_generator.<locals>.g       Qx   r   N)	Yielded 0	Yielded 1	Yielded 2r   )r   r   rb   r    s   &   r   (test_delegation_of_next_to_non_generator<TestPEP380Operation.test_delegation_of_next_to_non_generator  s>     	 ALL,-   
 	r#   c                    . pR pV! 4       p\        ^4       F)  pVP                  R4      pVP                  RV: 24       K+  	  V P                  V. RO4       R# )z)
Test conversion of send(None) to next()
c               3   8   "   \        ^4       Rj  xL
  R#  L5ir   r   r   r#   r   rb   BTestPEP380Operation.test_conversion_of_sendNone_to_next.<locals>.g  r   r   N	Yielded: )z
Yielded: 0z
Yielded: 1z
Yielded: 2)rz   r`   r   r   )r   r   rb   gir    rc   s   &     r   #test_conversion_of_sendNone_to_next7TestPEP380Operation.test_conversion_of_sendNone_to_next  sV     	 SqAALL!-.  	  
 	r#   c                   a . oV3R lpV! 4       p\        V4       \        4       ;_uu_ 4       pVP                  4        RRR4       V P                  XP	                  4       R4       V P                  SRR.4       R#   + '       g   i     LF; i)z-
Test delegation of close() to non-generator
c               3      <"    S P                  R 4       \        ^4       Rj  xL
  S P                  R4       S P                  R4       R#  L(  S P                  R4       i ; i5i
starting gNzg should not be herefinishing gr   rz   r   s   r   rb   HTestPEP380Operation.test_delegation_of_close_to_non_generator.<locals>.g  Q     ,\* 8##34]+ $ ]++   A%A AA A%A A""A%N r   r   )r_   r   r{   r   getvalue)r   rb   r   outputr   s   &   @r   )test_delegation_of_close_to_non_generator=TestPEP380Operation.test_delegation_of_close_to_non_generator  ss     	, SR&HHJ *B/ 
 	 s   A==B	c                  a . oV3R lp V! 4       p\        ^4       F#  p\        V4      pSP                  RV: 24       K%  	  \        R4      pVP	                  V4       V P                  R4       V P                  S. RO4       R#   \         d.   pT P                  TP                  ^ ,          R4        Rp?LIRp?ii ; i)z*
Test delegating 'throw' to non-generator
c               3      <"    S P                  R 4       \        ^
4       Rj  xL
  S P                  R4       R#  L  S P                  R4       i ; i5i)
Starting gNFinishing gr   r   s   r   rb   ETestPEP380Operation.test_delegating_throw_to_non_generator.<locals>.g  sB     ,\* 9$$]+ %]+s%   A> <> A> AAr   r   r,   N)r   r   r   r   z	Yielded 3z	Yielded 4r   r   )r   rb   r   r|   r    r1   r   s   &     @r   &test_delegating_throw_to_non_generator:TestPEP380Operation.test_delegating_throw_to_non_generator  s     	,
	AB1XHQ01  +,AHHQK II?@  
 		  	9QVVAY'788	9s   AB B?#B::B?c                n  a . oV3R lp V! 4       p\        V4       \        ^4       F)  pVP                  ^*4      pSP                  RV: 24       K+  	  V P	                  R4       V P                  SRR.4       R#   \
         d.   pT P                  RTP                  ^ ,          4        Rp?LIRp?ii ; i)z*
Test attempting to send to non-generator
c               3      <"    S P                  R 4       \        ^4       Rj  xL
  S P                  R4       S P                  R4       R#  L(  S P                  R4       i ; i5ir   r   r   s   r   rb   GTestPEP380Operation.test_attempting_to_send_to_non_generator.<locals>.g  r   r   zShould not have yielded: z#was able to send into non-generatorr`   Nr   r   )	r_   rz   r`   r   r.   AttributeErrorassertInr/   r   )r   rb   r   r    rc   r1   r   s   &     @r   (test_attempting_to_send_to_non_generator<TestPEP380Operation.test_attempting_to_send_to_non_generator  s     	,		=BH1XGGBKaAB  II;< 
 		  	-MM&!&&),,	-s   A
A< <B4#B//B4c                  a  ! R R4      oV3R lpV P                  \        4      ;_uu_ 4        V! 4       pV P                  \        V4      ^4       VP	                  ^4       RRR4       V P                  \        4      ;_uu_ 4        V! 4       pV P                  \        V4      ^4       VP                  \        4       RRR4       \        P                  ! 4       ;_uu_ 4       pV! 4       pV P                  \        V4      ^4       VP                  4        V P                  \        VP                  P                  4       RRR4       R#   + '       g   i     L; i  + '       g   i     L; i  + '       g   i     R# ; i)z7
Test subiterator with a broken getattr implementation
c                   2   a  ] tR tRt o R tR tR tRtV tR# )@TestPEP380Operation.test_broken_getattr_handling.<locals>.Brokeni!  c                    V # r   r   r   s   &r   __iter__ITestPEP380Operation.test_broken_getattr_handling.<locals>.Broken.__iter__"      r#   c                    ^# )rl   r   r   s   &r   __next__ITestPEP380Operation.test_broken_getattr_handling.<locals>.Broken.__next__$  s    r#   c                    ^^ ,           R# rl   Nr   )r   attrs   &&r   __getattr__LTestPEP380Operation.test_broken_getattr_handling.<locals>.Broken.__getattr__&  s    !r#   r   N)	r   
__module____qualname____firstlineno__r   r   r   __static_attributes____classdictcell____classdict__s   @r   Brokenr   !  s      r#   r   c               3   2   <"   S ! 4        R j  xL
  R #  L5ir   r   )r   s   r   rb   ;TestPEP380Operation.test_broken_getattr_handling.<locals>.g)  s     xr   N)ro   ZeroDivisionErrorr   r_   r`   r   r   r   catch_unraisable_exceptionr{   
unraisableexc_type)r   rb   r   cmr   s   &   @r   test_broken_getattr_handling0TestPEP380Operation.test_broken_getattr_handling  s	   	 		  011BT"Xq)GGAJ 2
 011BT"Xq)HH^$ 2
 //11RBT"Xq)HHJ.0F0FG 21 21
 21
 211s$   4E8E%AE2E	E/	2F	c                   aaa . oVV3R loR oV3R lpV P                  \        V4       V P                  SR.4       R# )z'
Test exception in initial next() call
c               3   v   <"   SP                  R 4       S ! 4        Rj  xL
  SP                  R4       R#  L5i)g1 about to yield from g2Ng1 should not be herer   r   s   r   r   CTestPEP380Operation.test_exception_in_initial_next_call.<locals>.g1B  s.     LL45tOOLL01 r   c               3   $   "   ^^ ,          x  R# 5ir   r   r   r#   r   r   CTestPEP380Operation.test_exception_in_initial_next_call.<locals>.g2F  s     A#Is   c                  ,   < S! 4       p \        V 4       R # r   )r_   )r   r   s    r   rm   DTestPEP380Operation.test_exception_in_initial_next_call.<locals>.runH  s    BHr#   r  N)ro   r  r   rp   s   & @@@r   #test_exception_in_initial_next_call7TestPEP380Operation.test_exception_in_initial_next_call=  sD     	2		 	+C0' 
 	r#   c                8  aaa . oVV3R lpVV3R lo V! 4       oS F  pSP                  RV: 24       K  	  V P                  R4       V P                  S. RO4       R#   \         d.   pT P                  TP                  ^ ,          R4        Rp?LIRp?ii ; i)z 
Test attempted yield-from loop
c               3      <"   SP                  R 4       Rx  SP                  R4       S ! 4        Rj  xL
  SP                  R4       R#  L5i)g1: startingy1g1: about to yield from g2Nr  r   r   s   r   r   >TestPEP380Operation.test_attempted_yield_from_loop.<locals>.g1U  s?     LL(JLL56tOOLL01 s   1AAAc               3      <"   SP                  R 4       Rx  SP                  R4       S  Rj  xL
  SP                  R4       R#  L5i)g2: startingy2g2: about to yield from g1Nzg2 should not be herer   )r   r   s   r   r   >TestPEP380Operation.test_attempted_yield_from_loop.<locals>.g2\  s=     LL(JLL56MMLL01 s   ,A	AA	r   z$subgenerator didn't raise ValueErrorzgenerator already executingN)r  zYielded: y1r  r  zYielded: y2r  r-   )r   r   rc   r1   r   r   r   s   &   @@@r   test_attempted_yield_from_loop2TestPEP380Operation.test_attempted_yield_from_loopP  s     	2	2	>Ba12 
 II<=  
 		  	FQVVAY'DEE	Fs   %A! !B,#BBc                R  aaa . oVV3R lpVV3R lo ! R R\         4      oV! 4       p\        ^4       F#  p\        V4      pSP                  RV: 24       K%  	  S! R4      pVP	                  V4       V F  pSP                  RV: 24       K  	  V P                  S. RO4       R# )	z-
Test returning value from delegated 'throw'
c               3      <"    SP                  R 4       Rx  S ! 4        Rj  xL
  Rx  SP                  R4       R#  L  SP                  R4       i ; i5ir7   r   r   s   r   r   ITestPEP380Operation.test_returning_value_from_delegated_throw.<locals>.g1x  rJ   rK   c               3      <"    SP                  R 4       Rx  Rx  R#   S  d    SP                  R4       Rx  Rx   R# i ; i5i)r   r=   r>   Caught LunchError in g2zg2 lunch savedzg2 yet more spamNr   )
LunchErrorr   s   r   r   ITestPEP380Operation.test_returning_value_from_delegated_throw.<locals>.g2  sI     )]+$$ )67&&(()s%   A  A A AAAc                       ] tR tRtRtR# )QTestPEP380Operation.test_returning_value_from_delegated_throw.<locals>.LunchErrori  r   Nr   r   r   r   r   r   r#   r   r&  r)        r#   r&  r   r   N)r   rA   r   rB   r%  zYielded g2 yet more spamrD   r   )	Exceptionrz   r_   r   r   r   )	r   r   rb   r|   r    r1   r&  r   r   s	   &     @@@r   )test_returning_value_from_delegated_throw=TestPEP380Operation.test_returning_value_from_delegated_throws  s     	-	)	 	DqAQALL,-  '(	
ALL,-  	 
 		r#   c                   aa . oVV3R lpV3R loV! R4       V! ^4       V! R4       V! \        ^4      4       V P                  S. RO4       R# )z!
Test next and return with value
c                    < S! V 4      p\        V4        SP                  R 4       \        V4       SP                  R4       R#   \         d!   pSP                  RT: 24        Rp?R# Rp?ii ; i)f resuming gf SHOULD NOT BE HERE	f caught N)r_   r   ra   rr   r1   rb   r   s   &  r   f>TestPEP380Operation.test_next_and_return_with_value.<locals>.f  sZ    1BH3^,R34  3a1223s   -A A0A++A0c              3   d   <"   SP                  R 4       Rx  SP                  RV : 24       V # 5i)
g startingNg returning r   )r5  r   s   &r   rb   >TestPEP380Operation.test_next_and_return_with_value.<locals>.g  s)     LL&LLQ01Hr@   Nr   )r9  r1  g returning Nonef caught StopIteration()r9  r1  g returning 1f caught StopIteration(1)r9  r1  g returning (2,)f caught StopIteration((2,))r9  r1  g returning StopIteration(3)(f caught StopIteration(StopIteration(3))ra   r   r   r6  rb   r   s   & @@r   test_next_and_return_with_value3TestPEP380Operation.test_next_and_return_with_value  sM     	3	
 	
$	!	$	-
  
 	r#   c                   aa . oVV3R lpV3R loV! R4       V! ^4       V! R4       V! \        ^4      4       V P                  S. RO4       R# )z!
Test send and return with value
c                    < S! V 4      p\        V4        SP                  R 4       VP                  R4       SP                  R4       R#   \         d!   pSP                  RT: 24        Rp?R# Rp?ii ; i)f sending spam to gr   r2  r3  N)r_   r   r`   ra   r4  s   &  r   r6  >TestPEP380Operation.test_send_and_return_with_value.<locals>.f  s_    1BH32334  3a1223s   3A A6A11A6c              3      <"   SP                  R 4       Rx pSP                  RV: 24       SP                  RV : 24       V # 5i)r9  Nzg received r:  r   )r5  r    r   s   & r   rb   >TestPEP380Operation.test_send_and_return_with_value.<locals>.g  s:     LL&ALLA/0LLQ01Hs   AANr   )r9  rJ  g received 'spam'r<  r=  r9  rJ  rN  r>  r?  r9  rJ  rN  r@  rA  r9  rJ  rN  rB  rC  rD  rE  s   & @@r   test_send_and_return_with_value3TestPEP380Operation.test_send_and_return_with_value  sM     	3	 	
$	!	$	-
 !
 	r#   c           
     :  aaa VV3R loVV3R lp^R\        ^4      3 Fw  o. oV! 4       pSP                  \        V4      4       SP                  \        VP	                  \
        4      4      4       V P                  S^RRS: R2\        S4      .4       Ky  	  R# )zM
Test catching an exception thrown into a
subgenerator and returning a value
c               3   `   <"    ^x  S#   \          d    S P                  R4        S# i ; i5i)rl   inner caught ValueError)r*   r   )r   r   s   r   innerTTestPEP380Operation.test_catching_exception_from_subgen_and_returning.<locals>.inner  s9     8 L  867L8s   . .+.+.c               3   f   <"   S! 4        R j  xL
 p SP                  RV : R24       V x  R #  L 5i)Ninner returned 	 to outerr   )r   rT  r   s    r   outerTTestPEP380Operation.test_catching_exception_from_subgen_and_returning.<locals>.outer  s)      7"ALL<=G #s   1/!1rS  rW  rX  Nr   )ra   r   r_   reprr   r*   r   )r   rY  rb   rT  r   r   s   &  @@@r   1test_catching_exception_from_subgen_and_returningETestPEP380Operation.test_catching_exception_from_subgen_and_returning  s    
		
 mA..EEALLa!LLaggj123U)057U	%  /r#   c                   aa . oV3R loVV3R lp V! 4       p\        V4       VP                  \        4       V P                  R4       V P	                  SRR.4       R#   \         d     L#i ; i)zW
Test throwing GeneratorExit into a subgenerator that
catches it and returns normally.
c               3      <"    S P                  R 4       Rx  S P                  R4       R#   \         d     R# i ; i5iEnter fNExit fr   r   r   s   r   r6  STestPEP380Operation.test_throwing_GeneratorExit_into_subgen_that_returns.<locals>.f  s7     Y'X&  s   ?&- ?<?<?c               3   v   <"   SP                  R 4       S ! 4        Rj  xL
  SP                  R4       R#  L5iEnter gNzExit gr   r6  r   s   r   rb   STestPEP380Operation.test_throwing_GeneratorExit_into_subgen_that_returns.<locals>.g!  ,     LL#sNNLL" r   *subgenerator failed to raise GeneratorExitrg  ra  N)r_   r   r   r.   r   )r   rb   r   r6  r   s   &  @@r   4test_throwing_GeneratorExit_into_subgen_that_returnsHTestPEP380Operation.test_throwing_GeneratorExit_into_subgen_that_returns  sr    
 		#	DBHHH]# IIBC 
 		  		s   'A! !A/.A/c                8  aa . oV3R loVV3R lp V! 4       p\        V4       VP                  \        4       V P                  R4       V P                  SRR.4       R#   \         d.   pT P                  TP                  ^ ,          R4        Rp?LIRp?ii ; i)zM
Test throwing GeneratorExit into a subgenerator that
catches it and yields.
c               3      <"    S P                  R 4       Rx  S P                  R4       R#   \         d	    Rx   R# i ; i5ir`  rc  r   s   r   r6  XTestPEP380Operation.test_throwing_GeneratorExit_into_subgenerator_that_yields.<locals>.f8  s7     Y'X&  s#   A&- AA AA  Ac               3   v   <"   SP                  R 4       S ! 4        Rj  xL
  SP                  R4       R#  L5irf  r   rh  s   r   rb   XTestPEP380Operation.test_throwing_GeneratorExit_into_subgenerator_that_yields.<locals>.g?  rj  r   rk  zgenerator ignored GeneratorExitNrg  ra  )r_   r   r   r.   RuntimeErrorr   r/   r   rb   r   r1   r6  r   s   &   @@r   9test_throwing_GeneratorExit_into_subgenerator_that_yieldsMTestPEP380Operation.test_throwing_GeneratorExit_into_subgenerator_that_yields2  s    
 		#	DBHHH]# IIBC 
 		  	KQVVAY(IJJ	Ks   'A! !B,#BBc                x  aa . oV3R loVV3R lp V! 4       p\        V4       VP                  \        4       V P                  R4       V P                  SRR.4       R#   \         dN   pT P                  TP                  ^ ,          R4       T P                  TP                  \        4        Rp?LiRp?ii ; i)zc
Test throwing GeneratorExit into a subgenerator that
catches it and raises a different exception.
c               3      <"    S P                  R 4       Rx  S P                  R4       R#   \         d    \        R4      hi ; i5i)ra  Nrb  Vorpal bunny encountered)r   r   r*   r   s   r   r6  RTestPEP380Operation.test_throwing_GeneratorExit_into_subgen_that_raises.<locals>.fV  s@     =Y'X&  = !;<<=s   A&- AAAc               3   v   <"   SP                  R 4       S ! 4        Rj  xL
  SP                  R4       R#  L5irf  r   rh  s   r   rb   RTestPEP380Operation.test_throwing_GeneratorExit_into_subgen_that_raises.<locals>.g]  rj  r   r,   ry  Nrg  ra  )	r_   r   r   r.   r*   r   r/   r   r   rt  s   &   @@r   3test_throwing_GeneratorExit_into_subgen_that_raisesGTestPEP380Operation.test_throwing_GeneratorExit_into_subgen_that_raisesP  s    
 	=	#	ABHHH]#
 II?@ 
 	  	@QVVAY(BC!!!--??	@s   'A! !B9,AB44B9c                L    R  pV P                  \        \        V! 4       4       R# )c               3   &   "   R R j  xL
  R #  L5i)Nr   r   r   r#   r   rb   4TestPEP380Operation.test_yield_from_empty.<locals>.gp  s     MM   N)ro   ra   r_   )r   rb   s   & r   test_yield_from_empty)TestPEP380Operation.test_yield_from_emptyo  s    	-qs3r#   c                "  aa V3R  lpV3R loV! 4       oV P                  \        S4      . RO4       V! 4       o\        S4      .p  VP                  SP	                  ^*4      4       K#    \
         d     Mi ; iT P                  T. RO4       R# )c               3   B   <"   ^ x  S ! 4        Rj  xL
  ^x  R#  L
5i    Nr   )twos   r   oneOTestPEP380Operation.test_delegating_generators_claim_to_be_running.<locals>.onev  s      GuG s   c               3   \   <"   ^x   S  Rj  xL
  ^x  R#  L
  \          d     Li ; i5ir   r*   )r   s   r   r  OTestPEP380Operation.test_delegating_generators_claim_to_be_running.<locals>.twoz  s4     G G  s(   ,  , ),),Nr  rl   r   r   )r   r   r_   r   r`   ra   )r   r  resr   r  s   &  @@r   .test_delegating_generators_claim_to_be_runningBTestPEP380Operation.test_delegating_generators_claim_to_be_runningt  s|    		 Ub<0 UBxj	

2772;' 		l+s   #A* *A87A8c                   aaa  ! R  R\         4      oVV3R lpVV3R loV! 4       o\        S4      .p  VP                  SP                  S4      4       K#    \         d     R#  T P                  T. RO4       h ; i)c                       ] tR tRtRtR# )\TestPEP380Operation.test_delegating_generators_claim_to_be_running_with_throw.<locals>.MyErri  r   Nr*  r   r#   r   MyErrr    r+  r#   r  c               3   |   <"    ^ x  S! 4        Rj  xL
   ^x  R#   S  d     Li ; i L  S  d     R# i ; i5ir  r   )r  r  s   r   r  ZTestPEP380Operation.test_delegating_generators_claim_to_be_running_with_throw.<locals>.one  sQ      u	    s<   < 
<,<. <)<)<9<9<c               3      <"    ^x   S Rj  xL
   ^x  R#   S  d     Li ; i L  \          d     L#i ; i  S  d     R# i ; i5ir   r  )r  r   s   r   r  ZTestPEP380Operation.test_delegating_generators_claim_to_be_running_with_throw.<locals>.two  sc           s]   A	 * (* ; A	%A	%A	* 8A	8A	AA	AA	Nr  )r,  r_   r   r   ra   r   )r   r  r  r  r   r  s   &  @@@r   9test_delegating_generators_claim_to_be_running_with_throwMTestPEP380Operation.test_delegating_generators_claim_to_be_running_with_throw  sn    	I 				 UBxj	

288E?+ 		S,/s   #A A<&A<c                x   a aa  ! VV 3R  lR4      oV3R lpV! 4       o\        S4       SP                  4        R# )c                   <   <a  ] tR tRt o R tR tVV3R ltRtV tR# )[TestPEP380Operation.test_delegating_generators_claim_to_be_running_with_close.<locals>.MyIti  c                    V # r   r   r   s   &r   r   dTestPEP380Operation.test_delegating_generators_claim_to_be_running_with_close.<locals>.MyIt.__iter__  r   r#   c                    ^*# *   r   r   s   &r   r   dTestPEP380Operation.test_delegating_generators_claim_to_be_running_with_close.<locals>.MyIt.__next__      r#   c                t   < SP                  SP                  4       SP                  \        \        S4       R # r   )
assertTrue
gi_runningro   r*   r_   )self_r   r   s   &r   r{   aTestPEP380Operation.test_delegating_generators_claim_to_be_running_with_close.<locals>.MyIt.close  s%    .!!*dB7r#   r   N)	r   r   r   r   r   r   r{   r   r   )r   r   r   s   @r   MyItr    s     8 8r#   r  c               3   2   <"   S ! 4        R j  xL
  R #  L5ir   r   )r  s   r   r  ZTestPEP380Operation.test_delegating_generators_claim_to_be_running_with_close.<locals>.one  s     vr   N)r_   r{   )r   r  r  r   s   f @@r   9test_delegating_generators_claim_to_be_running_with_closeMTestPEP380Operation.test_delegating_generators_claim_to_be_running_with_close  s)    	8 	8	UR

r#   c                   a R  oV3R lpR pR pV! V! 4       4       F  pV P                  RV9   4       K  	  V! V! V! 4       4      4       F$  pT P                  RV9   ;'       d    RV9   4       K&  	  R# )c                  b    \         P                  ! 4        U u. uF  q ^,          NK  	  up # u up i )r   )inspectstack)r6  s    r   
call_stackMTestPEP380Operation.test_delegator_is_visible_to_debugger.<locals>.call_stack  s$    ")--/2/QaDD/222s   ,c               3   F   <"   S ! 4       x  S ! 4       x  S ! 4       x  R # 5ir   r   )r  s   r   genFTestPEP380Operation.test_delegator_is_visible_to_debugger.<locals>.gen  s     ,,,s   !c              3   &   "   T  R j  xL
  R #  L5ir   r   rb   s   &r   r   GTestPEP380Operation.test_delegator_is_visible_to_debugger.<locals>.spam       LLr  c              3   &   "   T  R j  xL
  R #  L5ir   r   r  s   &r   r   GTestPEP380Operation.test_delegator_is_visible_to_debugger.<locals>.eggs  r  r  r   r   N)r  )r   r  r   r   r  r  s   &    @r   %test_delegator_is_visible_to_debugger9TestPEP380Operation.test_delegator_is_visible_to_debugger  sl    	3	
		 #%[EOOFeO, ! $su+&EOOFeO??%@ 'r#   c                t   aa  ! R  R4      oVV3R lpRo\        V! 4       4       V P                  S^*4       R# )c                   ,   a  ] tR tRt o R tR tRtV tR# )?TestPEP380Operation.test_custom_iterator_return.<locals>.MyIteri  c                    V # r   r   r   s   &r   r   HTestPEP380Operation.test_custom_iterator_return.<locals>.MyIter.__iter__  r   r#   c                    \        ^*4      hr  )ra   r   s   &r   r   HTestPEP380Operation.test_custom_iterator_return.<locals>.MyIter.__next__  s    #B''r#   r   N)r   r   r   r   r   r   r   r   r   s   @r   MyIterr    s     ( (r#   r  c               3   2   <"   S ! 4        R j  xL
 oR #  L5ir   r   )r  r   s   r   r  <TestPEP380Operation.test_custom_iterator_return.<locals>.gen  s     #X%C%r   N)r   r   )r   r  r  r   s   & @@r   test_custom_iterator_return/TestPEP380Operation.test_custom_iterator_return  s2    	( 	(
	& SUb!r#   c                  a R  oV3R lpR p\        4       ;_uu_ 4        V! 4       pV! 4       pVP                  R4       VP                  V4       VP                  V4       ??\        4        RRR4       R#   + '       g   i     R# ; i)c               3      "   R x  R # 5ir   r   r   r#   r   	innermostDTestPEP380Operation.test_close_with_cleared_frame.<locals>.innermost  s     s   	c               3   :   <"   R x p S! 4        R j  xL
  R #  L5ir   r   )	outer_genr  s    r   rT  @TestPEP380Operation.test_close_with_cleared_frame.<locals>.inner  s     I {""s   c               3   .   "   R x p T  R j  xL
  R #  L5ir   r   )	inner_gens    r   rY  @TestPEP380Operation.test_close_with_cleared_frame.<locals>.outer  s     I   s   
N)r   r`   r   )r   rT  rY  r  r  r  s   &    @r   test_close_with_cleared_frame1TestPEP380Operation.test_close_with_cleared_frame  sd    &		#	! \\IINN4 NN9%NN9%L \\\s   AA88B		c                   aa  ! V3R  lR4      oV3R lpV! 4       p\        V4       RoVP                  R4       V P                  SR4       R# )c                   :   <a  ] tR tRt o R tR tV3R ltRtV tR# )HTestPEP380Operation.test_send_tuple_with_custom_generator.<locals>.MyGeni  c                    V # r   r   r   s   &r   r   QTestPEP380Operation.test_send_tuple_with_custom_generator.<locals>.MyGen.__iter__  r   r#   c                    ^*# r  r   r   s   &r   r   QTestPEP380Operation.test_send_tuple_with_custom_generator.<locals>.MyGen.__next__  r  r#   c                   < VoR # r   r   )r   whatr   s   &&r   r`   MTestPEP380Operation.test_send_tuple_with_custom_generator.<locals>.MyGen.send  s    r#   r   N)	r   r   r   r   r   r   r`   r   r   )r   r   s   @r   MyGenr    s      r#   r  c               3   2   <"   S! 4        R j  xL
 p R #  L5ir   r   )r   r  s    r   rY  HTestPEP380Operation.test_send_tuple_with_custom_generator.<locals>.outer  s      7"A"r   N)rl   r   r      )r_   r`   r   )r   rY  rb   r  r   s   &  @@r   %test_send_tuple_with_custom_generator9TestPEP380Operation.test_send_tuple_with_custom_generator  sA    	 		#GQ	|L)r#   r   N)*r   r   r   r   __doc__r!   r2   rE   rP   rd   rq   r}   r   r   r   r   r   r   r   r   r   r   r  r  r  r-  rF  rO  r\  rl  ru  r}  r  r  r  r  r  r  r  r  r   r   r   s   @r   r   r      s     .>:#J*X'R D'R&P0-1f ",@6H@&!F)V(T-^:<<>4
,4$L A*"%N* *r#   r   c                   b   a  ] tR tRt o R tR tR tR tR tR t	R t
R	 tR
 tR tR tRtV tR# )TestInterestingEdgeCasesi!  c                "   V P                  \        4      ;_uu_ 4       p\        V4       R R R 4       V P                  XP                  P
                  4       V P                  VP                  P                  4       R #   + '       g   i     L\; ir   )ro   ra   r_   assertIsNone	exceptionr   r   )r   iteratorcaughts   && r   assert_stop_iteration.TestInterestingEdgeCases.assert_stop_iteration#  s^    }--N .&**001&**667 .-s   A>>B	c                .    V P                  \        R 4      # )z ^generator raised StopIteration$assertRaisesRegexrs  r   s   &r   &assert_generator_raised_stop_iteration?TestInterestingEdgeCases.assert_generator_raised_stop_iteration)  s    %%l4WXXr#   c                .    V P                  \        R 4      # )z!^generator ignored GeneratorExit$r  r   s   &r   'assert_generator_ignored_generator_exit@TestInterestingEdgeCases.assert_generator_ignored_generator_exit,  s    %%l4XYYr#   c           	     l	  aaaa \        4       o\        4       o\        4       oVVV3R  loV3R lpV P                  R4      ;_uu_ 4        V! 4       pV P                  \        V4      S4       VP	                  4        V P                  V4       RRR4       V P                  R4      ;_uu_ 4        V! 4       pV P                  \        V4      S4       \        4       pV P                  \        4      ;_uu_ 4       pVP                  V4       RRR4       V P                  XP                  V4       V P                  VP                  P                  4       V P                  V4       RRR4       V P                  R4      ;_uu_ 4        V! 4       pV P                  \        V4      S4       \        4       pV P                  4       ;_uu_ 4       pVP                  V4       RRR4       V P                  XP                  P                  V4       V P                  VP                  P                  P                  4       V P                  V4       RRR4       V P                  R4      ;_uu_ 4        V! 4       pV P                  \        V4      S4       \        4       pV P                  \        4      ;_uu_ 4       pVP                  V4       RRR4       V P                  XP                  V4       V P                  VP                  P                  4       V P                  V4       RRR4       V P                  R4      ;_uu_ 4        V! 4       pV P                  \        V4      S4       \        4       pV P                  \        4      ;_uu_ 4       pVP                  V4       RRR4       V P                  XP                  V4       V P                  VP                  P                  4       V P                  V4       RRR4       R#   + '       g   i     EL~; i  + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     ELk; i  + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     ELb; i  + '       g   i     L; i  + '       g   i     R# ; i)c               3       <"   Sx  Sx  S # 5ir   r   returnedyielded_firstyielded_seconds   r   rT  ATestInterestingEdgeCases.test_close_and_throw_work.<locals>.inner5  s       Os   c               3   .   <"   S ! 4        R j  xL
 #  L5ir   r   rT  s   r   rY  ATestInterestingEdgeCases.test_close_and_throw_work.<locals>.outer:       $w&'&   r{   Nthrow GeneratorExitthrow StopIterationthrow BaseExceptionthrow Exception)objectsubTestassertIsr_   r{   r  r   ro   r   r  r  r   ra   r  BaseExceptionr,  	r   rY  rb   thrownr  rT  r  r   r  s	   &    @@@@r   test_close_and_throw_work2TestInterestingEdgeCases.test_close_and_throw_work/  s7   8	
	( \\'""AMM$q'=1GGI&&q)	 # \\/00AMM$q'=1"_F""=11V 2MM&**F3f..::;&&q) 1 \\/00AMM$q'=1"_F<<>>& ?MM&**66?f..::FFG&&q) 1 \\/00AMM$q'=1"_F""=11V 2MM&**F3f..::;&&q) 1 \\+,,AMM$q'=1[F""9-- .MM&**F3f..::;&&q) -,K #"" 211	 100 ?>> 100 211	 100 .-	 -,,s   
AP/A
P+9P	AP+AQP?	A.Q,A
Q;6Q'	AQ;A
R"R	AR"P	P("	P++P<	?Q
	QQ$	'Q82	Q;;R	RR""R3	c           	     
  aaaaa	 \        4       o\        4       o	\        4       oVVVV	3R  loV3R lpV P                  R4      ;_uu_ 4        V! 4       pV P                  \        V4      S4       \	        4       oVP                  4        V P                  V4       RRR4       V P                  R4      ;_uu_ 4        V! 4       pV P                  \        V4      S4       \	        4       o\	        4       pV P                  \        4      ;_uu_ 4       pVP                  V4       RRR4       V P                  XP                  V4       V P                  VP                  P                  4       V P                  V4       RRR4       V P                  R4      ;_uu_ 4        V! 4       pV P                  \        V4      S4       \	        4       o\        4       pV P                  \        4      ;_uu_ 4       pVP                  V4       RRR4       V P                  XP                  S4       V P                  VP                  P                  V4       V P                  VP                  P                  P                  4       V P                  V4       RRR4       V P                  R4      ;_uu_ 4        V! 4       pV P                  \        V4      S4       \	        4       o\        4       pV P                  \        4      ;_uu_ 4       pVP                  V4       RRR4       V P                  XP                  S4       V P                  VP                  P                  V4       V P                  VP                  P                  P                  4       V P                  V4       RRR4       V P                  R4      ;_uu_ 4        V! 4       pV P                  \        V4      S4       \	        4       o\        4       pV P                  \        4      ;_uu_ 4       pVP                  V4       RRR4       V P                  XP                  S4       V P                  VP                  P                  V4       V P                  VP                  P                  P                  4       V P                  V4       RRR4       R#   + '       g   i     EL'; i  + '       g   i     EL; i  + '       g   i     ELn; i  + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     EL); i  + '       g   i     R# ; i)c               3   0   <"    Sx  Sx  SS h  S h; i5ir   r   raisedr  r   r  s   r   rT  QTestInterestingEdgeCases.test_close_and_throw_raise_generator_exit.<locals>.innerr  $     ##$$f   	 c               3   .   <"   S ! 4        R j  xL
 #  L5ir   r   r  s   r   rY  QTestInterestingEdgeCases.test_close_and_throw_raise_generator_exit.<locals>.outerz  r  r  r{   Nr  r	  r
  r  )r  r  r  r_   r   r{   r  ro   r   r  r  r   ra   r  r,  )
r   rY  rb   r  r  rT  r  r  r   r  s
   &    @@@@@r   )test_close_and_throw_raise_generator_exitBTestInterestingEdgeCases.test_close_and_throw_raise_generator_exitl  s   8	 		( \\'""AMM$q'=1"_F GGI&&q) # \\/00AMM$q'=1"_F"_F""=11V 2
 MM&**F3f..::;&&q) 1 \\/00AMM$q'=1"_F"_F""=11V 2MM&**F3MM&**66?f..::FFG&&q) 1 \\/00AMM$q'=1"_F"_F""=11V 2MM&**F3MM&**66?f..::FFG&&q) 1 \\+,,AMM$q'=1"_F[F""=11V 2MM&**F3MM&**66?f..::FFG&&q) -,_ #"" 211 100& 211 100" 211 100" 211 -,,s   AR8;AS S	!AS AT0S4	B
T-AT0T	B
T0>AUU	$B
U8S		S	S  S1	4T?	TT	T-'	T00U	U	UU)	c           	       aaaaa	 \        4       o\        4       o	\        4       oVVVV	3R  loV3R lpV P                  R4      ;_uu_ 4        V! 4       pV P                  \        V4      S4       \	        4       oV P                  4       ;_uu_ 4       pVP                  4        RRR4       V P                  XP                  P                  S4       V P                  VP                  P                  P                  \        4       V P                  VP                  P                  P                  P                  4       V P                  V4       RRR4       V P                  R4      ;_uu_ 4        V! 4       pV P                  \        V4      S4       \	        4       o\        4       pV P                  4       ;_uu_ 4       pVP                  V4       RRR4       V P                  XP                  P                  S4       V P                  VP                  P                  P                  \        4       V P                  VP                  P                  P                  P                  4       V P                  V4       RRR4       V P                  R4      ;_uu_ 4        V! 4       pV P                  \        V4      S4       \	        4       o\	        4       pV P                  4       ;_uu_ 4       pVP                  V4       RRR4       V P                  XP                  P                  S4       V P                  VP                  P                  P                  V4       V P                  VP                  P                  P                  P                  4       V P                  V4       RRR4       V P                  R4      ;_uu_ 4        V! 4       pV P                  \        V4      S4       \	        4       o\        4       pV P                  4       ;_uu_ 4       pVP                  V4       RRR4       V P                  XP                  P                  S4       V P                  VP                  P                  P                  V4       V P                  VP                  P                  P                  P                  4       V P                  V4       RRR4       V P                  R4      ;_uu_ 4        V! 4       pV P                  \        V4      S4       \	        4       o\        4       pV P                  4       ;_uu_ 4       pVP                  V4       RRR4       V P                  XP                  P                  S4       V P                  VP                  P                  P                  V4       V P                  VP                  P                  P                  P                  4       V P                  V4       RRR4       R#   + '       g   i     ELk; i  + '       g   i     EL; i  + '       g   i     ELe; i  + '       g   i     EL; i  + '       g   i     EL_; i  + '       g   i     EL; i  + '       g   i     EL]; i  + '       g   i     EL; i  + '       g   i     EL[; i  + '       g   i     R# ; i)c               3   0   <"    Sx  Sx  SS h  S h; i5ir   r   r  s   r   rT  QTestInterestingEdgeCases.test_close_and_throw_raise_stop_iteration.<locals>.inner  r  r  c               3   .   <"   S ! 4        R j  xL
 #  L5ir   r   r  s   r   rY  QTestInterestingEdgeCases.test_close_and_throw_raise_stop_iteration.<locals>.outer  r  r  r{   Nr  r	  r
  r  )r  r  r  r_   ra   r  r{   r  r   r   r   r  r  r   r  r,  
r   rY  rb   r  r  rT  r  r  r   r  s
   &    @@@@@r   )test_close_and_throw_raise_stop_iterationBTestInterestingEdgeCases.test_close_and_throw_raise_stop_iteration  s   8	 		( \\'""AMM$q'=1"_F<<>>&	 ?MM&**66?!!&"2"2">">"J"JMZf..::FFRRS&&q) # \\/00AMM$q'=1"_F"_F<<>>& ?MM&**66? !!&"2"2">">"J"JMZf..::FFRRS&&q) 1 \\/00AMM$q'=1"_F"_F<<>>& ?MM&**66?MM&**66BBFKf..::FFRRS&&q) 1 \\/00AMM$q'=1"_F"_F<<>>& ?MM&**66?MM&**66BBFKf..::FFRRS&&q) 1 \\+,,AMM$q'=1"_F[F<<>>& ?MM&**66?MM&**66BBFKf..::FFRRS&&q) -,a ?>> #""$ ?>> 100* ?>> 100& ?>> 100& ?>> -,,s   AXX	"B,X/AY >X,	B,Y AY(,Y	>B(Y(AZY<	(B(Z1AZ8 Z$	B(Z8X	XX)	,X=7	Y  Y	Y%	Y((Y9	<Z	ZZ!	$Z5/	Z88[		c           	       aaaaa	 \        4       o\        4       o	\        4       oVVVV	3R  loV3R lpV P                  R4      ;_uu_ 4        V! 4       pV P                  \        V4      S4       \	        4       oV P                  \        4      ;_uu_ 4       pVP                  4        RRR4       V P                  XP                  S4       V P                  VP                  P                  \        4       V P                  VP                  P                  P                  4       V P                  V4       RRR4       V P                  R4      ;_uu_ 4        V! 4       pV P                  \        V4      S4       \	        4       o\        4       pV P                  \        4      ;_uu_ 4       pVP                  V4       RRR4       V P                  XP                  S4       V P                  VP                  P                  \        4       V P                  VP                  P                  P                  4       V P                  V4       RRR4       V P                  R4      ;_uu_ 4        V! 4       pV P                  \        V4      S4       \	        4       o\        4       pV P                  \        4      ;_uu_ 4       pVP                  V4       RRR4       V P                  XP                  S4       V P                  VP                  P                  V4       V P                  VP                  P                  P                  4       V P                  V4       RRR4       V P                  R4      ;_uu_ 4        V! 4       pV P                  \        V4      S4       \	        4       o\	        4       pV P                  \        4      ;_uu_ 4       pVP                  V4       RRR4       V P                  XP                  S4       V P                  VP                  P                  V4       V P                  VP                  P                  P                  4       V P                  V4       RRR4       V P                  R4      ;_uu_ 4        V! 4       pV P                  \        V4      S4       \	        4       o\        4       pV P                  \        4      ;_uu_ 4       pVP                  V4       RRR4       V P                  XP                  S4       V P                  VP                  P                  V4       V P                  VP                  P                  P                  4       V P                  V4       RRR4       R#   + '       g   i     EL; i  + '       g   i     ELo; i  + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     EL&; i  + '       g   i     EL; i  + '       g   i     EL=; i  + '       g   i     R# ; i)c               3   0   <"    Sx  Sx  SS h  S h; i5ir   r   r  s   r   rT  QTestInterestingEdgeCases.test_close_and_throw_raise_base_exception.<locals>.inner  r  r  c               3   .   <"   S ! 4        R j  xL
 #  L5ir   r   r  s   r   rY  QTestInterestingEdgeCases.test_close_and_throw_raise_base_exception.<locals>.outer  r  r  r{   Nr  r	  r
  r  )r  r  r  r_   r  ro   r{   r  r   r   r   r  r  r   ra   r,  r$  s
   &    @@@@@r   )test_close_and_throw_raise_base_exceptionBTestInterestingEdgeCases.test_close_and_throw_raise_base_exception  sP   8	 		( \\'""AMM$q'=1"_F""=11V	 2MM&**F3!!&"2"2">">Nf..::FFG&&q) # \\/00AMM$q'=1"_F"_F""=11V 2MM&**F3 !!&"2"2">">Nf..::FFG&&q) 1 \\/00AMM$q'=1"_F"_F""=11V 2MM&**F3MM&**66?f..::FFG&&q) 1 \\/00AMM$q'=1"_F"_F""=11V 2MM&**F3MM&**66?f..::FFG&&q) 1 \\+,,AMM$q'=1"_F[F""=11V 2MM&**F3MM&**66?f..::FFG&&q) -,[ 211	 #""  211 100& 211 100" 211 100" 211 -,,   A
VV	'BVAW*V/	<BW+AW+?W	B
W+<AXW?	"B
XAX;!X'	3B
X;V	VV,	/W :	WW	W("	W++W<	?X
	XX$	'X82	X;;Y	c           	       aaaaa	 \        4       o\        4       o	\        4       oVVVV	3R  loV3R lpV P                  R4      ;_uu_ 4        V! 4       pV P                  \        V4      S4       \	        4       oV P                  \        4      ;_uu_ 4       pVP                  4        RRR4       V P                  XP                  S4       V P                  VP                  P                  \        4       V P                  VP                  P                  P                  4       V P                  V4       RRR4       V P                  R4      ;_uu_ 4        V! 4       pV P                  \        V4      S4       \	        4       o\        4       pV P                  \        4      ;_uu_ 4       pVP                  V4       RRR4       V P                  XP                  S4       V P                  VP                  P                  \        4       V P                  VP                  P                  P                  4       V P                  V4       RRR4       V P                  R4      ;_uu_ 4        V! 4       pV P                  \        V4      S4       \	        4       o\        4       pV P                  \        4      ;_uu_ 4       pVP                  V4       RRR4       V P                  XP                  S4       V P                  VP                  P                  V4       V P                  VP                  P                  P                  4       V P                  V4       RRR4       V P                  R4      ;_uu_ 4        V! 4       pV P                  \        V4      S4       \	        4       o\        4       pV P                  \        4      ;_uu_ 4       pVP                  V4       RRR4       V P                  XP                  S4       V P                  VP                  P                  V4       V P                  VP                  P                  P                  4       V P                  V4       RRR4       V P                  R4      ;_uu_ 4        V! 4       pV P                  \        V4      S4       \	        4       o\	        4       pV P                  \        4      ;_uu_ 4       pVP                  V4       RRR4       V P                  XP                  S4       V P                  VP                  P                  V4       V P                  VP                  P                  P                  4       V P                  V4       RRR4       R#   + '       g   i     EL; i  + '       g   i     ELo; i  + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     EL&; i  + '       g   i     EL; i  + '       g   i     EL=; i  + '       g   i     R# ; i)c               3   0   <"    Sx  Sx  SS h  S h; i5ir   r   r  s   r   rT  LTestInterestingEdgeCases.test_close_and_throw_raise_exception.<locals>.inner_  r  r  c               3   .   <"   S ! 4        R j  xL
 #  L5ir   r   r  s   r   rY  LTestInterestingEdgeCases.test_close_and_throw_raise_exception.<locals>.outerg  r  r  r{   Nr  r	  r
  r  )r  r  r  r_   r,  ro   r{   r  r   r   r   r  r  r   ra   r  r$  s
   &    @@@@@r   $test_close_and_throw_raise_exception=TestInterestingEdgeCases.test_close_and_throw_raise_exceptionY  sP   8	 		( \\'""AMM$q'=1[F""9--	 .MM&**F3!!&"2"2">">Nf..::FFG&&q) # \\/00AMM$q'=1[F"_F""9-- .MM&**F3 !!&"2"2">">Nf..::FFG&&q) 1 \\/00AMM$q'=1[F"_F""9-- .MM&**F3MM&**66?f..::FFG&&q) 1 \\/00AMM$q'=1[F"_F""9-- .MM&**F3MM&**66?f..::FFG&&q) 1 \\+,,AMM$q'=1[F[F""9-- .MM&**F3MM&**66?f..::FFG&&q) -,[ .--	 #""  .-- 100& .-- 100" .-- 100" .-- -,,r.  c           	     
  aaaa \        4       o\        4       o\        4       oVVV3R  loV3R lpV P                  R4      ;_uu_ 4        V! 4       pV P                  \        V4      S4       V P	                  4       ;_uu_ 4       pVP                  4        RRR4       V P                  XP                  P                  4       V P                  V4       RRR4       V P                  R4      ;_uu_ 4        V! 4       pV P                  \        V4      S4       \        4       pV P	                  4       ;_uu_ 4       pVP                  V4       RRR4       V P                  XP                  P                  4       V P                  V4       RRR4       V P                  R4      ;_uu_ 4        V! 4       pV P                  \        V4      S4       \        4       pV P                  VP                  V4      S4       V P                  4       ;_uu_ 4       p\        V4       RRR4       V P                  XP                  P                  V4       V P                  VP                  P                  P                  4       V P                  V4       RRR4       V P                  R4      ;_uu_ 4        V! 4       pV P                  \        V4      S4       \        4       pV P                  VP                  V4      S4       V P!                  \        4      ;_uu_ 4       p\        V4       RRR4       V P                  XP                  V4       V P                  VP                  P                  4       V P                  V4       RRR4       V P                  R4      ;_uu_ 4        V! 4       pV P                  \        V4      S4       \#        4       pV P                  VP                  V4      S4       V P!                  \"        4      ;_uu_ 4       p\        V4       RRR4       V P                  XP                  V4       V P                  VP                  P                  4       V P                  V4       RRR4       R#   + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     EL^; i  + '       g   i     EL4; i  + '       g   i     EL; i  + '       g   i     EL[; i  + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     R# ; i)c               3   4   <"    Sx  Sx  S #   Sx  i ; i5ir   r   r  s   r   rT  BTestInterestingEdgeCases.test_close_and_throw_yield.<locals>.inner  s%     %##$$O %$s    c               3   .   <"   S ! 4        R j  xL
 #  L5ir   r   r  s   r   rY  BTestInterestingEdgeCases.test_close_and_throw_yield.<locals>.outer  r  r  r{   Nr  r	  r
  r  )r  r  r  r_   r  r{   r  r  r   r  r   r   ra   r   r  r  ro   r,  )	r   rY  rb   r  r  rT  r  r   r  s	   &    @@@@r   test_close_and_throw_yield3TestInterestingEdgeCases.test_close_and_throw_yield  s   8		( \\'""AMM$q'=1 ==??6	 @f..::;&&q) # \\/00AMM$q'=1"_F ==??6 @f..::;&&q) 1 \\/00AMM$q'=1"_FQWWV_n=<<>>&Q ?MM&**66?f..::FFG&&q) 1 \\/00AMM$q'=1"_FQWWV_n=""=11VQ 2MM&**F3f..::;&&q) 1 \\+,,AMM$q'=1[FQWWV_n=""9--Q .MM&**F3f..::;&&q) -,O @?? #""  @?? 100" ?>> 100" 211 100  .-- -,,s   
;RQ9	>R5AR5:R!	>R5+A&SS		A.S,A+TS1	#ATA+T-	T	AT-9R
	RR	!R2,	R55S		S	SS.	1T<	TT	T*$	T--T>	c           	     	  aaaa \        4       o\        4       o\        4       oVVV3R  loV3R lpV P                  R4      ;_uu_ 4        V! 4       pV P                  \        V4      S4       VP	                  4        V P                  V4       RRR4       V P                  R4      ;_uu_ 4        V! 4       pV P                  \        V4      S4       \        4       pV P                  \        4      ;_uu_ 4       pVP                  V4       RRR4       V P                  XP                  V4       V P                  VP                  P                  4       V P                  V4       RRR4       V P                  R4      ;_uu_ 4        V! 4       pV P                  \        V4      S4       \        4       pV P                  \        4      ;_uu_ 4       pVP                  V4       RRR4       V P                  XP                  P                  S4       V P                  VP                  P                  4       V P                  V4       RRR4       V P                  R4      ;_uu_ 4        V! 4       pV P                  \        V4      S4       \        4       pV P                  \        4      ;_uu_ 4       pVP                  V4       RRR4       V P                  XP                  P                  S4       V P                  VP                  P                  4       V P                  V4       RRR4       V P                  R4      ;_uu_ 4        V! 4       pV P                  \        V4      S4       \        4       pV P                  \        4      ;_uu_ 4       pVP                  V4       RRR4       V P                  XP                  P                  S4       V P                  VP                  P                  4       V P                  V4       RRR4       R#   + '       g   i     EL; i  + '       g   i     EL$; i  + '       g   i     EL; i  + '       g   i     ELu; i  + '       g   i     EL%; i  + '       g   i     EL; i  + '       g   i     ELl; i  + '       g   i     EL; i  + '       g   i     R# ; i)c               3   2   <"    Sx  Sx  S #     S # ; i5ir   r   r  s   r   rT  CTestInterestingEdgeCases.test_close_and_throw_return.<locals>.inner  s,     ##$$ OOs    c               3   .   <"   S ! 4        R j  xL
 #  L5ir   r   r  s   r   rY  CTestInterestingEdgeCases.test_close_and_throw_return.<locals>.outer  r  r  r{   Nr  r	  r
  r  )r  r  r  r_   r{   r  r   ro   r   r  r  r   ra   r   r  r,  r  s	   &    @@@@r   test_close_and_throw_return4TestInterestingEdgeCases.test_close_and_throw_return  sF   8		( \\'""AMM$q'=1 GGI&&q) # \\/00AMM$q'=1"_F ""=11V 2MM&**F3f..::;&&q) 1 \\/00AMM$q'=1"_F""=11V 2MM&**00(;f..::;&&q) 1 \\/00AMM$q'=1"_F""=11V 2MM&**00(;f..::;&&q) 1 \\+,,AMM$q'=1[F""=11V 2MM&**00(;f..::;&&q) -,Q #"" 211 100  211	 100 211	 100 211	 -,,s   
AP/A
P:9P&	AP:A
Q"Q	"A$Q"'A
R
1Q6	A$R
A
R2R	$A$R2P#	&P71	P::Q	Q	Q""Q3	6R	R

R	R/)	R22S	c                   a  ! R  R4      oV3R lpV P                  \        R4      ;_uu_ 4        \        \        V! 4       4      4       RRR4       R#   + '       g   i     R# ; i)c                   &   a  ] tR tRt o R tRtV tR# );TestInterestingEdgeCases.test_throws_in_iter.<locals>.Sillyi4  c                    \        R 4      h)&nobody expects the spanish inquisition)rs  r   s   &r   r   DTestInterestingEdgeCases.test_throws_in_iter.<locals>.Silly.__iter__5  s    "#KLLr#   r   N)r   r   r   r   r   r   r   r   s   @r   SillyrF  4  s     M Mr#   rJ  c               3   2   <"   S ! 4        R j  xL
  R #  L5ir   r   )rJ  s   r   my_generatorBTestInterestingEdgeCases.test_throws_in_iter.<locals>.my_generator8  s     wr   rH  N)r  rs  r_   iter)r   rL  rJ  s   & @r   test_throws_in_iter,TestInterestingEdgeCases.test_throws_in_iter1  sI    	M 	M	 ##L2Z[[ln%& \[[[s   AA%	r   N)r   r   r   r   r  r  r  r  r  r%  r,  r4  r;  rB  rO  r   r   r   s   @r   r  r  !  sP     8YZ;*zJ*XQ*fL*\L*\E*NA*F' 'r#   r  __main__)r  unittestr  test.supportr   r   r   testr   TestCaser   r  r   mainr   r#   r   <module>rW     s]      @ @ O*(++ O*b ['x00 ['| zMMO r#   