+
    Bi}J                         R t ^ RIt^ RIt^ RIt^ RIt^ RIHt R tR tR	R lt	 ! R R]P                  4      t]R8X  d   ]P                  ! 4        R# R# )
zHUnit tests for the positional only argument syntax specified in PEP 570.Ncheck_syntax_errorc                    W3# N abs   ""4/usr/lib/python3.14/test/test_positional_only_arg.pyglobal_pos_only_fr      	    4K    c                    W3# r   r   r   s   "&r
   global_pos_only_and_normalr      r   r   c                    W3# r   r   r   s   "&r
   global_pos_only_defaultsr      r   r   c                      a  ] tR t^t o R R l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# )!PositionalOnlyTestCasec                    V P                  \        V4      ;_uu_ 4        \        VR ,           RR4       RRR4       R#   + '       g   i     R# ; i)
<test>singleN)assertRaisesRegexSyntaxErrorcompile)selfcodestrregexs   &&&r
   assertRaisesSyntaxError.PositionalOnlyTestCase.assertRaisesSyntaxError   s4    ##K77GdNHh7 8777s	   >A	c                   \        V R R4       \        V RR4       \        V RR4       \        V RR4       \        V RR4       \        V R4       \        V R4       \        V R4       \        V R	4       \        V R
4       \        V R4       \        V R4       \        V R4       \        V RR4       \        V RR4       \        V R4       \        V R4       \        V R4       \        V R4       \        V R4       R# )zdef f(a, b = 5, /, c): pass<parameter without a default follows parameter with a defaultzdef f(a = 5, b, /, c): passz%def f(a = 5, b=1, /, c, *, d=2): passzdef f(a = 5, b, /): passzdef f(a, /, b = 5, c): passzdef f(*args, /): passzdef f(*args, a, /): passzdef f(**kwargs, /): passzdef f(/, a = 1): passzdef f(/, a): passzdef f(/): passzdef f(*, a, /): passzdef f(*, /, a): passzdef f(a, /, a): pass-duplicate argument 'a' in function definitionzdef f(a, /, *, a): passzdef f(a, b/2, c): passzdef f(a, /, c, /): passzdef f(a, /, c, /, d): passz def f(a, /, c, /, d, *, e): passzdef f(a, *, c, /, d, e): passNr   r   s   &r
   test_invalid_syntax_errors1PositionalOnlyTestCase.test_invalid_syntax_errors   s    4!>@~4!>@~4!H  KI  	J4!;={|4!>@~4!894!;<4!;<4!894!454!124!784!784!79hi4!:<kl4!9:4!:;4!=>4!CD4!@Ar   c                   \        V R R4       \        V RR4       \        V RR4       \        V RR4       \        V RR4       \        V R4       \        V R4       \        V R4       \        V R	4       \        V R
4       \        V R4       \        V R4       \        V R4       \        V RR4       \        V RR4       \        V R4       \        V R4       \        V R4       \        V R4       \        V R4       R# )z!async def f(a, b = 5, /, c): passr!   z!async def f(a = 5, b, /, c): passz(async def f(a = 5, b=1, /, c, d=2): passzasync def f(a = 5, b, /): passz!async def f(a, /, b = 5, c): passzasync def f(*args, /): passzasync def f(*args, a, /): passzasync def f(**kwargs, /): passzasync def f(/, a = 1): passzasync def f(/, a): passzasync def f(/): passzasync def f(*, a, /): passzasync def f(*, /, a): passzasync def f(a, /, a): passr"   zasync def f(a, /, *, a): passzasync def f(a, b/2, c): passzasync def f(a, /, c, /): passz async def f(a, /, c, /, d): passz&async def f(a, /, c, /, d, *, e): passz#async def f(a, *, c, /, d, e): passNr   r#   s   &r
    test_invalid_syntax_errors_async7PositionalOnlyTestCase.test_invalid_syntax_errors_async0   s   4!D  GE  	F4!D  GE  	F4!K  NL  	M4!A  DB  	C4!D  GE  	F4!>?4!AB4!AB4!>?4!:;4!784!=>4!=>4!=?no4!@Bqr4!?@4!@A4!CD4!IJ4!FGr   c                   RR lpV P                  V! ^^^4      ^4       V P                  V! ^^^R7      ^4       V P                  \        R4      ;_uu_ 4        V! ^^^R7       RRR4       V P                  V! ^^4      ^g4       V P                  \        R4      ;_uu_ 4        V! ^^R7       RRR4       V P                  V! ^^R7      ^4       R	R lpV P                  V! ^^^4      ^4       V P                  V! ^^^R7      ^4       V P                  \        R4      ;_uu_ 4        V! ^^^R7       RRR4       V P                  V! ^^4      ^g4       V P                  \        R4      ;_uu_ 4        V! ^^R7       RRR4       V P                  V! ^^R7      ^4       R#   + '       g   i     ELG; i  + '       g   i     EL; i  + '       g   i     L; i  + '       g   i     Lg; i)

   c                     W,           V,           # r   r   r   r	   cs   ""&r
   fDPositionalOnlyTestCase.test_optional_positional_only_args.<locals>.fG       519r   r-   If\(\) got some positional-only arguments passed as keyword arguments: 'b'r	   r-   Nr	   c                     W,           V,           # r   r   r,   s   ""&r
   r.   r/   T   r0   r   )r*   d   )   r*   r6   assertEqualr   	TypeErrorr   r.   s   & r
   "test_optional_positional_only_args9PositionalOnlyTestCase.test_optional_positional_only_argsF   s   	 	1aQ'1a1q)##I/{||a1N } 	1a#&##I/{||a1I }1B'	 	1aQ'1a1q)##I/{||a1N } 	1a#&##I/{||a1I }1B'' }|| }|| }| }|s0   F#$F7)G4G#F4	7G	G	G.	c                p    R RP                  R \        R4       4       4      ,          p\        VRR4       R# )def f(%s, /):
  pass
, c              3   4   "   T F  pR V,          x  K  	  R# 5izi%dNr   .0is   & r
   	<genexpr>NPositionalOnlyTestCase.test_syntax_for_many_positional_only.<locals>.<genexpr>c        6U*Quqyy*   ,  r   r   Njoinranger   r   fundefs   & r
   $test_syntax_for_many_positional_only;PositionalOnlyTestCase.test_syntax_for_many_positional_onlya   ,    *TYY6U%PS*6U-UU(+r   c                   RR^/R llpV P                  ^VP                  P                  4       V P                  ^VP                  P                  4       V P                  RVP                  4       RR^/R llpV P                  ^VP                  P                  4       V P                  ^VP                  P                  4       V P                  RVP                  4       R# )r7   gc                   R # r   r   r   r	   r-   der.   rT   s   """&&$$r
   r.   :PositionalOnlyTestCase.test_pos_only_definition.<locals>.fg       r   c                   R # r   r   rV   s   """&&$$r
   r.   rY   n   rZ   r   N)r7   r7         )r9   __code__co_argcountco_posonlyargcount__defaults__r;   s   & r
   test_pos_only_definition/PositionalOnlyTestCase.test_pos_only_definitionf   s    	! 	 	AJJ223AJJ99:q~~.	a 	 	AJJ223AJJ99:ANN3r   c                <    R  pV P                  V! ^^.!  ^4       R# )c                    W,           # r   r   r   s   ""r
   r.   BPositionalOnlyTestCase.test_pos_only_call_via_unpacking.<locals>.fv   s	    5Lr   Nr9   r;   s   & r
    test_pos_only_call_via_unpacking7PositionalOnlyTestCase.test_pos_only_call_via_unpackingu   s!    	 	QFQ'r   c                   R  pRpV P                  \        V4      ;_uu_ 4        V! ^R7       RRR4       R pRpV P                  \        V4      ;_uu_ 4        V! ^^R7       RRR4       R pRpV P                  \        V4      ;_uu_ 4        V! ^^R7       RRR4       R#   + '       g   i     L~; i  + '       g   i     L[; i  + '       g   i     R# ; i)c                    R # r   r   r   s   "r
   r.   @PositionalOnlyTestCase.test_use_positional_as_keyword.<locals>.f|   rZ   r   If\(\) got some positional-only arguments passed as keyword arguments: 'a'rm   Nc                    R # r   r   r   s   "&r
   r.   rn      rZ   r   r   c                    R # r   r   r   s   ""r
   r.   rn      rZ   r   zLf\(\) got some positional-only arguments passed as keyword arguments: 'a, b'r   r:   )r   r.   expecteds   &  r
   test_use_positional_as_keyword5PositionalOnlyTestCase.test_use_positional_as_keyword{   s    	_##Ix88F 9	_##Ix88QK 9	b##Ix88QK 98 98 98 988s#   
B$B7C
$B4	7C	
C	c                $   R  pV P                  \        R4      ;_uu_ 4        V! ^^4       RRR4       V P                  \        R4      ;_uu_ 4        V! ^4       RRR4       V P                  \        R4      ;_uu_ 4        V! 4        RRR4       V P                  \        R4      ;_uu_ 4        V! ^^^^4       RRR4       R#   + '       g   i     L; i  + '       g   i     L; i  + '       g   i     Lj; i  + '       g   i     R# ; i)c                    R # r   r   r,   s   ""&r
   r.   LPositionalOnlyTestCase.test_positional_only_and_arg_invalid_calls.<locals>.f   rZ   r   1f\(\) missing 1 required positional argument: 'c'N:f\(\) missing 2 required positional arguments: 'b' and 'c'z@f\(\) missing 3 required positional arguments: 'a', 'b', and 'c'z3f\(\) takes 3 positional arguments but 4 were givenrr   r;   s   & r
   *test_positional_only_and_arg_invalid_callsAPositionalOnlyTestCase.test_positional_only_and_arg_invalid_calls   s    	##I/cddaG e##I/lmmaD n##I/rssC t##I/effaAqM gf edmmssfffs/   
C	CC+/C>C	C(	+C;	>D	c                   RR lpV! ^^4       V P                  \        R4      ;_uu_ 4        V! ^4       RRR4       V P                  \        R4      ;_uu_ 4        V! 4        RRR4       V P                  \        R4      ;_uu_ 4        V! ^^^^4       RRR4       R#   + '       g   i     Lr; i  + '       g   i     LW; i  + '       g   i     R# ; i)r^   c                    R # r   r   r,   s   ""&r
   r.   UPositionalOnlyTestCase.test_positional_only_and_optional_arg_invalid_calls.<locals>.f   rZ   r   1f\(\) missing 1 required positional argument: 'b'N:f\(\) missing 2 required positional arguments: 'a' and 'b'z=f\(\) takes from 2 to 3 positional arguments but 4 were given)r^   rr   r;   s   & r
   3test_positional_only_and_optional_arg_invalid_callsJPositionalOnlyTestCase.test_positional_only_and_optional_arg_invalid_calls   s    		!Q##I/cddaD e##I/lmmC n##I/oppaAqM qp	 edmmppps#   	B B3
C B0	3C	C	c                   R  pV! ^^^^^R7       V P                  \        R4      ;_uu_ 4        V! ^^^^R7       RRR4       V P                  \        R4      ;_uu_ 4        V! ^^^4       RRR4       V P                  \        R4      ;_uu_ 4        V! ^^4       RRR4       V P                  \        R4      ;_uu_ 4        V! ^4       RRR4       V P                  \        R4      ;_uu_ 4        V! 4        RRR4       V P                  \        R	4      ;_uu_ 4        V! ^^^^^^^^R7       RRR4       V P                  \        R
4      ;_uu_ 4        V! ^^^^^^8R7       RRR4       R#   + '       g   i     EL=; i  + '       g   i     EL ; i  + '       g   i     EL; i  + '       g   i     L; i  + '       g   i     L; i  + '       g   i     L; i  + '       g   i     R# ; i)c                   R # r   r   )r   r	   r-   rW   rX   s   ""&$$r
   r.   SPositionalOnlyTestCase.test_positional_only_and_kwonlyargs_invalid_calls.<locals>.f   rZ   r   )rW   rX   z-missing 1 required keyword-only argument: 'd')rX   Nz6missing 2 required keyword-only arguments: 'd' and 'e'ry   rz   z; missing 3 required positional arguments: 'a', 'b', and 'c'zif\(\) takes 3 positional arguments but 6 positional arguments \(and 2 keyword-only arguments\) were givenz,f\(\) got an unexpected keyword argument 'f')rW   rX   r.   rr   r;   s   & r
   1test_positional_only_and_kwonlyargs_invalid_callsHPositionalOnlyTestCase.test_positional_only_and_kwonlyargs_invalid_calls   sy   		!QQ!##I/_``aAO a##I/hiiaAJ j##I/cddaG e##I/lmmaD n##I/mnnC o##I 0^ _ _aAq!Q!q)_ ##I/^__aAa2& `_ a``iiidddmmnn_ _ `__sS   E0"F
F	F,2F? GG%0F	F	F)	,F<	?G	G"	%G6	c                   R  pV! ^^4       V P                  \        R4      ;_uu_ 4        V! ^4       RRR4       V P                  \        R4      ;_uu_ 4        V! 4        RRR4       V P                  \        R4      ;_uu_ 4        V! ^^^4       RRR4       R#   + '       g   i     Lq; i  + '       g   i     LV; i  + '       g   i     R# ; i)c                    R # r   r   r   s   ""r
   r.   DPositionalOnlyTestCase.test_positional_only_invalid_calls.<locals>.f   rZ   r   r   Nr   z3f\(\) takes 2 positional arguments but 3 were givenrr   r;   s   & r
   "test_positional_only_invalid_calls9PositionalOnlyTestCase.test_positional_only_invalid_calls   s    		!Q##I/cddaD e##I/lmmC n##I/effaAJ gf	 edmmfffs#   	BB0CB-	0C 	C	c                ,   RR lpV! ^4       V P                  \        R4      ;_uu_ 4        V! 4        RRR4       V P                  \        R4      ;_uu_ 4        V! ^^^4       RRR4       R#   + '       g   i     LC; i  + '       g   i     R# ; i)r]   c                    R # r   r   r   s   ""r
   r.   RPositionalOnlyTestCase.test_positional_only_with_optional_invalid_calls.<locals>.f   rZ   r   z1f\(\) missing 1 required positional argument: 'a'Nz=f\(\) takes from 1 to 2 positional arguments but 3 were givenr]   rr   r;   s   & r
   0test_positional_only_with_optional_invalid_callsGPositionalOnlyTestCase.test_positional_only_with_optional_invalid_calls   sn    		!##I/cddC e ##I/oppaAJ qp ed qpps   A/B/A?	B	c                    R  pV! ^^^R7       V P                  \        4      ;_uu_ 4        V! ^^^R7       RRR4       R#   + '       g   i     R# ; i)c                   R # r   r   r,   s   ""$r
   r.   =PositionalOnlyTestCase.test_no_standard_args_usage.<locals>.f   rZ   r   r1   r3   N)assertRaisesr:   r;   s   & r
   test_no_standard_args_usage2PositionalOnlyTestCase.test_no_standard_args_usage   s?    	 	
!Q!y))a1N *)))s   AA	c                    RR lpV P                  RVP                  4       RVn        V P                  V! ^^^4      ^4       R# )r]   c                     W,           V,           # r   r   r,   s   ""&r
   r.   >PositionalOnlyTestCase.test_change_default_pos_only.<locals>.f   r0   r   N)r]   r^   r\   )r9   rb   r;   s   & r
   test_change_default_pos_only3PositionalOnlyTestCase.test_change_default_pos_only   s<    	 	/"1aQ'r   c                   R  pV P                  V! ^^4      ^4       V P                  V! ^^R7      ^4       RR lpV P                  V! ^4      ^4       R pV P                  V! ^^4      ^4       R pV P                  V! ^^4      ^4       R# )c                    W,           # r   r   r   s   "&r
   <lambda>5PositionalOnlyTestCase.test_lambdas.<locals>.<lambda>       AEr   r4   c                    W,           # r   r   r   s   "&r
   r   r          aer   c                    W,           # r   r   r   s   ""r
   r   r      r   r   c                    W,           # r   r   r   s   ""r
   r   r      r   r   Nr   rh   )r   xs   & r
   test_lambdas#PositionalOnlyTestCase.test_lambdas   s    !1Q#1q1%#1q!!1a!$#1a!$r   c                   \        V R R4       \        V RR4       \        V RR4       \        V RR4       \        V RR4       \        V R4       \        V R4       \        V R4       \        V R	4       \        V R
4       \        V R4       \        V R4       \        V R4       \        V RR4       \        V RR4       \        V R4       \        V R4       \        V R4       \        V R4       R# )zlambda a, b = 5, /, c: Noner!   zlambda a = 5, b, /, c: Nonez%lambda a = 5, b=1, /, c, *, d=2: Nonezlambda a = 5, b, /: Nonezlambda a, /, b = 5, c: Nonezlambda *args, /: Nonezlambda *args, a, /: Nonezlambda **kwargs, /: Nonezlambda /, a = 1: Nonezlambda /, a: Nonezlambda /: Nonezlambda *, a, /: Nonezlambda *, /, a: Nonezlambda a, /, a: Noner"   zlambda a, /, *, a: Nonezlambda a, /, b, /: Nonezlambda a, /, b, /, c: Nonez lambda a, /, b, /, c, *, d: Nonezlambda a, *, b, /, c: NoneNr   r#   s   &r
   test_invalid_syntax_lambda1PositionalOnlyTestCase.test_invalid_syntax_lambda   s    4!>@~4!>@~4!H  KI  	J4!;={|4!>@~4!894!;<4!;<4!894!454!124!784!784!79hi4!:<kl4!:;4!=>4!CD4!=>r   c                    ! R  R4      pV P                  V! 4       P                  ^^4      R4       V P                  VP                  V! 4       ^^4      R4       V P                  \        VP                  ^^4       RpV P	                  \        V4      ;_uu_ 4        V! 4       P                  ^^R7       RRR4       R#   + '       g   i     R# ; i)c                   &   a  ] tR tRt o R tRtV tR# )<PositionalOnlyTestCase.test_posonly_methods.<locals>.Examplei  c                   W3# r   r   )r   r   r	   s   """r
   r.   >PositionalOnlyTestCase.test_posonly_methods.<locals>.Example.f  s	    tr   r   N)__name__
__module____qualname____firstlineno__r.   __static_attributes____classdictcell____classdict__s   @r
   Exampler     s      r   r   r2   r4   Nr7   r]   )r9   r.   r   r:   r   )r   r   rs   s   &  r
   test_posonly_methods+PositionalOnlyTestCase.test_posonly_methods  s    	 	 	Q*F379a3V<)WYY15_##Ix88IKKQK 9888s   B??C	c                    V P                  \        R 4      ;_uu_ 4        \        4        RRR4       R#   + '       g   i     R# ; i)r   N)r   r:   r   r#   s   &r
   test_module_function+PositionalOnlyTestCase.test_module_function  s,    ##I/lmm nmmms	   4A	c                *   R  pV P                  V! ^^4      ! ^^4      ^
4       V P                  \        R4      ;_uu_ 4        V! ^^4      ! ^4       RRR4       V P                  \        R4      ;_uu_ 4        V! ^^4      ! ^^^4       RRR4       R pV P                  V! ^^4      ! ^^4      ^
4       R pV P                  V! ^^4      ! ^^4      ^
4       V P                  \        R4      ;_uu_ 4        V! ^^4      ! ^4       RRR4       V P                  \        R4      ;_uu_ 4        V! ^^4      ! ^^^4       RRR4       R#   + '       g   i     L; i  + '       g   i     L; i  + '       g   i     Lp; i  + '       g   i     R# ; i)c                    a a V V3R  lpV# )c                2   < SS,           V ,           V,           # r   r   x2y2r   ys   "&r
   rT   :PositionalOnlyTestCase.test_closures.<locals>.f.<locals>.g      1urzB&r   r   r   r   rT   s   ff r
   r.   /PositionalOnlyTestCase.test_closures.<locals>.f      'Hr   z2g\(\) missing 1 required positional argument: 'y2'Nz3g\(\) takes 2 positional arguments but 3 were givenc                   a a V V3R  lpV# )c                 2   < SS,           V ,           V,           # r   r   r   s   &&r
   rT   r     r   r   r   r   s   bf r
   r.   r     r   r   c                   a a V V3R  lpV# )c                2   < SS,           V ,           V,           # r   r   r   s   "&r
   rT   r   &  r   r   r   r   s   bf r
   r.   r   %  r   r   r8   r;   s   & r
   test_closures$PositionalOnlyTestCase.test_closures  s7   	
 	1Q!b)##I/deeaF1I f##I/effaF1QqM g	
 	1Q!b)	
 	1Q!b)##I/deeaF1I f##I/effaF1QqM gf) feff  fefffs0   E8E6E.,FE	E+	.E>	F	c                &    R  p ! R R4      pR pR# )c                      R  R lp V # )c                $    V ^8  d   QhR\         /# r]   r   int)formats   "r
   __annotate__ePositionalOnlyTestCase.test_annotations_in_closures.<locals>.inner_has_pos_only.<locals>.__annotate__3  s    !!S!r   c                    R # r   r   r   s   "r
   r.   ZPositionalOnlyTestCase.test_annotations_in_closures.<locals>.inner_has_pos_only.<locals>.f3  s    cr   r   r.   s    r
   inner_has_pos_onlyOPositionalOnlyTestCase.test_annotations_in_closures.<locals>.inner_has_pos_only2  s
    !Hr   c                   &   a  ] tR tRt o R tRtV tR# )FPositionalOnlyTestCase.test_annotations_in_closures.<locals>.Somethingi8  c                    R  R lpV# )c                $    V ^8  d   QhR\         /# r   r   )r   s   "r
   r   cPositionalOnlyTestCase.test_annotations_in_closures.<locals>.Something.method.<locals>.__annotate__:      %%%r   c                    R # r   r   r   s   "r
   r.   XPositionalOnlyTestCase.test_annotations_in_closures.<locals>.Something.method.<locals>.f:      #r   r   r;   s   & r
   methodMPositionalOnlyTestCase.test_annotations_in_closures.<locals>.Something.method9  
    %r   r   Nr   r   r   r   r   r   r   r   s   @r
   	Somethingr   8  s      r   r   c                      R  p V ! 4       # )c                      R  R lp V # )c                $    V ^8  d   QhR\         /# r   r   )r   s   "r
   r   ~PositionalOnlyTestCase.test_annotations_in_closures.<locals>.multiple_levels.<locals>.inner_has_pos_only.<locals>.__annotate__A  r   r   c                    R # r   r   r   s   "r
   r.   sPositionalOnlyTestCase.test_annotations_in_closures.<locals>.multiple_levels.<locals>.inner_has_pos_only.<locals>.fA  r   r   r   r   s    r
   r   hPositionalOnlyTestCase.test_annotations_in_closures.<locals>.multiple_levels.<locals>.inner_has_pos_only@  r   r   r   )r   s    r
   multiple_levelsLPositionalOnlyTestCase.test_annotations_in_closures.<locals>.multiple_levels?  s     &''r   Nr   )r   r   r   r   s   &   r
   test_annotations_in_closures3PositionalOnlyTestCase.test_annotations_in_closures0  s    		 		(r   c                   R  pV P                  V! ^*^*R7      ^*R^*/34       V P                  \        R4      ;_uu_ 4        V! ^*R7       RRR4       V P                  V! ^*4      ^*/ 34       R#   + '       g   i     L,; i)c                    W3# r   r   )	somethingkwargss   ",r
   r.   MPositionalOnlyTestCase.test_same_keyword_as_positional_with_kwargs.<locals>.fH  s    &&r   )r   r   z9f\(\) missing 1 required positional argument: 'something'Nr8   r;   s   & r
   +test_same_keyword_as_positional_with_kwargsBPositionalOnlyTestCase.test_same_keyword_as_positional_with_kwargsG  so    	' 	2,rK3D.EF##I/kllO m 	2R) mls    
A..A>	c                     ! R  R4      pV P                  V! 4       P                  4       ^*4       V P                  V! 4       P                  4       R4       V P                  V! 4       P                  4       R4       R# )c                   F   a  ] tR tRt o RR ltR	R ltR	R^,/R lltRtV tR# )
/PositionalOnlyTestCase.test_mangling.<locals>.XiS  c                   V# r   r   )r   _X__as   ""r
   r.   1PositionalOnlyTestCase.test_mangling.<locals>.X.fT  s    
r   c                   W3# r   r   )r   r  _X__bs   ""&r
   f22PositionalOnlyTestCase.test_mangling.<locals>.X.f2W  s
    z!r   _X__cc              
    WV3# r   r   )r   r  r
  r  s   ""&$r
   f32PositionalOnlyTestCase.test_mangling.<locals>.X.f3Z  s    #&r   r   N)*   r  +   )	r   r   r   r   r.   r  r  r   r   r   s   @r
   Xr  S  s      "'2 ' 'r   r  Nr  )r  r  ,   )r9   r.   r  r  )r   r  s   & r
   test_mangling$PositionalOnlyTestCase.test_manglingR  sV    	' 	' 	"%8,<0r   c                p    R RP                  R \        R4       4       4      ,          p\        VRR4       R# )r?   r@   c              3   4   "   T F  pR V,          x  K  	  R# 5irB   r   rC   s   & r
   rF   APositionalOnlyTestCase.test_too_many_arguments.<locals>.<genexpr>c  rH   rI   rJ   r   r   NrK   rN   s   & r
   test_too_many_arguments.PositionalOnlyTestCase.test_too_many_argumentsa  rR   r   c                ^   \         P                  ! \        4      p\         P                  ! \        4      p\         P                  ! \        4      p\         P
                  ! V4      p\         P
                  ! V4      p\         P
                  ! V4      pV P                  V! ^^4      R4       RpV P                  \        V4      ;_uu_ 4        V! ^^R7       RRR4       V P                  V! ^^4      R4       RpV P                  \        V4      ;_uu_ 4        V! ^^R7       RRR4       V P                  V! 4       R4       RpV P                  \        V4      ;_uu_ 4        V! ^^R7       RRR4       R#   + '       g   i     L; i  + '       g   i     Lo; i  + '       g   i     R# ; i)r7   z\global_pos_only_f\(\) got some positional-only arguments passed as keyword arguments: 'a, b'r   Nzbglobal_pos_only_and_normal\(\) got some positional-only arguments passed as keyword arguments: 'a'z`global_pos_only_defaults\(\) got some positional-only arguments passed as keyword arguments: 'a'r   )	pickledumpsr   r   r   loadsr9   r   r:   )r   pickled_posonlypickled_optionalpickled_defaultsunpickled_posonlyunpickled_optionalunpickled_defaultsrs   s   &       r
   test_serialization)PositionalOnlyTestCase.test_serializationf  sD    ,,'89!<<(BC!<<(@A"LL9#\\*:;#\\*:;*1Q/7:##Ix88A& 9 	+Aa0%87##Ix88Q' 9 	+-u57##Ix88Q' 98 98 98 988s$   
E5F F5F	F	F,	c                   a a RR loS P                  \        R4      ;_uu_ 4        S! ^^R7       RRR4       VV 3R lpV! ^^4       V! ^^R7       V! ^4       V! 4        R#   + '       g   i     L;; i)r7   c                   "   W3# 5ir   r   r   s   "&r
   r.   ,PositionalOnlyTestCase.test_async.<locals>.f  s     4Ks   ro   r   Nc                     <  S! V / VB pVP                  R 4       SP                  XR4       R #   \         d   pTP                  p R p?L0R p?ii ; i)Nr   )sendStopIterationvaluer9   )argsr   cororX   resultr.   r   s   *,   r
   _check_call6PositionalOnlyTestCase.test_async.<locals>._check_call  sO    !$)&)		$ VV, ! !!s   0 AAAr4   r   rr   )r   r3  r.   s   f @r
   
test_async!PositionalOnlyTestCase.test_async  s^    	 ##I/{||QK }	- 	AqAA }|s   A$$A4	c                   RR lpV P                  \        R4      ;_uu_ 4        V! ^^R7       RRR4       V! ^^4      pV P                  \        V4      R4       V! ^^R7      pV P                  \        V4      R4       V! ^4      pV P                  \        V4      R4       V! 4       pV P                  \        V4      R4       R#   + '       g   i     L; i)r7   c             3      "   W3x  R # 5ir   r   r   s   "&r
   r.   0PositionalOnlyTestCase.test_generator.<locals>.f  s     $Js   
ro   r   Nr4   r   )r   r:   r9   next)r   r.   gens   &  r
   test_generator%PositionalOnlyTestCase.test_generator  s    	 ##I/{||QK } 1gcF+QicF+dcF+ccF+ }|s   CC	c                   a \        4       o ! V3R  lR4      p ! R RV4      pV P                  V! 4       P                  4       S4       R# )c                   .   <a  ] tR tRt o V3R ltRtV tR# ),PositionalOnlyTestCase.test_super.<locals>.Ai  c                   < S# r   r   )r   sentinels   &r
   r   3PositionalOnlyTestCase.test_super.<locals>.A.method  s    r   r   Nr   )r   rB  s   @r
   Ar@    s        r   rD  c                   2   a a ] tR tRt oV 3R ltRtVtV ;t# ),PositionalOnlyTestCase.test_super.<locals>.Ci  c                   < \         SV `  4       # r   )superr   )r   	__class__s   "r
   r   3PositionalOnlyTestCase.test_super.<locals>.C.method  s    w~''r   r   )r   r   r   r   r   r   r   __classcell__)rI  r   s   @@r
   CrF    s     ( (r   rL  N)objectr9   r   )r   rD  rL  rB  s   &  @r
   
test_super!PositionalOnlyTestCase.test_super  s:    8	  	 	( 	( 	x0r   c                   R  p\        R VP                  P                   4       4      p\        P                  ! V4       Uu. uF  q3P
                  VP                  3NK  	  ppV P                  RV4       V P                  RV4       R# u upi )c                      R  R lp R# )c                0    V ^8  d   QhR\         \         J/# r   r   )r   s   "r
   r   VPositionalOnlyTestCase.test_annotations_constant_fold.<locals>.g.<locals>.__annotate__  s    ..#%.r   c                    R # r   r   r   s   "r
   r.   KPositionalOnlyTestCase.test_annotations_constant_fold.<locals>.g.<locals>.f  s    3r   Nr   r   s    r
   rT   @PositionalOnlyTestCase.test_annotations_constant_fold.<locals>.g  s    .r   c              3      "   T F<  p\        V\        P                  4      '       g   K%  VP                  R 8X  g   K8  Vx  K>  	  R# 5i)r   N)
isinstancetypesCodeTypeco_name)rD   consts   & r
   rF   HPositionalOnlyTestCase.test_annotations_constant_fold.<locals>.<genexpr>  s:      b+?%%eU^^< AFR`A` +?s   "AA
AN)	UNARY_NOTN)IS_OPr7   )	r:  r_   	co_constsdisget_instructionsopnameargvalassertNotInassertIn)r   rT   code_objrE   codess   &    r
   test_annotations_constant_fold5PositionalOnlyTestCase.test_annotations_constant_fold  s}    	/  b1::+?+? b b/2/C/CH/MN/M!((AHH%/MN,e4lE* Os    B
r   N)zinvalid syntax)#r   r   r   r   r   r$   r'   r<   rP   rc   ri   rt   r{   r   r   r   r   r   r   r   r   r   r   r   r   r  r  r  r'  r5  r<  rN  ri  r   r   r   s   @r
   r   r      s     8B,H,(6,
4(&
	'(	(%?*
  
<?.	*1,
(6*,"1+ +r   r   __main__r   )__doc__ra  r  rY  unittesttest.supportr   r   r   r   TestCaser   r   mainr   r   r
   <module>rq     sS    N 
    +l+X.. l+^ zMMO r   