+
    Bi*                         ^ RI t R t ! R R]4      t ! R R]4      tRR ltR tR	 t ! R
 R] P                  4      t
 ! R R] P                  4      t]R8X  d   ] P                  ! 4        R# R# )    Nc                     a  V 3R  lpV# )c                 >   < V P                   P                  S4       V # N)__dict__update)funckwdss   &+/usr/lib/python3.14/test/test_decorators.pydecoratefuncattrs.<locals>.decorate   s    T"     )r	   r   s   l r
   	funcattrsr      s     Or   c                   0   a  ] tR t^
t o ]R 4       tRtV tR# )MiscDecoratorsc                   a  V 3R  lpV# )c                 &   < SV P                   R &   V # )author)r   )r   names   &r
   r   'MiscDecorators.author.<locals>.decorate   s    &*DMM(#Kr   r   )r   r   s   f r
   r   MiscDecorators.author   s    	 r   r   N)__name__
__module____qualname____firstlineno__staticmethodr   __static_attributes____classdictcell____classdict__s   @r
   r   r   
   s      r   r   c                   &   a  ] tR t^t o R tRtV tR# )DbcheckErrorc                T    \         P                  V R V: RV: RV: RV: R2	4       R# )zdbcheck z failed (func=z args=z kwds=)N)	Exception__init__)selfexprstrr   argsr	   s   &&&&&r
   r&   DbcheckError.__init__   s     4#T4"7 	8r   r   N)r   r   r   r   r&   r   r   r   s   @r
   r"   r"      s     8 8r   r"   c                   a aa V VV3R lpV# )z+Decorator to implement debugging assertionsc                 \   <a a \        SR S P                  ,          R4      oVVV VV3R lpV# )z
dbcheck-%sevalc                  T   < \        SSS4      '       g   \        SSW4      hS! V / VB # r   )r-   r"   )r)   r	   exprr(   r   globalslocalss   *,r
   check(dbcheck.<locals>.decorate.<locals>.check   s1    gv.."7D$==&&&r   )compiler   )r   r2   r/   r(   r0   r1   s   f @r
   r   dbcheck.<locals>.decorate   s+    wt}} <fE	' 	' r   r   )r(   r0   r1   r   s   fff r
   dbcheckr6      s     Or   c                   a  V 3R lpV# )z&Decorator to count calls to a functionc                 L   <a a S P                   o^ SS&   VV V3R lpSVn         V# )r   c                  >   < SS;;,          ^,          uu&   S! V / VB # )   r   )r)   r	   countsr   	func_names   *,r
   call*countcalls.<locals>.decorate.<locals>.call-   s#    9"&&&r   r   )r   r=   r<   r;   s   f @r
   r   countcalls.<locals>.decorate*   s)    MM	y	' "r   r   )r;   r   s   f r
   
countcallsrA   (   s     Or   c                 >   a a / oV V3R  lpS P                   Vn         V# )c                  x   <  SV ,          #   \          d    S! T !  pTST &   Tu # \         d
    S! T !  u # i ; ir   )KeyError	TypeError)r)   resr   saveds   * r
   r=   memoize.<locals>.call8   sJ    	; 	+CE$KJ 	;	s    9999r?   )r   r=   rG   s   f @r
   memoizerI   6   s    E	 MMDMKr   c                   t   a  ] tR t^Gt 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V tR# )TestDecoratorsc                     ! R  R\         4      pV P                  VP                  4       ^*4       V P                  V! 4       P                  4       ^*4       R# )c                   0   a  ] tR t^Jt o ]R 4       tRtV tR# )%TestDecorators.test_single.<locals>.Cc                     ^*# *   r   r   r   r
   foo)TestDecorators.test_single.<locals>.C.fooK   s     r   r   N)r   r   r   r   r   rR   r   r   r   s   @r
   CrN   J   s        r   rT   N)objectassertEqualrR   r'   rT   s   & r
   test_singleTestDecorators.test_singleI   s>    	! 	! 	"%B'r   c                :   R  pV! V4      pV P                  VP                  V4       V P                  VP                  V4       R F'  pV P                  \        WE4      \        W54      4       K)  	  V P	                  \        V4      VP                  V4      4       V# )c                     V # r   r   xs   &r
   r   0TestDecorators.check_wrapper_attrs.<locals>.funcQ   s    Hr   )r   r   r   __doc____annotations__)assertIs__func____wrapped__getattrrV   reprformat)r'   method_wrapper
format_strr   wrapperattrs   &&&   r
   check_wrapper_attrs"TestDecorators.check_wrapper_attrsP   s    	 &g&&-g))403DMM''0!$-/3
 	g
(9(9$(?@r   c                b    V P                  \        R 4      pV P                  V! ^4      ^4       R# )z<staticmethod({!r})>N)rk   r   rV   r'   ri   s   & r
   test_staticmethod TestDecorators.test_staticmethod`   s+    **<9OP 	Q'r   c                `    V P                  \        R 4      pV P                  \        V^4       R# )z<classmethod({!r})>N)rk   classmethodassertRaisesrE   rn   s   & r
   test_classmethodTestDecorators.test_classmethodf   s'    **;8MN)Wa0r   c                    \        4       pVP                  R 4      R 4       pV P                  V! 4       ^*4       V P                  VP                  R 4       R# )Cleesec                      ^*# rP   r   r   r   r
   rR   'TestDecorators.test_dotted.<locals>.foom   s    r   N)r   r   rV   )r'   
decoratorsrR   s   &  r
   test_dottedTestDecorators.test_dottedk   sI    #%
			8	$ 
%#X.r   c           	        R  pRp\        ^^R7      pV! V/ VB R 4       pV P                  V! 4       ^*4       V P                  VP                  W#34       V! RRRRR7      R 4       pV P                  V! 4       ^T4       V P                  VP                  R\        RRR7      34       V! ^^4      R	 4       pV P                  VP                  R/ 34       R
# )c                     a a V V3R  lpV# )c                 &   < \        V R SS34       V # )dbval)setattr)r   r)   r	   s   &r
   r   @TestDecorators.test_argforms.<locals>.noteargs.<locals>.decoratew   s    gd|4r   r   )r)   r	   r   s   jl r
   noteargs.TestDecorators.test_argforms.<locals>.noteargsv   s     Or   )onetwoc                      ^*# rP   r   r   r   r
   f1(TestDecorators.test_argforms.<locals>.f1~       r   terrygilliamidlecleese)ericjohnc                      ^T# )T   r   r   r   r
   f2(TestDecorators.test_argforms.<locals>.f2   r   r   c                      R # r   r   r   r   r
   f3(TestDecorators.test_argforms.<locals>.f3   s    r   N)Nowisthetime)r   r   )r:      )dictrV   r   )r'   r   r)   r	   r   r   r   s   &      r
   test_argformsTestDecorators.test_argformsr   s    	 .q!	4	 4	  
!r"D<0	'96	A 
Br"$8%)vH%E$G 	H 
!Q 
FB<0r   c                    \        R 4      R 4       pV P                  V! ^^4      ^4       V P                  \        V^R4       R# )zargs[1] is not Nonec                     W,           # r   r   )abs   &&r
   f&TestDecorators.test_dbcheck.<locals>.f   s	    5Lr   N)r6   rV   rs   r"   )r'   r   s   & r
   test_dbcheckTestDecorators.test_dbcheck   sD    	&	'	 
(	1a!$,1d3r   c                   / p\         \        V4      R  4       4       pV P                  VP                  R4       V P                  V\	        ^ R7      4       V P                  V! ^4      ^4       V P                  VR,          ^4       V P                  V! ^4      ^4       V P                  VR,          ^4       V P                  V! ^4      ^4       V P                  VR,          ^4       V P                  V! ^
.4      ^
^
.4       V P                  VR,          ^4       V P                  V! ^
.4      ^
^
.4       V P                  VR,          ^4       R# )c                     V ^,          # )r   r   r\   s   &r
   double+TestDecorators.test_memoize.<locals>.double   s     q5Lr   r   )r   N)rI   rA   rV   r   r   )r'   r;   r   s   &  r
   test_memoizeTestDecorators.test_memoize   s+   		F		 
 
	(3Q0 	A&)1-A&)1-A&)1- 	Bx0)1-Bx0)1-r   c                P   R FG  p\        VRR4       V P                  \        4      ;_uu_ 4        \        RV R2RR4       RRR4       KI  	  R FE  p\        VRR4       V P                  \        4      ;_uu_ 4        \	        RV R24       RRR4       KG  	  R p\        RVR7      pR	\        3R
\        3R\        3R\        33 F2  w  r%RV,          p\        VRR4      pV P                  V\        Wt4       K4  	  R#   + '       g   i     EK  ; i  + '       g   i     K  ; i)x,testexec@
def f(): passNr-   c                     \         hr   )NotImplementedError)r   s   &r
   unimp)TestDecorators.test_errors.<locals>.unimp   s    %%r   )nullvalr   undefr   znullval.attrr   z$@%s
def f(): pass
assert f() is None)r   zx, yzx = ypassz
import sys)z1.+2jz
[1, 2][-1]z(1, 2)Truez...None)
r4   rs   SyntaxErrorrE   r   r   	NameErrorAttributeErrorr   r-   )r'   stmtr/   r   contextexccodestrcodes   &       r
   test_errorsTestDecorators.test_errors   s    BDD&&)"";//!D6166B 0/ B MDD&&)""9--qo./ .- M
	&t51#Y/%y1*N;#%89;ID ?EG7FF3Dc47; 0// .--s   C?=D?DD%c                :    R F  p\        RV R2RR4       K  	  R# )(x,)r   r   r   r   N)r   z(x, y)zx := yz(x := y)zx @yz(x @ y)zx[0]zw[x].y.zzw + x - (y + z)z	x(y)()(z)z[w, x, y][z]zx.y)r4   )r'   r/   s   & r
   test_expressionsTestDecorators.test_expressions   s%    
D av_-vv>	
r   c                R    ! R  R\         4      pV P                  V! 4       P                  4       ^*4       V P                  VP                  P                  ^4       V P                  VP                  P                  R4       V P                  VP                  P
                  ^*4       R# )c                   X   a  ] tR t^t o ]! ^RR7      ]! ^*R7      R 4       4       tRtV tR# )%TestDecorators.test_double.<locals>.Chaha)abcxyz)boohc                    ^*# rP   r   )r'   s   &r
   rR   )TestDecorators.test_double.<locals>.C.foo   s    "$r   r   N)r   r   r   r   r   rR   r   r   r   s   @r
   rT   r      s'     1&)B$   *$r   rT   r   N)rU   rV   rR   r   r   r   rW   s   & r
   test_doubleTestDecorators.test_double   sp    	% 	% 	B'A&F+R(r   c                n    R  pV! ^4      V! ^4      R 4       4       pV P                  V! 4       ^R4       R# )c                   a  V 3R lpV# )zxDecorator factory that returns a decorator that replaces the
passed-in function with one that returns the value of 'num'c                    < V3R  l# )c                     < S # r   r   )nums   r
   <lambda>JTestDecorators.test_order.<locals>.callnum.<locals>.deco.<locals>.<lambda>   s    sr   r   )r   r   s   &r
   deco8TestDecorators.test_order.<locals>.callnum.<locals>.deco   s	    ""r   r   )r   r   s   f r
   callnum*TestDecorators.test_order.<locals>.callnum   s    #Kr   c                      ^*# rP   r   r   r   r
   rR   &TestDecorators.test_order.<locals>.foo   s    r   z,Application order of decorators is incorrectN)rV   )r'   r   rR   s   &  r
   
test_orderTestDecorators.test_order   s?    	 
	 
 
J	Lr   c                  aa	 . oV3R  lo	 ! VV	3R lR\         4      p\        V. RO4      w  r#p. ROp. oVP                  VP                  4      VP                  VP                  4      VP                  VP                  4      R 4       4       4       pV P	                  V! 4       ^*4       V P	                  SV4       . oR pVP                  VP                  4      ! VP                  VP                  4      ! VP                  VP                  4      ! V4      4      4      pV P	                  V! 4       ^*4       V P	                  SV4       R# )c                 H   <a  SP                  R S ,           4       VV 3R lpV# )makedecc                 8   < SP                  R S,           4       V # )calldecappend)r   actionstags   &r
   r   HTestDecorators.test_eval_order.<locals>.make_decorator.<locals>.decorate   s    y3/r   r   )r   r   r   s   f r
   make_decorator6TestDecorators.test_eval_order.<locals>.make_decorator   s    NN9s?+ Or   c                   6   <a  ] tR tRt o R tVV3R ltRtV tR# )8TestDecorators.test_eval_order.<locals>.NameLookupTracer   c                    Wn         R # r   index)r'   r   s   &&r
   r&   ATestDecorators.test_eval_order.<locals>.NameLookupTracer.__init__  s    "
r   c                   < VR 8X  d   RSr2M,VR8X  d   R\        V P                  4      r2MQ RT,          4       hSP                  RW P                  3,          4       V# )r   evalnameargevalargszUnknown attrname %sz%s%d)strr   r   )r'   fnameopnamerF   r   r   s   &&  r
   __getattr__DTestDecorators.test_eval_order.<locals>.NameLookupTracer.__getattr__  sV    ,,#-~Ce^#-s4::C?"7%"??5v(<<=
r   r   N)r   r   r   r   r&   r   r   r   )r    r   r   s   @r
   NameLookupTracerr      s     # r   r  c                      ^*# rP   r   r   r   r
   rR   +TestDecorators.test_eval_order.<locals>.foo  s     r   c                      ^*# rP   r   r   r   r
   bar+TestDecorators.test_eval_order.<locals>.bar!  s    "r   N)r:   r      )	evalname1	evalargs1makedec1	evalname2	evalargs2makedec2	evalname3	evalargs3makedec3calldec3calldec2calldec1)rU   mapr   r   rV   )
r'   r  c1c2c3expected_actionsrR   r  r   r   s
   &       @@r
   test_eval_orderTestDecorators.test_eval_order   s%    		 	 	 );7
B
 			266	"			266	"			266	" 
# 
# 
# 	#"23 '(9(9"&&(A"BSBSTVTZTZB[\_B`(ab#"23r   c                v   a  ! R  R4      o ! V3R lR4      pV P                  VP                  4       R4       R# )c                   &   a  ] tR tRt o R tRtV tR# )@TestDecorators.test_bound_function_inside_classmethod.<locals>.Ai'  c                    R # )spamr   )r'   clss   &&r
   rR   DTestDecorators.test_bound_function_inside_classmethod.<locals>.A.foo(  s    r   r   N)r   r   r   r   rR   r   r   r   s   @r
   Ar  '  s      r   r"  c                   H   < ] tR tRt]!  Z ! 4       P
                  4      tRtR# )@TestDecorators.test_bound_function_inside_classmethod.<locals>.Bi+  r   N)r   r   r   r   rr   rR   r  r   )r"  s   r
   Br$  +  s    acgg&Cr   r%  r  N)rV   r  )r'   r%  r"  s   & @r
   &test_bound_function_inside_classmethod5TestDecorators.test_bound_function_inside_classmethod&  s/    	 		' 	' 	&)r   r   N)r   r   r   r   rX   rk   ro   rt   r{   r   r   r   r   r   r   r   r  r&  r   r   r   s   @r
   rK   rK   G   sR     ( (1
/164.684?)L;4z* *r   rK   c                   2   a  ] tR tRt o R tR tR tRtV tR# )TestClassDecoratorsi1  c                l    R  pV ! R R\         4      4       pV P                  VP                  R4       R# )c                     R V n         V # )Helloextrar\   s   &r
   plain.TestClassDecorators.test_simple.<locals>.plain4      AGHr   c                       ] tR tRtRtR# )*TestClassDecorators.test_simple.<locals>.Ci7  r   Nr   r   r   r   r   r   r   r
   rT   r3  7  s    r   rT   r,  NrU   rV   r.  )r'   r/  rT   s   &  r
   test_simpleTestClassDecorators.test_simple3  s0    	 
 
'*r   c                |    R  pR pVV ! R R\         4      4       4       pV P                  VP                  ^4       R# )c                     ^
V n         V # )
   r-  r\   s   &r
   ten,TestClassDecorators.test_double.<locals>.ten<  s    AGHr   c                 8    V ;P                   ^,          un         V # )   r-  r\   s   &r
   add_five1TestClassDecorators.test_double.<locals>.add_five?  s    GGqLGHr   c                       ] tR tRtRtR# )*TestClassDecorators.test_double.<locals>.CiC  r   Nr4  r   r   r
   rT   rB  C      r   rT   Nr5  )r'   r;  r?  rT   s   &   r
   r   TestClassDecorators.test_double;  s=    		 
	 
 
"%r   c                |    R  pR pVV ! R R\         4      4       4       pV P                  VP                  R4       R# )c                     R V n         V # )firstr-  r\   s   &r
   applied_first5TestClassDecorators.test_order.<locals>.applied_firstI  r1  r   c                     R V n         V # )secondr-  r\   s   &r
   applied_second6TestClassDecorators.test_order.<locals>.applied_secondL  s    AGHr   c                       ] tR tRtRtR# ))TestClassDecorators.test_order.<locals>.CiO  r   Nr4  r   r   r
   rT   rO  O  rC  r   rT   rK  Nr5  )r'   rH  rL  rT   s   &   r
   r   TestClassDecorators.test_orderH  s=    		 
	 
 
(+r   r   N)	r   r   r   r   r6  r   r   r   r   r   s   @r
   r)  r)  1  s     +&
, 
,r   r)  __main__)NN)unittestr   rU   r   r%   r"   r6   rA   rI   TestCaserK   r)  r   mainr   r   r
   <module>rU     st    f 8I 8	
"g*X&& g*T!,(++ !,F zMMO r   