+
    Bi                     $   ^ RI t ^ RIHtHtHtHtHtHtHtH	t	H
t
Ht  ^ RIt ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt ! R R]4      t ! R R] P.                  4      t] ! R R] P.                  4      4       t] P4                  ! ]RJ R	4       ! R
 R] P.                  4      4       t ! R R]4      t ! R R]4      t ! R R]4      t ! R R]4      tR t R t! ! R R4      t"]"! 4       t#]$! 4       t% ! R R] P.                  4      t&R,t'R-t(R t)R t*] P4                  ! ]RJ R	4       ! R R] P.                  4      4       t+ ! R R4      t,] ! R  R!] P.                  4      4       t-] ! R" R#] P.                  4      4       t.] ! R$ R%] P.                  4      4       t/ ! R& R'] P.                  4      t0] P4                  ! ]RJ R(4       ! R) R*] P.                  4      4       t1]2R+8X  d   ] Pf                  ! 4        R# R#   ] d    Rt ELi ; i  ] d    Rt ELi ; i).    N)
cpython_onlyis_wasirequires_limited_apiPy_DEBUGset_recursion_limitskip_on_s390xskip_emscripten_stack_overflowskip_wasi_stack_overflowskip_if_sanitizerimport_helperc                   ,   a  ] tR t^t o R tR tRtV tR# )BadStrc                    R # )T )selfothers   &&%/usr/lib/python3.14/test/test_call.py__eq__BadStr.__eq__   s        c                :    \         P                  V 4      ^,          # )   )str__hash__r   s   &r   r   BadStr.__hash__   s    ||D!A%%r   r   N)__name__
__module____qualname____firstlineno__r   r   __static_attributes____classdictcell____classdict__s   @r   r   r      s     & &r   r   c                   ,   a  ] tR t^t o R tR tRtV tR# )FunctionCallsc                   \         P                  ! RR.4      pVP                  R 4       \        VP	                  4       4      pR pV! R/ VB pV P                  V\        4       V P                  \        VP	                  4       4      V4       R# )ac                      V # Nr   )kws   ,r   fn+FunctionCalls.test_kwargs_order.<locals>.fn'   s    Ir   N)r(      )b   r   )collectionsOrderedDictmove_to_endlistitemsassertIsInstancedictassertEqual)r   odexpectedr,   ress   &    r   test_kwargs_orderFunctionCalls.test_kwargs_order!   sp    $$h%9:
s
#	 h2hc4(ciik*H5r   c                    R  p ! R R4      pWP                   . P                  .pV F  p\        R4       F  p V! R4       K  	  K   	  R#   \         d     K$  i ; i)c                      R # r*   r   r   r   r   fBFunctionCalls.test_frames_are_popped_after_failed_calls.<locals>.f1       r   c                   &   a  ] tR t^3t o R tRtV tR# )BFunctionCalls.test_frames_are_popped_after_failed_calls.<locals>.Cc                    R # r*   r   r   s   &r   mDFunctionCalls.test_frames_are_popped_after_failed_calls.<locals>.C.m4       r   r   N)r   r   r   r    rF   r!   r"   r#   s   @r   CrD   3         r   rI     N)rF   __len__range	TypeError)r   r@   rI   	callablesc_s   &     r   )test_frames_are_popped_after_failed_calls7FunctionCalls.test_frames_are_popped_after_failed_calls.   s]    		 	 RZZ(	A4[dG !  ! s   AAAr   N)r   r   r   r    r<   rR   r!   r"   r#   s   @r   r&   r&      s     6 r   r&   c                     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(R& t)R' t*R( t+R) t,R*t-V t.R+# ),CFunctionCallsErrorMessagesc                L    R pV P                  \        V/ P                  4       R# )z7__contains__\(\) takes exactly one argument \(0 given\)NassertRaisesRegexrN   __contains__r   msgs   & r   test_varargs0)CFunctionCallsErrorMessages.test_varargs0C   s    Hy#r?r   c                P    R pV P                  \        V/ P                  ^ ^4       R# )z7__contains__\(\) takes exactly one argument \(2 given\)NrW   rZ   s   & r   test_varargs2)CFunctionCallsErrorMessages.test_varargs2G   s!    Hy#r1Er   c                Z    R pV P                  \        V\        P                  RRR4       R# )z@^from_bytes\(\) takes at most 2 positional arguments \(3 given\)   alittleFN)rX   rN   int
from_bytesrZ   s   & r   test_varargs3)CFunctionCallsErrorMessages.test_varargs3K   s#    Qy#s~~tXuUr   c                    R pV P                  \        V/ P                  4       RpV P                  \        V/ P                  4       R# )zUget\(\) takes at least 1 argument \(0 given\)|get expected at least 1 argument, got 0zexpected 1 argument, got 0N)rX   rN   get__delattr__rZ   s   & r   test_varargs1min,CFunctionCallsErrorMessages.test_varargs1minO   s:    :y#rvv6+y#r~~>r   c                @    R pV P                  \        V\        4       R# )z,getattr expected at least 2 arguments, got 0NrX   rN   getattrrZ   s   & r   test_varargs2min,CFunctionCallsErrorMessages.test_varargs2minW   s    =y#w7r   c                D    R pV P                  \        V\        ^^4       R# )zWinput\(\) takes at most 1 argument \(2 given\)|input expected at most 1 argument, got 2N)rX   rN   inputrZ   s   & r   test_varargs1max,CFunctionCallsErrorMessages.test_varargs1max[   s    ;y#ua;r   c                R    R pV P                  \        V/ P                  ^^^4       R# )zUget\(\) takes at most 2 arguments \(3 given\)|get expected at most 2 arguments, got 3N)rX   rN   ri   rZ   s   & r   test_varargs2max,CFunctionCallsErrorMessages.test_varargs2max`   s%    :y#rvvq!Q?r   c                P    R pV P                  \        V/ P                  ^R7       R# )+__contains__\(\) takes no keyword argumentsxNrW   rZ   s   & r   test_varargs1_kw,CFunctionCallsErrorMessages.test_varargs1_kwe   s"    <y#r!Dr   c                R    R pV P                  \        V/ P                  ^^R7       R# )rz   r|   yNrW   rZ   s   & r   test_varargs2_kw,CFunctionCallsErrorMessages.test_varargs2_kwi   s$    <y#r!qIr   c                D    R pV P                  \        V\        ^R7       R# )z#bool\(\) takes no keyword argumentsr{   N)rX   rN   boolrZ   s   & r   test_varargs3_kw,CFunctionCallsErrorMessages.test_varargs3_kwm   s    4y#tq9r   c                P    R pV P                  \        V. P                  ^R7       R# )z0^(list[.])?index\(\) takes no keyword arguments$r{   N)rX   rN   indexrZ   s   & r   test_varargs4_kw,CFunctionCallsErrorMessages.test_varargs4_kwq   s"    Ay#rxx1=r   c                D    R pV P                  \        V\        ^R7       R# )z(^hasattr\(\) takes no keyword arguments$r{   N)rX   rN   hasattrrZ   s   & r   test_varargs5_kw,CFunctionCallsErrorMessages.test_varargs5_kwu       9y#w!<r   c                D    R pV P                  \        V\        ^R7       R# )z(^getattr\(\) takes no keyword arguments$r{   Nrn   rZ   s   & r   test_varargs6_kw,CFunctionCallsErrorMessages.test_varargs6_kwy   r   r   c                D    R pV P                  \        V\        ^R7       R# )z%^next\(\) takes no keyword arguments$r{   N)rX   rN   nextrZ   s   & r   test_varargs7_kw,CFunctionCallsErrorMessages.test_varargs7_kw}   s    6y#tq9r   c                X    R pV P                  \        V\        P                  ^R7       R# )z/^_struct[.]pack\(\) takes no keyword arguments$r{   N)rX   rN   structpackrZ   s   & r   test_varargs8_kw,CFunctionCallsErrorMessages.test_varargs8_kw   s"    @y#v{{a@r   c                X    R pV P                  \        V\        P                  ^R7       R# )z4^_struct[.]pack_into\(\) takes no keyword arguments$r{   N)rX   rN   r   	pack_intorZ   s   & r   test_varargs9_kw,CFunctionCallsErrorMessages.test_varargs9_kw   s$    Ey#v/?/?1Er   c                v    R pV P                  \        V\        P                  ! 4       P                  ^R7       R# )z.^deque[.]index\(\) takes no keyword arguments$r{   N)rX   rN   r1   dequer   rZ   s   & r   test_varargs10_kw-CFunctionCallsErrorMessages.test_varargs10_kw   s-    ?y#{/@/@/B/H/HANr   c                    R pV P                  \        V\        P                  P                  \        P                  ! R4      ^R7       R# )z.^Struct[.]pack\(\) takes no keyword arguments$ r{   N)rX   rN   r   Structr   rZ   s   & r   test_varargs11_kw-CFunctionCallsErrorMessages.test_varargs11_kw   s5    ?y#v}}/A/A6==QSCTXYZr   c                L    R pV P                  \        V\        \        R7       R# )z-^staticmethod\(\) takes no keyword arguments$funcN)rX   rN   staticmethodidrZ   s   & r   test_varargs12_kw-CFunctionCallsErrorMessages.test_varargs12_kw   s    >y#|"Er   c                L    R pV P                  \        V\        \        R7       R# )z,^classmethod\(\) takes no keyword arguments$r   N)rX   rN   classmethodr   rZ   s   & r   test_varargs13_kw-CFunctionCallsErrorMessages.test_varargs13_kw   s    =y#{Dr   c           	     \    R pV P                  \        V\        P                  ^ ^^R7       R# )z:^product\(\) takes at most 1 keyword argument \(2 given\)$)repeatfooN)rX   rN   	itertoolsproductrZ   s   & r   test_varargs14_kw-CFunctionCallsErrorMessages.test_varargs14_kw   s.    Ky#(00!A1 	 	Fr   c                L    R pV P                  \        V\        ^ ^^^^R7       R# )z?^ImportError\(\) takes at most 3 keyword arguments \(4 given\)$)namepath	name_fromr   N)rX   rN   ImportErrorrZ   s   & r   test_varargs15_kw-CFunctionCallsErrorMessages.test_varargs15_kw   s-    Py#*AAAPQ 	 	Sr   c           
     J    R pV P                  \        V\        ^ ^^^R7       R# )z7^min\(\) takes at most 2 keyword arguments \(3 given\)$)defaultkeyr   N)rX   rN   minrZ   s   & r   test_varargs16_kw-CFunctionCallsErrorMessages.test_varargs16_kw   s*    Hy#"AqaQ 	 	@r   c                N    R pV P                  \        V\        ^ ^^^^^R7	       R# )z3print\(\) got an unexpected keyword argument 'foo'$)sependfileflushr   N)rX   rN   printrZ   s   & r   test_varargs17_kw-CFunctionCallsErrorMessages.test_varargs17_kw   s.    Dy#$aQAAQA 	 	Or   c           	         R pV P                  \        V4      ;_uu_ 4        \        R/ \        R4      R/B  RRR4       R#   + '       g   i     R# ; i)z'invalid keyword argument for print\(\)$r   ,N)r   r.   )rX   rN   r   r   rZ   s   & r   test_varargs18_kw-CFunctionCallsErrorMessages.test_varargs18_kw   s=    8##Is33/6%=#./ 4333   AA	c           	         R pV P                  \        V4      ;_uu_ 4        \        R/ \        R4      ^/B  RRR4       R#   + '       g   i     R# ; i)z'invalid keyword argument for round\(\)$r   N)g      ?)rX   rN   roundr   rZ   s   & r   test_varargs19_kw-CFunctionCallsErrorMessages.test_varargs19_kw   s=    8##Is33-6%=!,- 4333r   c                N    R pV P                  \        V/ P                  ^ 4       R# )z'keys\(\) takes no arguments \(1 given\)NrX   rN   keysrZ   s   & r   test_oldargs0_1+CFunctionCallsErrorMessages.test_oldargs0_1   s    8y#rww:r   c                P    R pV P                  \        V/ P                  ^ ^4       R# )z'keys\(\) takes no arguments \(2 given\)Nr   rZ   s   & r   test_oldargs0_2+CFunctionCallsErrorMessages.test_oldargs0_2   s!    8y#rww1=r   c                P    R pV P                  \        V/ P                  ^R7       R# )#keys\(\) takes no keyword argumentsr{   Nr   rZ   s   & r   test_oldargs0_1_kw.CFunctionCallsErrorMessages.test_oldargs0_1_kw   s"    4y#rww!<r   c                R    R pV P                  \        V/ P                  ^^R7       R# )r   r   Nr   rZ   s   & r   test_oldargs0_2_kw.CFunctionCallsErrorMessages.test_oldargs0_2_kw   s$    4y#rww!qAr   c                L    R pV P                  \        V. P                  4       R# )z0count\(\) takes exactly one argument \(0 given\)NrX   rN   countrZ   s   & r   test_oldargs1_0+CFunctionCallsErrorMessages.test_oldargs1_0   s    Ay#rxx8r   c                P    R pV P                  \        V. P                  ^^4       R# )z0count\(\) takes exactly one argument \(2 given\)Nr   rZ   s   & r   test_oldargs1_2+CFunctionCallsErrorMessages.test_oldargs1_2   s!    Ay#rxxA>r   c                P    R pV P                  \        V. P                  ^R7       R# $count\(\) takes no keyword argumentsr{   Nr   rZ   s   & r   test_oldargs1_0_kw.CFunctionCallsErrorMessages.test_oldargs1_0_kw   s"    5y#rxx1=r   c                R    R pV P                  \        V. P                  / ^R7       R# r   r   rZ   s   & r   test_oldargs1_1_kw.CFunctionCallsErrorMessages.test_oldargs1_1_kw   s$    5y#rxxqAr   c                R    R pV P                  \        V. P                  ^^R7       R# )r   r   Nr   rZ   s   & r   test_oldargs1_2_kw.CFunctionCallsErrorMessages.test_oldargs1_2_kw   s$    5y#rxx1Br   c                H    R pV P                  \        V\        4       4       R# )z!^'object' object is not callable$N)rX   rN   objectrZ   s   & r   test_object_not_callable4CFunctionCallsErrorMessages.test_object_not_callable   s    2y#vx8r   c                `    R pV P                  \        V\        P                  ! R4      4       R# z!^'module' object is not callable$modN)rX   rN   types
ModuleTyperZ   s   & r   (test_module_not_callable_no_suggestion_0DCFunctionCallsErrorMessages.test_module_not_callable_no_suggestion_0   s$    2y#u/?/?/FGr   c                p    R p\         P                  ! R4      p^*Vn        V P                  \        W4       R# r  r  r  r  rX   rN   r   r[   r  s   &  r   (test_module_not_callable_no_suggestion_1DCFunctionCallsErrorMessages.test_module_not_callable_no_suggestion_1   s.    2u%y#3r   c                f    R p\         P                  ! R4      pV=V P                  \        W4       R# r  r  r  r   rX   rN   r	  s   &  r   (test_module_not_callable_no_suggestion_2DCFunctionCallsErrorMessages.test_module_not_callable_no_suggestion_2   s,    2u%Ly#3r   c                p    R p\         P                  ! R4      p^*Vn        V P                  \        W4       R# r  r  r	  s   &  r   (test_module_not_callable_no_suggestion_3DCFunctionCallsErrorMessages.test_module_not_callable_no_suggestion_3   s.    2u%y#3r   c                r    R p\         P                  ! R4      pR Vn        V P                  \        W4       R# )zH^'module' object is not callable\. Did you mean: 'mod\.mod\(\.\.\.\)'\?$r  c                      R # ).r   r   r   r   <lambda>QCFunctionCallsErrorMessages.test_module_not_callable_suggestion.<locals>.<lambda>   s    #r   Nr  r	  s   &  r   #test_module_not_callable_suggestion?CFunctionCallsErrorMessages.test_module_not_callable_suggestion   s.    Yu%y#3r   r   N)/r   r   r   r    r\   r_   rf   rk   rp   rt   rw   r}   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r
  r  r  r  r!   r"   r#   s   @r   rU   rU   @   s     @FV?8<
@
EJ:>==:AFO[FEF
S
@
O
0.;>=B9?>BC9H4444 4r   rU   requires _testcapic                      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V tR# )TestCallingConventionsak  Test calling using various C calling conventions (METH_*) from Python

Subclasses test several kinds of functions (module-level, methods,
class methods static methods) using these attributes:
  obj: the object that contains tested functions (as attributes)
  expected_self: expected "self" argument to the C function

The base class tests module-level functions.
c                *    \         ;V n        V n        R # r*   )	_testcapiobjexpected_selfr   s   &r   setUpTestCallingConventions.setUp
  s    (114%r   c                x    V P                  V P                  P                  ^^^4      V P                  R34       R# r.   Nr.   r0   r   r8   r  meth_varargsr  r   s   &r   test_varargs#TestCallingConventions.test_varargs  s4    HH!!!Q*+	
r   c                r    V P                  V P                  P                  ! R!  V P                  R34       R# r#  r%  r   s   &r   test_varargs_ext'TestCallingConventions.test_varargs_ext  s0    HH!!9-+	
r   c                B   a  R pS P                  \        VV 3R l4       R# )z+meth_varargs\(\) takes no keyword argumentsc                  <   < S P                   P                  ^R7      # r.   )k)r  r&  r   s   r   r  >TestCallingConventions.test_varargs_error_kw.<locals>.<lambda>  s    DHH$9$9A$9$>r   NrX   rN   rZ   s   f r   test_varargs_error_kw,TestCallingConventions.test_varargs_error_kw  s    <s>	
r   c           	         V P                  V P                  P                  ^^^^R7      V P                  RR^R^/34       R# r.   )r(   r/   r(   r/   Nr.   r0   r8   r  meth_varargs_keywordsr  r   s   &r   test_varargs_keywords,TestCallingConventions.test_varargs_keywords  sD    HH**1a1*:#q#q)9:	
r   c           
         V P                  V P                  P                  ! ^^./ R^R^/B V P                  RR^R^/34       R# r.   r(   r/   Nr6  r7  r   s   &r   test_varargs_keywords_ext0TestCallingConventions.test_varargs_keywords_ext%  sM    HH**QFGsAsA6FG#q#q)9:	
r   c                t    V P                  V P                  P                  ^4      V P                  ^34       R# r.   Nr8   r  meth_or  r   s   &r   test_oTestCallingConventions.test_o+  s*    +d.@.@!-DEr   c                t    V P                  V P                  P                  ! ^.!  V P                  ^34       R# r@  rA  r   s   &r   
test_o_ext!TestCallingConventions.test_o_ext.  s,    1#.1C1CQ0GHr   c                ^    R pV P                  \        WP                  P                  4       R# )z1meth_o\(\) takes exactly one argument \(0 given\)N)rX   rN   r  rB  rZ   s   & r   test_o_error_no_arg*TestCallingConventions.test_o_error_no_arg1  s    By#xx?r   c                B   a  R pS P                  \        VV 3R l4       R# )z1meth_o\(\) takes exactly one argument \(2 given\)c                  <   < S P                   P                  ^^4      # r.   r  rB  r   s   r   r  >TestCallingConventions.test_o_error_two_args.<locals>.<lambda>8  s    DHHOOAq$9r   Nr1  rZ   s   f r   test_o_error_two_args,TestCallingConventions.test_o_error_two_args5  s    Bs9	
r   c                B   a  R pS P                  \        VV 3R l4       R# )z1meth_o\(\) takes exactly one argument \(3 given\)c                  8   < S P                   P                  ! R!  # r.   r$  rN  r   s   r   r  9TestCallingConventions.test_o_error_ext.<locals>.<lambda>>  s    DHHOOY$?r   Nr1  rZ   s   f r   test_o_error_ext'TestCallingConventions.test_o_error_ext;  s    Bs?	
r   c                B   a  R pS P                  \        VV 3R l4       R# )%meth_o\(\) takes no keyword argumentsc                  <   < S P                   P                  ^R7      # r.  rN  r   s   r   r  8TestCallingConventions.test_o_error_kw.<locals>.<lambda>D      DHHOOaO$8r   Nr1  rZ   s   f r   test_o_error_kw&TestCallingConventions.test_o_error_kwA      6s8	
r   c                B   a  R pS P                  \        VV 3R l4       R# )rY  c                  <   < S P                   P                  ^R7      # r.  rN  r   s   r   r  <TestCallingConventions.test_o_error_arg_kw.<locals>.<lambda>J  r\  r   Nr1  rZ   s   f r   test_o_error_arg_kw*TestCallingConventions.test_o_error_arg_kwG  r_  r   c                n    V P                  V P                  P                  4       V P                  4       R # r*   r8   r  meth_noargsr  r   s   &r   test_noargs"TestCallingConventions.test_noargsM  s%    --/1C1CDr   c                n    V P                  V P                  P                  ! . !  V P                  4       R # r*   rf  r   s   &r   test_noargs_ext&TestCallingConventions.test_noargs_extP  s'    --r2D4F4FGr   c                B   a  R pS P                  \        VV 3R l4       R# )z.meth_noargs\(\) takes no arguments \(1 given\)c                  :   < S P                   P                  ^4      # rM  r  rg  r   s   r   r  >TestCallingConventions.test_noargs_error_arg.<locals>.<lambda>V  s    DHH$8$8$;r   Nr1  rZ   s   f r   test_noargs_error_arg,TestCallingConventions.test_noargs_error_argS  s    ?s;	
r   c                B   a  R pS P                  \        VV 3R l4       R# )z.meth_noargs\(\) takes no arguments \(2 given\)c                  <   < S P                   P                  ^^4      # rM  ro  r   s   r   r  ?TestCallingConventions.test_noargs_error_arg2.<locals>.<lambda>\  s    DHH$8$8A$>r   Nr1  rZ   s   f r   test_noargs_error_arg2-TestCallingConventions.test_noargs_error_arg2Y  s    ?s>	
r   c                B   a  R pS P                  \        VV 3R l4       R# )z.meth_noargs\(\) takes no arguments \(3 given\)c                  8   < S P                   P                  ! R!  # rT  ro  r   s   r   r  >TestCallingConventions.test_noargs_error_ext.<locals>.<lambda>b  s    DHH$8$8)$Dr   Nr1  rZ   s   f r   test_noargs_error_ext,TestCallingConventions.test_noargs_error_ext_  s    ?sD	
r   c                B   a  R pS P                  \        VV 3R l4       R# )z*meth_noargs\(\) takes no keyword argumentsc                  <   < S P                   P                  ^R7      # r.  ro  r   s   r   r  =TestCallingConventions.test_noargs_error_kw.<locals>.<lambda>h  s    DHH$8$81$8$=r   Nr1  rZ   s   f r   test_noargs_error_kw+TestCallingConventions.test_noargs_error_kwe  s    ;s=	
r   c                x    V P                  V P                  P                  ^^^4      V P                  R34       R# r#  r8   r  meth_fastcallr  r   s   &r   test_fastcall$TestCallingConventions.test_fastcallk  s4    HH""1a++	
r   c                r    V P                  V P                  P                  ! R!  V P                  R34       R# r#  r  r   s   &r   test_fastcall_ext(TestCallingConventions.test_fastcall_extq  s0    HH""I.+	
r   c                B   a  R pS P                  \        VV 3R l4       R# )z,meth_fastcall\(\) takes no keyword argumentsc                  <   < S P                   P                  ^R7      # r.  )r  r  r   s   r   r  ?TestCallingConventions.test_fastcall_error_kw.<locals>.<lambda>z  s    DHH$:$:Q$:$?r   Nr1  rZ   s   f r   test_fastcall_error_kw-TestCallingConventions.test_fastcall_error_kww  s    =s?	
r   c           	         V P                  V P                  P                  ^^^^R7      V P                  RR^R^/34       R# r5  r8   r  meth_fastcall_keywordsr  r   s   &r   test_fastcall_keywords-TestCallingConventions.test_fastcall_keywords}  sD    HH++AqA+;#q#q)9:	
r   c           
         V P                  V P                  P                  ! R/ R^R^/B V P                  RR^R^/34       R# r<  r  r   s   &r   test_fastcall_keywords_ext1TestCallingConventions.test_fastcall_keywords_ext  sI    HH++VHQQ7GH#q#q)9:	
r   r  r  N)r   r   r   r    __doc__r   r'  r*  r2  r9  r=  rC  rF  rI  rP  rV  r]  rc  rh  rk  rq  rv  r{  r  r  r  r  r  r  r!   r"   r#   s   @r   r  r     s     2




FI@



EH








 
r   r  c                   *   a  ] tR tRt o RtR tRtV tR# )TestCallingConventionsInstancei  z?Test calling instance methods using various calling conventionsc                H    \         P                  ! 4       ;V n        V n        R # r*   )r  MethInstancer  r  r   s   &r   r   $TestCallingConventionsInstance.setUp  s    (1(>(>(@@4%r   r  Nr   r   r   r    r  r   r!   r"   r#   s   @r   r  r    s     IA Ar   r  c                   *   a  ] tR tRt o RtR tRtV tR# )TestCallingConventionsClassi  z<Test calling class methods using various calling conventionsc                >    \         P                  ;V n        V n        R # r*   r  	MethClassr  r  r   s   &r   r   !TestCallingConventionsClass.setUp  s    (1(;(;;4%r   r  Nr  r#   s   @r   r  r    s     F< <r   r  c                   *   a  ] tR tRt o RtR tRtV tR# )#TestCallingConventionsClassInstancei  z&Test calling class methods on instancec                d    \         P                  ! 4       V n        \         P                  V n        R # r*   r  r   s   &r   r   )TestCallingConventionsClassInstance.setUp  s     &&(&00r   r  Nr  r#   s   @r   r  r    s     01 1r   r  c                   *   a  ] tR tRt o RtR tRtV tR# )TestCallingConventionsStatici  z=Test calling static methods using various calling conventionsc                H    \         P                  ! 4       V n        R V n        R # r*   )r  
MethStaticr  r  r   s   &r   r   "TestCallingConventionsStatic.setUp  s    '')!r   r  Nr  r#   s   @r   r  r    s     G" "r   r  c                     W.# r*   r   )arg1arg2s   &&r   pyfuncr    s
    <r   c                      R # noargr   r   r   r   pyfunc_noargr    s    r   c                   L   a  ] tR tRt o R tR t]R 4       t]R 4       t	Rt
V tR# )PythonClassi  c                    W.# r*   r   )r   r  r  s   &&&r   methodPythonClass.method  s
    |r   c                    R # r  r   r   s   &r   method_noargPythonClass.method_noarg  s    r   c                    R # )r   r   clss   &r   class_methodPythonClass.class_method  s    r   c                     R # )r   r   r   r   r   static_methodPythonClass.static_method  s    r   r   N)r   r   r   r    r  r  r   r  r   r  r!   r"   r#   s   @r   r  r    s7         r   r  c                     a  ] tR tRt o Rt]R^^.3]RR3]P                  RR3]P                  RR3]
P                  R^^.3]
P                  RR3]
P                  RR3]
P                  RR3.t]RR^/^^.3]RR^R^/^^.3]
P                  RR^/^^.3]
P                  RR^R^/^^.3.t]'       Ed   ]P                   ! 4       t]]3]]3]P$                  ]P$                  3]P$                  ! 4       ]P$                  3]P&                  R33 EF&  w  tt]P-                  ]P.                  R]R33]P0                  R]R]33]P4                  R]R33]P4                  R]R33]P6                  R]R]33]P6                  R]R]33]P8                  R]3]P:                  R]^{33.4       ]P-                  ]P0                  RR	R
/]RR	R
/33]P0                  RR	R
/]RR	R
/33]P0                  R/ ]R]33]P6                  RR	R
/]RR	R
/33]P6                  RR	R
/]RR	R
/33]P6                  R/ ]R]33.4       EK)  	  R t]P@                  ! ]RJ R4      R 4       t!]P@                  ! ]RJ R4      R 4       t"R t#Rt$V t%R# )FastCallTestsi  z0Test calling using various callables from C
    r  r   r   r  r  Nr|   r   c                    \        V\        4      '       d3   VR,          \        J d"   VR,          / R39   d   . VRR OVR,          N5pV P                  W4       R# )r.   N)
isinstancetupleNULL_OR_EMPTYr8   )r   resultr:   s   &&&r   check_resultFastCallTests.check_result  sQ    h&&8B<=+Hbzb$Z'7Xcr]7F2J7*r   r  c                >   V P                    F  w  rpV P                  WR 7      ;_uu_ 4        \        P                  ! WR4      pV P	                  WC4       V'       g*   \        P                  ! VRR4      pV P	                  WC4       RRR4       K  	  V P
                   FR  w  rrSV P                  WVR7      ;_uu_ 4        \        P                  ! WV4      pV P	                  WC4       RRR4       KT  	  R#   + '       g   i     K  ; i  + '       g   i     K}  ; i)r   argsNr   r  kwargs)CALLS_POSARGSsubTestr  pyobject_fastcalldictr  CALLS_KWARGS)r   r   r  r:   r  r  s   &     r   test_vectorcall_dict"FastCallTests.test_vectorcall_dict  s     %)$6$6 D433"88TJ!!&3&<<T4NF%%f7 43 %7 -1,=,=(D46BB"88VL!!&3 CB -> 433 CBBs   AC7 )D7DDc                T   V P                    F  w  rpV P                  WR 7      ;_uu_ 4        \        P                  ! WR4      pV P	                  WC4       \        P                  ! WR4      pV P	                  WC4       V'       gS   \        P                  ! VRR4      pV P	                  WC4       \        P                  ! VRR4      pV P	                  WC4       RRR4       K  	  V P
                   F  w  rrSV P                  WVR7      ;_uu_ 4        \        VP                  4       4      pV\        VP                  4       4      ,           p\        P                  ! WV4      pV P	                  WC4       RRR4       K  	  R#   + '       g   i     EK  ; i  + '       g   i     K  ; i)r  Nr  r   )	r  r  r  pyobject_vectorcallr  r  r  r   values)r   r   r  r:   r  r  kwnamess   &      r   test_vectorcallFastCallTests.test_vectorcall0  sN    %)$6$6 D433"66t4H!!&3 #66t2F!!&3&::4tLF%%f7 '::4rJF%%f7! 43 %7& -1,=,=(D46BB.eFMMO44"66t7K!!&3	 CB ->% 433& CBBs   B+FA"FFF'c                h     ! R  R4      pV! V! 4       R7      p\        RRRV3/ VP                  B  R# )c                   2   a  ] tR tRt o R.tR tR tRtV tR# )>FastCallTests.test_fastcall_clearing_dict.<locals>.IntWithDictiQ  r  c                    Wn         R # r*   r  )r   r  s   &,r   __init__GFastCallTests.test_fastcall_clearing_dict.<locals>.IntWithDict.__init__S  s    $r   c                d    V P                   P                  4        \        P                  ! 4        ^ # r   )r  cleargccollectr   s   &r   	__index__HFastCallTests.test_fastcall_clearing_dict.<locals>.IntWithDict.__index__U  s    !!#

r   r  N)	r   r   r   r    	__slots__r  r  r!   r"   r#   s   @r   IntWithDictr  Q  s     !
I% r   r  )optimizepassr   execN)compiler  )r   r  r|   s   &  r   test_fastcall_clearing_dict)FastCallTests.test_fastcall_clearing_dictN  s3    	 	 / 	FA22r   r   r6  rM  ){   )&r   r   r   r    r  r  r  r  r  r  PYTHON_INSTANCEr  r  r  r  r  r  	_instancer  r  r  r  extendr&  r8  r  r  r  rg  rB  r  unittestskipIfr  r  r  r!   r"   r#   s   @r   r  r    sw     
!Q  
r7# 
	!	!2}5		"	"B7 
		!Q0		%	%r73		%	%r=9		&	&N;#M6 
{QF+	fa+aV4 
		{QF;			fa%;aVDL y**,		"	"  )"5"56  "I$7$78!!4(#
C   !!6M6+BC**]FMBD""F]F,CD""B(;<++]FMBD++M:<"m4W}c&:;"  **S#Jc
(KM**c
]Bc
$CE**B FH++S#Jc
(KM++c
]Bc
$CE++B FH! +#
H+ __Y$&(<=4 >4& __Y$&(<=4 >4:3 3r   r  c                    V # zsome docr   r   s   &r   testfunctionr  d      Kr   c                   V # r  r   )r   r+   s   &$r   testfunction_kwr  i  r   r   c                      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 4       t]R 4       t]R 4       tRtV tR# )
TestPEP590in  c                   ^ RI pVP                  ^4      ! \        4      pV P                  \	        \
        4      P                  \        ,          4       V P                  \	        \        P                  4      P                  \        ,          4       V P                  \	        \        P                  4      P                  \        ,          4       V P                  \	        \        4      P                  \        ,          4       V P                  \	        V4      P                  \        ,          4       V P                  \        P                  P                  \        ,          4       V P                  \        P                  P                  \        ,          4       V P                  \        P                  P                  \        ,          4        ! R R\        P                  4      pV P                  VP                  \        ,          4       R# )r   Nc                       ] tR tRtRtR# )DTestPEP590.test_method_descriptor_flag.<locals>.MethodDescriptorHeapi  r   Nr   r   r   r    r!   r   r   r   MethodDescriptorHeapr        r   r	  )	functools	lru_cacher  assertFalsetyperepr	__flags__Py_TPFLAGS_METHOD_DESCRIPTOR
assertTruer4   append__add__r  MethodDescriptorBaseMethodDescriptorDerivedMethodDescriptorNopGet)r   r  cachedr	  s   &   r   test_method_descriptor_flag&TestPEP590.test_method_descriptor_flagq  s<   $$Q'5d--0LLMT[[)336RRST\\*447SST\*447SSTV..1MMN	66@@C__`	99CCFbbc99CCFbbc	9#A#A 	-77:VVWr   c                   V P                  \        P                  P                  \        ,          4       V P                  \        P
                  P                  \        ,          4       V P                  \        P                  P                  \        ,          4       V P                  \        P                  P                  \        ,          4        ! R  R\        P                  4      pV P                  VP                  \        ,          4       \        Vn
        V P                  VP                  \        ,          4        ! R R\        P                  4      pV P                  VP                  \        ,          4       R# )c                       ] tR tRtRtR# )=TestPEP590.test_vectorcall_flag.<locals>.MethodDescriptorHeapi  r   Nr  r   r   r   r	  r    r
  r   r	  c                   &   a  ] tR tRt o R tRtV tR# )r  i  c                    R # r*   r   r   s   &r   __call__FTestPEP590.test_vectorcall_flag.<locals>.MethodDescriptorHeap.__call__  rH   r   r   Nr   r   r   r    r   r!   r"   r#   s   @r   r	  r    rJ   r   N)r  r  r  r  Py_TPFLAGS_HAVE_VECTORCALLr  r  r  MethodDescriptor2r   r   )r   r	  s   & r   test_vectorcall_flagTestPEP590.test_vectorcall_flag  s    	66@@C]]^	99CCF``a99CCF``a	33==@ZZ[	9#A#A 	,669SST(-%-77:TTU	9#A#A 	 	-77:TTUr   c                    \        \        ^4      4      p\        P                  ! 4       pV P	                  V! V!  V4       R# )   N)r  rM   r  r  assertIs)r   r  r@   s   &  r   test_vectorcall_override#TestPEP590.test_vectorcall_override  s1     U1X,,.ah%r   c                    \         P                  ! 4       pV! 4       pV P                  V! 4       R4       VP                  V4       V P                  V! 4       R4       R Vn        V P                  V! 4       R4       R# )z*Setting __call__ should disable vectorcalltp_call
vectorcallc                     R # customr   r   s   &r   r  FTestPEP590.test_vectorcall_override_on_mutable_class.<locals>.<lambda>  s    r   r1  N)r  make_vectorcall_classr8   set_vectorcallr   )r   TestTypeinstances   &  r   )test_vectorcall_override_on_mutable_class4TestPEP590.test_vectorcall_override_on_mutable_class  sc    224:Y/)\21X.r   c                <   \         P                  ! 4       p ! R RV4      pV! 4       p\         P                  ! V4      p\         P                  ! V4      pV P                  WB4       V P                  WQ4       V P                  V! 4       R4       V P                  \         P                  ! V4      R4       V P                  \         P                  ! V4      R4       V P                  \         P                  ! V4      R4       V P                  \         P                  ! V4      R4       VP                  V4       V P                  V! 4       R4       V P                  \         P                  ! V4      R4       V P                  \         P                  ! V4      R4       V P                  \         P                  ! V4      R4       V P                  \         P                  ! V4      R4       R Vn        V P                  V! 4       R4       V P                  \         P                  ! V4      R4       V P                  \         P                  ! V4      R4       V P                  \         P                  ! V4      R4       V P                  \         P                  ! V4      R4       R	# )
z:Setting __call__ on a superclass should disable vectorcallc                       ] tR tRtRtR# )FTestPEP590.test_vectorcall_override_with_subclass.<locals>.DerivedTypei  r   Nr  r   r   r   DerivedTyper;    r
  r   r<  r-  Tr.  c                     R # r0  r   r   s   &r   r  CTestPEP590.test_vectorcall_override_with_subclass.<locals>.<lambda>  s    (r   r1  FN)r  r3  assertIsSubclassr8   has_vectorcall_flagr4  r   )r   	SuperTyper<  r6  UnaffectedType1UnaffectedType2s   &     r   &test_vectorcall_override_with_subclass1TestPEP590.test_vectorcall_override_with_subclass  s   335		) 	 = $99+F#99)D 	o;o9 	Y/66yA4H66{CTJ66GN66GN 		*\266yA4H66{CTJ66GN66GN 3	X.66yA5I66{CUK66GN66GNr   c                *  a \         \        ^*4      3/ ^*3\        P                  . ^ 3/ R3. P                  R/ R3\        ^$.3R^/^*3\
        R/ ^*3\        RRR/^*3\        P                  ! 4       R/ R3\        P                  ! 4       R/ R3\        P                  ! 4       R/ R3.	p^ RIHoHp ^ RIHp ^ RIHp V3R	 lpV Fh  w  rgrV P#                  \%        V4      4      ;_uu_ 4        V'       g   V P'                  W! Wg4      4       V P'                  W! WgV4      4       RRR4       Kj  	   ! R
 R\        P                  4      p
 ! R R\        P                  4      p ! R R4      p ! R RV\        P                  4      pV\(        P*                  / 3RR/R3/ P*                  / 3RR/R3V
! 4       R/ R3V! 4       R/ R3V! 4       R/ R3.,          pV EF  w  rgrV P#                  \%        V4      4      ;_uu_ 4        VR,          pV! Wg^ ,          4      pV! V4      pV'       gZ   V P'                  W! V!  4       V P'                  V	S! WgR4      4       V P'                  W! V!  4       V P'                  V	V! V!  4       V P'                  W! V/ VB 4       V P'                  W! WgV4      4       V P'                  W! V/ VB 4       V P'                  V	V! V/ VB 4       RRR4       EK  	  R#   + '       g   i     EK=  ; i  + '       g   i     EK?  ; i)*   Nstartr+   TF)r  pyvectorcall_call)
MethodType)partialc                 V   < . VOVP                  4       O5p\        V4      pS! WV4      # r*   )r  r  )r   r  r  r  r  s   &&& r   r.  .TestPEP590.test_vectorcall.<locals>.vectorcall  s.    *D*6==?*DFmG&t7;;r   c                       ] tR tRtRtR# )8TestPEP590.test_vectorcall.<locals>.MethodDescriptorHeapi  r   Nr  r   r   r   r	  rO    r
  r   r	  c                   &   a  ] tR tRt o R tRtV tR# )>TestPEP590.test_vectorcall.<locals>.MethodDescriptorOverriddeni   c                    R # )newr   )r   ns   &&r   r   GTestPEP590.test_vectorcall.<locals>.MethodDescriptorOverridden.__call__  s    r   r   Nr"  r#   s   @r   MethodDescriptorOverriddenrQ     s      r   rV  c                   2   a a ] tR tRt oV 3R ltRtVtV ;t# )-TestPEP590.test_vectorcall.<locals>.SuperBasei  c                    < \         SV `  ! V!  # r*   superr   r   r  	__class__s   &*r   r   6TestPEP590.test_vectorcall.<locals>.SuperBase.__call__      w'..r   r   r   r   r   r    r   r!   r"   __classcell__r]  r$   s   @@r   	SuperBaserX         / /r   rc  c                   2   a a ] tR tRt oV 3R ltRtVtV ;t# )9TestPEP590.test_vectorcall.<locals>.MethodDescriptorSuperi  c                    < \         SV `  ! V!  # r*   rZ  r\  s   &*r   r   BTestPEP590.test_vectorcall.<locals>.MethodDescriptorSuper.__call__	  r_  r   r   r`  rb  s   @@r   MethodDescriptorSuperrf    rd  r   ri  r   rS  :r.   NNr  )rG  )lenrM   r4   r  sumr  r  r  r  r  r$  r  rI  r  rJ  r  rK  r  r   r8   r7   update)r   callsrI  rJ  rK  r.  r   r  r  r:   r	  rV  rc  ri  args1methwrappedr  s   &                @r   r  TestPEP590.test_vectorcall  s    b	|R,++AwD1))T2t,wR0r2.!54+r:002D"dC335tRF--/r5AC 	E$%	<
 /4*Tc$i(($$X/@/LM  +<T+PQ )( /4	9#A#A 		)G)G 		/ 	/	/Iy/M/M 	/ 	[[2%%t4YYd|T2!#T2t4')4U;"$dB5
 	
 /4*Tc$i((R!$Q0!$-$$XtT{;$$X/B4t/TU$$XtU|<$$Xw~>  4+@+@A  :d&+IJ  4+A&+AB  7D+CF+CD )( /4? )((@ )((s   (8K+<C L +K= Lc                    ^ RI Hp \        P                  ! R4      pR pV P                  p^
pV! ^V! V4      4       V! V4       \        VP                  4       F  pV! RV! V4      4       K  	  R# )r   function_setvectorcall_testinternalcapic                     V ^,           # rM  r   nums   &r   r@   (TestPEP590.test_setvectorcall.<locals>.f&  s
    37Nr   
overriddenN)r  rt  r   import_moduler8   rM   SPECIALIZATION_THRESHOLD)r   rt  ru  r@   assert_equalrx  rQ   s   &      r   test_setvectorcallTestPEP590.test_setvectorcall#  se    4)778KL"''R3 q!(AABAqv. Cr   c                    ^ RI Hp \        P                  ! R4      p ! R R4      pV P                  pV! 4       pV! RVP
                  4       V! VP                  4       \        VP                  4       F  pV! RVP
                  4       K  	  R# )r   rs  ru  c                   &   a  ] tR tRt o R tRtV tR# )FTestPEP590.test_setvectorcall_load_attr_specialization_skip.<locals>.Xi2  c                    V# r*   r   r   attrs   &&r   __getattribute__WTestPEP590.test_setvectorcall_load_attr_specialization_skip.<locals>.X.__getattribute__3      r   r   Nr   r   r   r    r  r!   r"   r#   s   @r   Xr  2        r   r  r(   rz  N)	r  rt  r   r{  r8   r(   r  rM   r|  )r   rt  ru  r  r}  r|   rQ   s   &      r   0test_setvectorcall_load_attr_specialization_skip;TestPEP590.test_setvectorcall_load_attr_specialization_skip.  sx    4)778KL	 	 ''CS!##q112 (AABAqss+ Cr   c                N   ^ RI Hp \        P                  ! R4      p ! R R4      pR pV P                  pV! 4       p\        VP                  4       F  pV! RV! V4      4       K  	  V! VP                  4       \        VP                  4       F  pV! RV! V4      4       K  	  R# )	r   rs  ru  c                   &   a  ] tR tRt o R tRtV tR# )GTestPEP590.test_setvectorcall_load_attr_specialization_deopt.<locals>.XiC  c                    V# r*   r   r  s   &&r   r  XTestPEP590.test_setvectorcall_load_attr_specialization_deopt.<locals>.X.__getattribute__D  r  r   r   Nr  r#   s   @r   r  r  C  r  r   r  c                     V P                   # r*   r(   r{   s   &r   get_aKTestPEP590.test_setvectorcall_load_attr_specialization_deopt.<locals>.get_aG  s    33Jr   r(   rz  N)r  rt  r   r{  r8   rM   r|  r  )r   rt  ru  r  r  r}  r|   rQ   s   &       r   1test_setvectorcall_load_attr_specialization_deopt<TestPEP590.test_setvectorcall_load_attr_specialization_deopt?  s    4)778KL	 		 ''C(AABAeAh' Cq112 (AABAuQx0 Cr   c           
        ^ RI Hp \        P                  \        P                  3 FG  pV P                  VR7      ;_uu_ 4        V! 4       pV P                  V! VRR4      R4       RRR4       KI  	  R#   + '       g   i     K^  ; i)r   )r  r  zvectorcall calledNr   )r  r  _testlimitedcapiLimitedVectorCallClassLimitedRelativeVectorCallClassr  r8   )r   r  r  r  s   &   r    test_vectorcall_limited_incoming+TestPEP590.test_vectorcall_limited_incomingU  sl    1$;;$CCEC#&&e  'R4') '&E&&&s   "A44Bc                   aa ^ RI Hp . o. oVV3R lpV P                  V! V4      R4       V P                  SR.4       V P                  SRR/.4       R# )r   )call_vectorcallc                  L   < SP                  V 4       SP                  V4       R # successr  )r  r  args_capturedkwargs_captureds   *,r   r@   6TestPEP590.test_vectorcall_limited_outgoing.<locals>.fg  s"      &""6*r   r  bazbarNr   )r  r  r8   )r   r  r@   r  r  s   &  @@r    test_vectorcall_limited_outgoing+TestPEP590.test_vectorcall_limited_outgoing`  sU    4	
 	+Y7
3E5>*:;r   c                   aa ^ RI Hp . o. o ! VV3R lR4      pV P                  V! V! 4       4      R4       V P                  SR.4       V P                  SRR/.4       R# )	r   )call_vectorcall_methodc                   0   <a  ] tR tRt o VV3R ltRtV tR# )HTestPEP590.test_vectorcall_limited_outgoing_method.<locals>.TestInstanceiw  c                L   < SP                  V4       SP                  V4       R # r  r  )r   r  r  r  r  s   &*,r   r@   JTestPEP590.test_vectorcall_limited_outgoing_method.<locals>.TestInstance.fx  s"    $$T*&&v. r   r   N)r   r   r   r    r@   r!   r"   )r$   r  r  s   @r   TestInstancer  w  s     ! !r   r  r  r  r  Nr  )r  r  r8   )r   r  r  r  r  s   &  @@r   'test_vectorcall_limited_outgoing_method2TestPEP590.test_vectorcall_limited_outgoing_methodp  s]    ;	! 	! 	/?K
3E5>*:;r   r   N)r   r   r   r    r  r%  r*  r7  rD  r  r~  r  r  r   r  r  r  r!   r"   r#   s   @r   r  r  n  su     X&V*&/'OTJEX	/,"1, ) ) < < < <r   r  c                   F   a  ] tR tRt o R t]R 4       t]R 4       tRtV t	R# )Ai  c                    R # r*   r   )r   r|   r   s   &&&r   method_two_argsA.method_two_args  s    r   c                     R # r*   r   r   r   r   static_no_argsA.static_no_args      r   c                   R # r*   r   args   "r   positional_onlyA.positional_only  r  r   r   N)
r   r   r   r    r  r   r  r  r!   r"   r#   s   @r   r  r    s2         r   r  c                   b   a  ] tR tRt o ]P
                  R 4       tR tR tR t	R t
R tRtV tR	# )
!TestErrorMessagesUseQualifiedNamei  c              #     "   V P                  \        4      ;_uu_ 4       pR x  R R R 4       V P                  \        XP                  4      V4       R #   + '       g   i     L7; i5ir*   )assertRaisesrN   r8   r   	exceptionr   messagecms   && r   check_raises_type_error9TestErrorMessagesUseQualifiedName.check_raises_type_error  sA     y))R *R\\*G4 *)   A'A/A'A$	A'c                    R pV P                  V4      ;_uu_ 4        \        4       P                  R4       RRR4       R#   + '       g   i     R# ; i)z?A.method_two_args() missing 1 required positional argument: 'y'r|   Nr  r  r  rZ   s   & r   test_missing_arguments8TestErrorMessagesUseQualifiedName.test_missing_arguments  s7    O))#..C$ /...s   A  A	c                    R pV P                  V4      ;_uu_ 4        \        P                  R4       RRR4       R#   + '       g   i     R# ; i)z?A.static_no_args() takes 0 positional arguments but 1 was givenzoops it's an argN)r  r  r  rZ   s   & r   test_too_many_positional:TestErrorMessagesUseQualifiedName.test_too_many_positional  s6    O))#../0 /...s	   <A	c                    R pV P                  V4      ;_uu_ 4        \        P                  RR7       RRR4       R#   + '       g   i     R# ; i)zYA.positional_only() got some positional-only arguments passed as keyword arguments: 'arg'r|   r  N)r  r  r  rZ   s   & r   &test_positional_only_passed_as_keywordHTestErrorMessagesUseQualifiedName.test_positional_only_passed_as_keyword  s8    i))#..#& /...s	   =A	c                    R pV P                  V4      ;_uu_ 4        \        4       P                  RR7       RRR4       R#   + '       g   i     R# ; i)z<A.method_two_args() got an unexpected keyword argument 'bad'r|   )badNr  rZ   s   & r   test_unexpected_keyword9TestErrorMessagesUseQualifiedName.test_unexpected_keyword  s:    L))#..CC( /...s   AA	c                    R pV P                  V4      ;_uu_ 4        \        4       P                  RRRR7       RRR4       R#   + '       g   i     R# ; i)z8A.method_two_args() got multiple values for argument 'x'r|   r   oopsr{   Nr  rZ   s   & r   test_multiple_values6TestErrorMessagesUseQualifiedName.test_multiple_values  s>    H))#..CSF3 /...s   AA	r   N)r   r   r   r    
contextlibcontextmanagerr  r  r  r  r  r  r!   r"   r#   s   @r   r  r    s=      5 5
%
1
'
)
4 4r   r  c                   z   a  ] tR tRt o ]P
                  R 4       t]P
                  R 4       tR tR t	R t
RtV tR# )	TestErrorMessagesSuggestionsi  c              #     "   V P                  \        4      ;_uu_ 4       pR x  R R R 4       V P                  RV R2\        XP                  4      4       R #   + '       g   i     L;; i5i)NzDid you mean 'z'?)r  rN   assertInr   r  r  s   && r   check_suggestion_includes6TestErrorMessagesSuggestions.check_suggestion_includes  sH     y))R *wir2C4EF *)s   A+A3A+A(	#A+c              #     "   V P                  \        4      ;_uu_ 4       pR x  R R R 4       V P                  R\        XP                  4      4       R #   + '       g   i     L7; i5i)NzDid you mean)r  rN   assertNotInr   r  )r   r  s   & r   check_suggestion_not_present9TestErrorMessagesSuggestions.check_suggestion_not_present  sA     y))R *R\\):; *)r  c                T   RRR /R llp. ROpV Fm  w  r4V P                  V4      ;_uu_ 4        V'       d   V P                  V4      MV P                  4       pV;_uu_ 4        V! R/ VR /B  R R R 4       R R R 4       Ko  	  R #   + '       g   i     L; i  + '       g   i     K  ; i)Nlate1c                   R # r*   r   )blechaaar  r  s   "&$*r   r   \TestErrorMessagesSuggestions.test_unexpected_keyword_suggestion_valid_positions.<locals>.foo  rB   r   NN))blachN)aar  )orgsN)late11r  r   )r  r  r  )r   r   caseskeyword
suggestionctxs   &     r   2test_unexpected_keyword_suggestion_valid_positionsOTestErrorMessagesSuggestions.test_unexpected_keyword_suggestion_valid_positions  s    	d 	
 $)Gg&&DNd44Z@TXTuTuTwS)74.)  '& $) S '&&s#   4B"B-BBBB'c           
     z   RR lpRR lpRR lpRR lpRR lpRR lpRR lpVR3VR	3VR
3VR3VR3VR3VR3VR33 FR  w  rV P                  V	4      ;_uu_ 4        V P                  V	4      ;_uu_ 4        V! R R7       R R R 4       R R R 4       KT  	  R #   + '       g   i     L; i  + '       g   i     K|  ; i)Nc                     R # r*   r   )noise
more_noiser(   r  s   &&&&r   substitution[TestErrorMessagesSuggestions.test_unexpected_keyword_suggestion_kinds.<locals>.substitution  rB   r   c                     R # r*   r   )r   r  r(   blchs   &&&&r   eliminationZTestErrorMessagesSuggestions.test_unexpected_keyword_suggestion_kinds.<locals>.elimination  rB   r   c                     R # r*   r   )r   r  r(   bluchins   &&&&r   additionWTestErrorMessagesSuggestions.test_unexpected_keyword_suggestion_kinds.<locals>.addition  rB   r   c                     R # r*   r   )r  blucs   &&r   substitution_over_eliminationlTestErrorMessagesSuggestions.test_unexpected_keyword_suggestion_kinds.<locals>.substitution_over_elimination  rB   r   c                     R # r*   r   )r  bluchis   &&r   substitution_over_additioniTestErrorMessagesSuggestions.test_unexpected_keyword_suggestion_kinds.<locals>.substitution_over_addition  rB   r   c                     R # r*   r   )r  bluchas   &&r   elimination_over_additionhTestErrorMessagesSuggestions.test_unexpected_keyword_suggestion_kinds.<locals>.elimination_over_addition  rB   r   c                     R # r*   r   )BLuchLuchfluchs   &&&r   case_change_over_substitutionlTestErrorMessagesSuggestions.test_unexpected_keyword_suggestion_kinds.<locals>.case_change_over_substitution  rB   r   r	  r  r  r  r  r  )bluch)NNNNr  )NNN)r  r  )
r   r  r  r
  r  r  r  r  r   r  s
   &         r   (test_unexpected_keyword_suggestion_kindsETestErrorMessagesSuggestions.test_unexpected_keyword_suggestion_kinds  s    							 y!7#&!y!*G4'1&/*G4	!
D j))33J??t$ @ *)	!
 @? *))s$   B)6
B B)B&!B))B:c                   V P                  R 4      ;_uu_ 4        RP                  ^R7       RRR4       V P                  \        RRP                  ^R7       V P	                  4       ;_uu_ 4        RP                  ^R7       RRR4       V P	                  4       ;_uu_ 4        RP                  ^^R7       RRR4       V P                  R4      ;_uu_ 4        \        RR	7       RRR4       V P                  \        R
\
        ^R7       V P	                  4       ;_uu_ 4        \        ^R7       RRR4       V P	                  4       ;_uu_ 4        \        ^RR7       RRR4       R#   + '       g   i     ELC; i  + '       g   i     EL; i  + '       g   i     L; i  + '       g   i     L; i  + '       g   i     L; i  + '       g   i     R# ; i)maxsplitr   )maxspltNz5split\(\) got an unexpected keyword argument 'blech'$)r  )r  r#  r   r  )namezz;ImportError\(\) got an unexpected keyword argument 'blech'$)r  r$  )r  splitrX   rN   r  r   r   s   &r   .test_unexpected_keyword_suggestion_via_getargsKTestErrorMessagesSuggestions.test_unexpected_keyword_suggestion_via_getargs  sL   ++J77KKK" 8 	OKKq 	 	
 ..00KKaK  1..00KK1aK0 1 ++F33f% 4 	Uq 	 	
 ..00a  1..00av. 10- 877 10000 43 10000sG   E'0E;#FF""F5G'E8	;F	F	"F2	5G	G	r   N)r   r   r   r    r  r  r  r  r  r  r&  r!   r"   r#   s   @r   r  r    sN     G G
 < <
*"#%J/ /r   r  c                      a  ] tR tRt o ]]P                  ! ];'       d    ]R4      ]	! RRR7      ]P                  ! ]
RJ R4      ]! 4       ]! 4       R 4       4       4       4       4       4       tR tR	tV tR# )
TestRecursioni  zrequires deep stackT)threadNr  c           	     V  aaaa V3R  loVV3R loV3R loV3R lo\        R4      ;_uu_ 4        S! R4       V P                  \        4      ;_uu_ 4        S! R4       RRR4       S! ^24       V P                  \        4      ;_uu_ 4        S! R4       RRR4       S! ^24       V P                  \        4      ;_uu_ 4        S! R4       RRR4       RRR4       R#   + '       g   i     L; i  + '       g   i     Lc; i  + '       g   i     L@; i  + '       g   i     R# ; i)c                 :   < V '       d   S! V ^,
          4       R# R# r@  r   )rT  recurses   &r   r-  .TestRecursion.test_super_deep.<locals>.recurse  s    ! r   c                 Z   < V '       d   S! V ^,
          V4       R# S! V^,
          4       R# r@  r   )rT  rF   c_py_recurse
py_recurses   &&r   r1  1TestRecursion.test_super_deep.<locals>.py_recurse  s     1Q3"QqS!r   c                 \   < V '       d#   \         P                  ! SV ^,
          3R4       R# R# )r.   Nr   r  r  )rT  	c_recurses   &r   r5  0TestRecursion.test_super_deep.<locals>.c_recurse"  s#    --i!A#D r   c                 P   < V '       d   \         P                  ! SR V 3R4       R# R# )rK   Nr   r4  )rF   r1  s   &r   r0  3TestRecursion.test_super_deep.<locals>.c_py_recurse&  s!    --j4)RH r   i i_ i N)r   r  RecursionError)r   r0  r5  r1  r-  s   &@@@@r   test_super_deepTestRecursion.test_super_deep  s    		"	E	I !))FO"">22  3bM"">22&! 3"">22W% 3 *)22 32 32 *))sS   &D	C	 -D	C1	-D	D	DC.)D1D<DDDD(	c                   a RV3R lloV P                  \        4      ;_uu_ 4        S! 4        RRR4       R#   + '       g   i     R# ; i)r   c                    < S! ^ R7       R# )r   r  Nr   )r(   
recurse_kws   &r   r>  <TestRecursion.test_recursion_with_kwargs.<locals>.recurse_kw8  s
    Or   Nr  )r  r9  )r   r>  s   &@r   test_recursion_with_kwargs(TestRecursion.test_recursion_with_kwargs5  s-    	~..L /...s	   9A
	r   )r   r   r   r    r   r  r  r   r   r   r  r	   r
   r:  r@  r!   r"   r#   s   @r   r)  r)    s      __W))+@A,T:__Y$&(<=#%&   & > ; B &> r   r)  c                   &   a  ] tR tRt o R tRtV tR# )TestFunctionWithManyArgsi>  c           
        R F  pV P                  VR7      ;_uu_ 4        RP                  \        V4       Uu. uF  pRV 2NK
  	  up4      pRV RV^,           2p/ p\        V/ V4       V P	                  VR,          ! \        V4      !  V^,          4       RRR4       K  	  R# u upi   + '       g   i     K  ; i)	
   )Nr   r(   zdef f(z) : return ar@   N)rE  i  rK   )r  joinrM   r  r8   )r   rF  ir  srcls   &     r   test_function_with_many_args5TestFunctionWithManyArgs.test_function_with_many_args?  s     A""xx%( ;(Q1QC( ;<tfLA7S"a   3q!2AqD9 #" ! ; #""s   B,B'AB,'B,,B=r   N)r   r   r   r    rK  r!   r"   r#   s   @r   rC  rC  >  s     : :r   rC  zneed _testcapic                   &   a  ] tR tRt o R tRtV tR# )TestCAPIiI  c                    R  pR pV P                  V! V4      R/ 34       V P                  V! V^^^4      R/ 34       V P                  V! VR^R7      RR^/34       R# )	c                      W3# r*   r   )r  r  s   *,r   r   *TestCAPI.test_cfunction_call.<locals>.funcL  s
    >!r   c                 l    V'       d   \         P                  ! WV4      # \         P                  ! W4      # r*   )r  pycfunction_callr  s   &*,r   PyCFunction_Call6TestCAPI.test_cfunction_call.<locals>.PyCFunction_CallQ  s)     11$fEE 11$==r   r  rw  rx  Nr   r$  r  )r8   )r   r   rT  s   &  r   test_cfunction_callTestCAPI.test_cfunction_callK  sl    	"
	> 	)$/"b:)$1a89b/J)$1=5RS*?UVr   r   N)r   r   r   r    rV  r!   r"   r#   s   @r   rN  rN  I  s     W Wr   rN  __main__i   i   )4r  test.supportr   r   r   r   r   r   r	   r
   r   r   r  r   r  r   r1   r   r  r  r  r   r   TestCaser&   rU   r  r  r  r  r  r  r  r  r  r  r   r  r  r#  r  r  r  r  r  r  r  r)  rC  rN  r   mainr   r   r   <module>r\     sq   ) ) )
    	  &S &H%% B z4("3"3 z4 z4z 
d"$89H
X.. H
 :H
VA%; A<"8 <1*@ 1"#9 "   -X3H%% X3v % & 

 
d"$89P<"" P< :P<d
 
 4(9(9 4 4B [/8#4#4 [/ [/z -H%% - -`:x00 : 
d"$45Wx   W 6W$ zMMO g"  I  s"   G2 H 2	G?>G?	HH