+
    Bi3                        ^ RI t ^ RIt^ RIHt ^ RIHt ^ RIHtHt  ^ RIt ^ RI
t
RRRRRRRRRR]! ] P                  4      ] P                  3R]3R R]3R]3R]3R	]3R
]3.t ! R R]4      t ! R R]P"                  4      t ! R R]P"                  4      t ! R R]4      t ! R R]P"                  4      t]R8X  d   ]P.                  ! 4        R# R#   ]	 d    Rt Li ; i  ]	 d    Rt
 Li ; i)!    N)mock)support)VALID_UNDERSCORE_LITERALSINVALID_UNDERSCORE_LITERALSz  1xz  1      		  u   Ȁc                       ] tR t^*tRtR# )IntSubclass N__name__
__module____qualname____firstlineno____static_attributes__r       $/usr/lib/python3.14/test/test_int.pyr   r   *   s    r   r   c                      a  ] tR t^-t o R tR tR tR t]P                  R 4       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]P                  R 4       tRtV tR# )IntTestCasesc                   V P                  \        R 4      R 4       V P                  \        R4      ^4       V P                  \        Rq4      Rr4       V P                  \        R4      ^4       V P                  \        Rs4      Rr4       V P                  \        R4      ^4       V P                  \        Rt4      Rr4       V P                  \        R4      Rr4       V P                  \        R4      Rr4       V P                  \        R4      Rr4       V P                  \        R^4      ^4       \         FX  w  rRu FM  pRv FD  pWC,           V,           pTpVR8X  d   V\        Jd   V) p V P                  \        V4      V4       KF  	  KO  	  KZ  	  \	        Rw\
        P                  ,
          4      p\        V4      pV P                  V^,           \
        P                  ) 4       V P                  V\        4       V P                  \        VR	,          4      \
        P                  ^,           4       \        R
4      pV P                  V\        4       \        Rx4      pV P                  V\        4       Rw\
        P                  ,
          pV P                  V^,	          V^,          4       \        Ry4      pV P                  V\        4       V P                  \        \        ^^4       V P                  \        \        R^^4       V P                  \        R^ 4      ^S4       V P                  \        R^4      R4       V P                  \        \        R^4       V P                  \        \        R^ 4       V P                  \        \        R^4       V P                  \        \        R^ 4       V P                  \        \        R^4       V P                  \        \        R^ 4       V P                  \        R^4      R4       V P                  \        R^4      R4       V P                  \        R^4      R4       V P                  \        R^4      R4       V P                  \        R^4      R4       V P                  \        R^4      R4       V P                  \        R^4      R4       V P                  \        R^	4      R4       V P                  \        R^
4      R4       V P                  \        R^4      R4       V P                  \        R^4      R4       V P                  \        R^4      R4       V P                  \        R^4      R4       V P                  \        R^4      R4       V P                  \        R ^4      R4       V P                  \        R!^4      R4       V P                  \        R"^4      R4       V P                  \        R#^4      R4       V P                  \        R$^4      R4       V P                  \        R%^4      R4       V P                  \        R&^4      R4       V P                  \        R'^4      R4       V P                  \        R(^4      R4       V P                  \        R)^4      R4       V P                  \        R*^4      R4       V P                  \        R+^4      R4       V P                  \        R,^4      R4       V P                  \        R-^4      R4       V P                  \        R.^4      R4       V P                  \        R/^4      R4       V P                  \        R0^ 4      R4       V P                  \        R1^!4      R4       V P                  \        R2^"4      R4       V P                  \        R3^#4      R4       V P                  \        R4^$4      R4       V P                  \        R5^ 4      ^S4       V P                  \        R5^ 4      ^S4       V P                  \        R6^ 4      ^ 4       V P                  \        R^ 4      ^S4       V P                  \        R^ 4      R4       V P                  \        R7^ 4      ^4       V P                  \        R8^ 4      ^S4       V P                  \        R9^ 4      R4       V P                  \        R:^ 4      ^4       V P                  \        4      ;_uu_ 4        \        R;^ 4       R<R<R<4       V P                  \        R=4      ^{4       V P                  \        R=^
4      ^{4       V P                  \        R^4      R4       V P                  \        R^4      ^S4       V P                  \        R7^4      ^4       V P                  \        R>^4      R4       V P                  \        R?^4      ^S4       V P                  \        R@^4      ^4       V P                  \        \        RA^4       V P                  \        \        RB^4       V P                  \        \        RC^4       V P                  \        \        RD^4       V P                  \        \        RE^4       V P                  \        \        RF^4       V P                  \        \        RG^4       V P                  \        \        RH^4       V P                  \        \        RI^4       V P                  \        \        RJ^4       V P                  \        \        RK^4       V P                  \        \        RL^4       V P                  \        RM^4      RN4       V P                  \        RO^4      RN4       V P                  \        RP^4      RN4       V P                  \        RQ^4      RN4       V P                  \        RR^4      RN4       V P                  \        RS^4      RN4       V P                  \        RT^4      RN4       V P                  \        RU^	4      RN4       V P                  \        RV^
4      RN4       V P                  \        RW^4      RN4       V P                  \        RX^4      RN4       V P                  \        RY^4      RN4       V P                  \        RZ^4      RN4       V P                  \        R[^4      RN4       V P                  \        R\^4      RN4       V P                  \        R]^4      RN4       V P                  \        R^^4      RN4       V P                  \        R_^4      RN4       V P                  \        R`^4      RN4       V P                  \        Ra^4      RN4       V P                  \        Rb^4      RN4       V P                  \        Rc^4      RN4       V P                  \        Rd^4      RN4       V P                  \        Re^4      RN4       V P                  \        Rf^4      RN4       V P                  \        Rg^4      RN4       V P                  \        Rh^4      RN4       V P                  \        Ri^4      RN4       V P                  \        Rj^4      RN4       V P                  \        Rk^4      RN4       V P                  \        Rl^ 4      RN4       V P                  \        Rm^!4      RN4       V P                  \        Rn^"4      RN4       V P                  \        Ro^#4      RN4       V P                  \        Rp^$4      RN4       R<#   \         d     EK  i ; i  + '       g   i     EL); i)z:  gQ	@g333333@g      @z-3z -3 u    -3 10-:   NNg}Ô%IT0o1230x123i#  0x0o0b!100000000000000000000000000000000l        102002022201221111211100000000000000003224400242314115501040155042113014223544000000000012068657454
4294967296
1904440554	9ba461594	535a79889	2ca5b7464	1a20dcd81	100000000a7ffda91704he7g44f5aff663723ai4g281d55i41fj8b1841606k7icmb994aghek2mgldnchbnmb28jpdm8pfgih476beigg5qmcpqg4q0jto440000003aokq942qhxjli2br45qb1z141z4z 0o123  0000b100z	 0O123   z 0X123  z 0B100 010N01230X1230O1230B1000b20b020B20B020o80o080O80O080xg0x0g0Xg0X0g!100000000000000000000000000000001l       102002022201221111212100000000000000013224400242314215501040155052113014223554000000000112068657455
4294967297
1904440555	9ba461595	535a7988a	2ca5b7465	1a20dcd82	100000001a7ffda92704he7g54f5aff673723ai4h281d55i51fj8b1851606k7idmb994ahhek2mgmdnchbnnb28jpdn8pfgih576beigh5qmcpqh4q0jto540000013aokq952qhxjlj2br45qc1z141z5gQ	g333333g      )r   +r   )r   r   	r	   g}Ô%IX  111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111)
assertEqualintL
ValueErrorreprsysmaxsizeassertIsInstanceassertRaises	TypeError)selfsvsignprefixssvvxs   &       r   
test_basicIntTestCases.test_basic/   s   S3'TA&UR(S1%TB'S1%TB'TB'Vb)9:B?T"r*DA$7F*BBs{q
':R((R"5 8 %  CKK F1s{{l+a%QrUS[[]3 Ja%Ka% s{{NaA&	Na% 	)S!R0)S$15Wa"-Wb)3/ 	*c44*c43*c43*c43*c43*c43 	@!DjQ4a8*E0!4jA-q1:>_a0*=^Q/<]A.
;]A.
;\2.
;\2.
;["-z:["-z:["-z:["-z:["-z:Z,j9Z,j9Z,j9Z,j9Z,j9Z,j9Z,j9Y+Z8Y+Z8Y+Z8Y+Z8Y+Z8Y+Z8Y+Z8Y+Z8Y+Z8Y+Z8Y+Z8Y+Z8Y+Z8 	Z+R0Z+R0UA*Wa"-Wa#.Wa!,[!,b1Z+S1Y*A.z**qM + 	Vc*VR#. 	Wb)3/Wa"-Wa!,Wb)3/Wa"-Wa!, 	*c5!4*c615*c5!4*c615*c5!4*c615*c5!4*c615*c5"5*c626*c5"5*c626 	@!DjQ4a8*E0!4jA-q1:>_a0*=^Q/<]A.
;]A.
;\2.
;\2.
;["-z:["-z:["-z:["-z:["-z:Z,j9Z,j9Z,j9Z,j9Z,j9Z,j9Z,j9Y+Z8Y+Z8Y+Z8Y+Z8Y+Z8Y+Z8Y+Z8Y+Z8Y+Z8Y+Z8Y+Z8Y+Z8Y+Z8A & | +**s   &{'{:'{7	6{7	:|	c                   V P                  \        4      ;_uu_ 4        \        R 4       RRR4       V P                  \        4      ;_uu_ 4        \        R4       RRR4       V P                  \        4      ;_uu_ 4        \        R4       RRR4       V P                  \        4      ;_uu_ 4        \        R4       RRR4       V P                  \        4      ;_uu_ 4        \        R4       RRR4       R#   + '       g   i     L; i  + '       g   i     L; i  + '       g   i     L; i  + '       g   i     L|; i  + '       g   i     R# ; i)r{   Nr   z- 1z+ 1z + 1 r   r   r   r   s   &r   test_invalid_signsIntTestCases.test_invalid_signs   s    z**H +z**H +z**J +z**J +z**L +* +**********s;   C8D D1D1"E8D	D	D.	1E	E	c                    V P                  \        R 4      R4       V P                  \        R4      R4       V P                  \        R ^ 4      R4       V P                  \        R^ 4      R4       R# )u(   १२३४५६७८९०1234567890l   
>V3&Z
 u   ١٢٣٤٥٦٧٨٩٠INr   r   r   s   &r   test_unicodeIntTestCases.test_unicode   s`    GHJ^_34jAGKMab3Q7Dr   c           
       a \          F  o\        ;QJ d    V3R  lR 4       F  '       g   K   RM	  RM! V3R  lR 4       4      '       d   KE  V P                  \        S^ 4      \	        S4      4       V P                  \        S^ 4      \        SP                  RR4      ^ 4      4       K  	  \         Fa  o\        ;QJ d    V3R lR 4       F  '       g   K   RM	  RM! V3R lR 4       4      '       d   KE  V P                  \        \        S^ 4       Kc  	  V P                  \        R^4      ^	4       V P                  \        R4      ^d4       V P                  \        R	4      ^d4       V P                  \        \        R
4       V P                  \        \        R4       V P                  \        \        R4       V P                  \        \        R4       R# )c              3   ,   <"   T F	  qS9   x  K  	  R # 5iNr   .0chlits   & r   	<genexpr>0IntTestCases.test_underscores.<locals>.<genexpr>        /w9w   z.eEjJTF_r   c              3   ,   <"   T F	  qS9   x  K  	  R # 5ir   r   r   s   & r   r   r     r   r   1_000_100s   1_00_100z+_1001__00100_N)	r   anyr   r   evalreplacer   r   r   )r   r   s   &@r   test_underscoresIntTestCases.test_underscores   s?   ,Cs/w/sss/w///Sa[$s)4Sa[#ckk#r.BA*FG	 -
 /Cs/w/sss/w///j#sA6 /
 	VQ+Ws+Ws+*c62*c73*c73*c62r   c                    V P                  \        R 4      ^
4       V P                  \        R4      R4       V P                  \        R4      ^
4       V P                  \        R4      R4       R# )r   z-1s   10s   -1Nr}   )assertIsr   r   s   &r   test_small_intsIntTestCases.test_small_ints  sL     	c$i$c$i$c%j"%c%j"%r   c                :    V P                  \        4       ^ 4       R# r   Nr   r   s   &r   test_no_argsIntTestCases.test_no_args  s    "r   c                   V P                  \        R ^R7      ^4       V P                  \        R4      ;_uu_ 4        \        RR7       RRR4       V P                  \        R4      ;_uu_ 4        \        R ^R7       RRR4       V P	                  \        \        ^
R7       V P	                  \        \        ^ R7       R#   + '       g   i     L~; i  + '       g   i     L]; i)100basezkeyword argumentg333333?)r   N)r   r   )r   r   assertRaisesRegexr   r   r   s   &r   test_keyword_argsIntTestCases.test_keyword_args  s    U+Q/##I/ABB#J C##I/ABB%a  C)Sr2)Sq1 CBBBs   B?/C?C	C"	c                   V P                  \        R ^4      ^ 4       V P                  \        4      ;_uu_ 4        \        R ^4       RRR4       V P                  \        4      ;_uu_ 4        \        R ^%4       RRR4       V P                  \        4      ;_uu_ 4        \        R R4       RRR4       V P                  \        4      ;_uu_ 4        \        R ^ ^^,          ,
          R7       RRR4       V P                  \        4      ;_uu_ 4        \        R ^^,          R7       RRR4       \	        ^^%4       F   pV P                  \        R VR7      ^ 4       K"  	  R#   + '       g   i     EL"; i  + '       g   i     EL; i  + '       g   i     L; i  + '       g   i     L; i  + '       g   i     L; i)0Nr   is)r   r   r   r   ranger   r   s   & r   test_int_base_limits!IntTestCases.test_int_base_limits#  s   S!a(z**QK +z**RL +z**TN +z**!QV*% +z**!S&! + !BKDS40!4   +***********s;   E ,E4FFF. E1	4F	F	F+	.F>	c                   V P                  \        4      ;_uu_ 4        \        R R4       RRR4       V P                  \        4      ;_uu_ 4        \        R R4       RRR4       R#   + '       g   i     LD; i  + '       g   i     R# ; i)r   g      @Ng      @)r   r   r   r   s   &r   test_int_base_bad_types$IntTestCases.test_int_base_bad_types4  sV    y))SM *y))SM *) *))))s   A'A:'A7	:B	c                    ! R  R\         4      p^^d,          ^^d,          ) ^^%3 F5  pV P                  \        4      ;_uu_ 4        \        RV4       RRR4       K7  	  V P	                  \        RV! ^4      R7      ^4       V P	                  \        RV! ^
4      R7      ^e4       V P	                  \        RV! ^$4      R7      R4       R#   + '       g   i     K  ; i)c                   ,   a  ] tR tRt o R tR tRtV tR# )9IntTestCases.test_int_base_indexable.<locals>.MyIndexablei<  c                    Wn         R # r   value)r   r   s   &&r   __init__BIntTestCases.test_int_base_indexable.<locals>.MyIndexable.__init__=  s    "
r   c                    V P                   # r   r   r   s   &r   	__index__CIntTestCases.test_int_base_indexable.<locals>.MyIndexable.__index__?  s    zz!r   r   N)r   r   r   r   r   r   r   __classdictcell____classdict__s   @r   MyIndexabler   <  s     #" "r   r   43N101r   i  )objectr   r   r   r   )r   r   r   s   &  r   test_int_base_indexable$IntTestCases.test_int_base_indexable;  s    	"& 	" sFQVGQ*D"":..D$ /. +
 	UQ8!<UR93?UR99E /..s   C		Cc           
     j  aa  ! R  R\         4      o ! R R\        4      p ! R R\        4      p\        \        V3R lVV\        .p ^ RIHo VP                  V3R l4       V F  pV! R	4      pV P                  \        V4      4      ;_uu_ 4        V P                  \        V4      ^d4       \        V\         \        \        34      '       d   V P                  \        V^4      ^4       M5R
pV P                  \        V4      ;_uu_ 4        \        V^4       RRR4       V P                  \        R4      ;_uu_ 4        \        V! R4      4       RRR4       RRR4       K  	  R#   \         d     ELi ; i  + '       g   i     Lh; i  + '       g   i     LC; i  + '       g   i     EKL  ; i)c                       ] tR tRtRtR# )<IntTestCases.test_non_numeric_input_types.<locals>.CustomStriO  r   Nr   r   r   r   	CustomStrr   O  s    dr   r   c                       ] tR tRtRtR# )>IntTestCases.test_non_numeric_input_types.<locals>.CustomBytesiP  r   Nr   r   r   r   CustomBytesr   P  s    $r   r   c                       ] tR tRtRtR# )BIntTestCases.test_non_numeric_input_types.<locals>.CustomByteArrayiQ  r   Nr   r   r   r   CustomByteArrayr   Q  s    $r   r   c                 0   < S! V P                  4       4      # r   )decode)br   s   &r   <lambda>;IntTestCases.test_non_numeric_input_types.<locals>.<lambda>V  s    i
+r   )arrayc                    < S! R V 4      # )Br   )r   r   s   &r   r   r   `  s    uS!}r   s   100zcan't convert non-stringNzinvalid literals   AAAAAAAAAAAAAAAA)strbytes	bytearray
memoryviewr   appendImportErrorsubTesttyper   r   
isinstancer   r   r   )	r   r   r   	factoriesfr   msgr   r   s	   &      @@r   test_non_numeric_input_types)IntTestCases.test_non_numeric_input_typesL  s;    	#"&%&.i. +
		6# 45A&	Ad1g&&  Q-a#ui!899$$SAY24C//	3??Aq	 @++J8IJJ+' K '&   		 @?JJ '&&sO   	E( A:F E:&F  FF (E76E7:F
F FF  F2c                   V P                  \        \        R 4      R,          4      ^4       V P                  \        \        R4      R,          4      ^4       V P                  \        \        R4      R,          4      ^4       V P                  \        \        R4      R,          4      ^4       V P                  \        \        R4      R,          4      ^4       R# )s   123:r      N   123 s   123 s   123As   1234N)r   r   r   r   s   &r   test_int_memoryview IntTestCases.test_int_memoryviewo  s    Z/45r:Z
3C892>Z056;Z056;Z056;r   c                <    V P                  \        \        R 4       R# )z1.2Nr   r   s   &r   test_string_floatIntTestCases.test_string_floatv  s    *c51r   c                >    ! R  R4      pV P                  \        \        V! 4       4        ! R R\        4      pV P                  \        \        V! 4       4        ! R R4      pV P	                  \        V! 4       4      ^*4        ! R R4      p\        V3 Fo  p ! R R	V4      pV P	                  \        V! 4       4      ^*4        ! R
 RV4      pV P                  \        4      ;_uu_ 4        \        V! 4       4       RRR4       Kq  	  R#   + '       g   i     K  ; i)c                       ] tR tRtRtR# )>IntTestCases.test_intconversion.<locals>.ClassicMissingMethodsi{  r   Nr   r   r   r   ClassicMissingMethodsr
  {      r   r  c                       ] tR tRtRtR# )7IntTestCases.test_intconversion.<locals>.MissingMethodsi  r   Nr   r   r   r   MissingMethodsr    r  r   r  c                   &   a  ] tR tRt o R tRtV tR# )-IntTestCases.test_intconversion.<locals>.Foo0i  c                    ^*# *   r   r   s   &r   __int__5IntTestCases.test_intconversion.<locals>.Foo0.__int__      r   r   Nr   r   r   r   r  r   r   r   s   @r   Foo0r          r   r  c                       ] tR tRtRtR# )0IntTestCases.test_intconversion.<locals>.Classici  r   Nr   r   r   r   Classicr    r  r   r  c                   ,   a  ] tR tRt o R tR tRtV tR# ):IntTestCases.test_intconversion.<locals>.IntOverridesTrunci  c                    ^*# r  r   r   s   &r   r  BIntTestCases.test_intconversion.<locals>.IntOverridesTrunc.__int__      r   c                    R# )   ir   r   s   &r   	__trunc__DIntTestCases.test_intconversion.<locals>.IntOverridesTrunc.__trunc__  s    Jr   r   N)r   r   r   r   r  r%  r   r   r   s   @r   IntOverridesTruncr    s      r   r'  c                   &   a  ] tR tRt o R tRtV tR# )2IntTestCases.test_intconversion.<locals>.JustTrunci  c                    ^*# r  r   r   s   &r   r%  <IntTestCases.test_intconversion.<locals>.JustTrunc.__trunc__  r"  r   r   N)r   r   r   r   r%  r   r   r   s   @r   	JustTruncr)    s      r   r,  N)r   r   r   r   r   )r   r  r  r  r  r   r'  r,  s   &       r   test_intconversionIntTestCases.test_intconversiony  s    	 	)S*?*AB	V 	)S.*:;	 	 	TVb)	 	W%DD 
 S!2!45r:D  ""9--IK  .- & .--s   ,DDc                     ! R  R\         4      p ! R R\         4      pV! ^4      pV P                  V^4       V P                  \        V4      ^4       V P                  \        V! 4       4      ^ 4       R# )c                   &   a  ] tR tRt o R tRtV tR# ):IntTestCases.test_int_subclass_with_index.<locals>.MyIndexi  c                    ^*# r  r   r   s   &r   r   DIntTestCases.test_int_subclass_with_index.<locals>.MyIndex.__index__  r  r   r   Nr   r   r   r   r   r   r   r   s   @r   MyIndexr1    r  r   r5  c                   &   a  ] tR tRt o R tRtV tR# );IntTestCases.test_int_subclass_with_index.<locals>.BadIndexi  c                    R # g      E@r   r   s   &r   r   EIntTestCases.test_int_subclass_with_index.<locals>.BadIndex.__index__      r   r   Nr4  r   s   @r   BadIndexr7          r   r<  N)r   r   )r   r5  r<  my_ints   &   r   test_int_subclass_with_index)IntTestCases.test_int_subclass_with_index  s_    	c 		s 	 #Va(XZ!,r   c                    ! R  R\         4      p ! R R\         4      pV! ^4      pV P                  V^4       V P                  \        V4      ^*4       V! ^4      pV P                  V^4       V P                  \        \         V4       R# )c                   &   a  ] tR tRt o R tRtV tR# )6IntTestCases.test_int_subclass_with_int.<locals>.MyInti  c                    ^*# r  r   r   s   &r   r  >IntTestCases.test_int_subclass_with_int.<locals>.MyInt.__int__  r  r   r   Nr  r   s   @r   MyIntrC    r  r   rF  c                   &   a  ] tR tRt o R tRtV tR# )7IntTestCases.test_int_subclass_with_int.<locals>.BadInti  c                    R # r9  r   r   s   &r   r  ?IntTestCases.test_int_subclass_with_int.<locals>.BadInt.__int__  r;  r   r   Nr  r   s   @r   BadIntrH    r=  r   rK  N)r   r   r   r   )r   rF  rK  r>  s   &   r   test_int_subclass_with_int'IntTestCases.test_int_subclass_with_int  st    	C 		S 	 q#Vb)#)S&1r   c                    ! R  R4      p ! R R\         4      p ! R R4      p ! R R\         4      pV! 4       pV P                  \        4      ;_uu_ 4        \        V4      pRRR4       V P                  X^4       V P	                  \        V4      \         4       V! 4       p\        V4      pV P                  V^ 4       V P	                  \        V4      \         4       V! 4       pV P                  \        4      ;_uu_ 4        \        V4      pRRR4       V P                  V^4       V P	                  \        V4      \         4       V! 4       pV P                  \        4      ;_uu_ 4        \        V4      pRRR4       V P                  V^4       V P	                  \        V4      \         4       R#   + '       g   i     ELY; i  + '       g   i     L; i  + '       g   i     Lj; i)	c                   &   a  ] tR tRt o R tRtV tR# )<IntTestCases.test_int_returns_int_subclass.<locals>.BadIndexi  c                    R # Tr   r   s   &r   r   FIntTestCases.test_int_returns_int_subclass.<locals>.BadIndex.__index__  r;  r   r   Nr4  r   s   @r   r<  rP    r=  r   r<  c                   &   a  ] tR tRt o R tRtV tR# )=IntTestCases.test_int_returns_int_subclass.<locals>.BadIndex2i  c                    R # rR  r   r   s   &r   r   GIntTestCases.test_int_returns_int_subclass.<locals>.BadIndex2.__index__  r;  r   r   Nr4  r   s   @r   	BadIndex2rU    r=  r   rX  c                   &   a  ] tR tRt o R tRtV tR# ):IntTestCases.test_int_returns_int_subclass.<locals>.BadInti  c                    R # rR  r   r   s   &r   r  BIntTestCases.test_int_returns_int_subclass.<locals>.BadInt.__int__  r;  r   r   Nr  r   s   @r   rK  rZ    r=  r   rK  c                   &   a  ] tR tRt o R tRtV tR# );IntTestCases.test_int_returns_int_subclass.<locals>.BadInt2i  c                    R # rR  r   r   s   &r   r  CIntTestCases.test_int_returns_int_subclass.<locals>.BadInt2.__int__  r;  r   r   Nr  r   s   @r   BadInt2r^    r=  r   ra  N)r   assertWarnsDeprecationWarningr   r   r   )r   r<  rX  rK  ra  bad_intns   &      r   test_int_returns_int_subclass*IntTestCases.test_int_returns_int_subclass  s[   	 		 		 		c 	 *011GA 2Ad1gs#+LAd1gs#(011GA 2Ad1gs#)011GA 2Ad1gs#) 211 21 21s$   F3G,G3G	G	G*	c                  a  RV 3R llp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^4       V! R4       V! R^
4       V! R	4       V! R	^
4       V! R
4       V! R
^
4       R # )Nc                 >  < SP                  \        R V : RV: R2R7      ;_uu_ 4       pVf   \        V 4       M\        W4       RRR4       SP                  XP                  P
                  ^ ,          RVf   ^
MTV 3,          4       R#   + '       g   i     LN; i)zint(z, ))r   Nz*invalid literal for int() with base %d: %r)r   r   r   r   	exceptionargs)r   r   cmr   s   && r   check.IntTestCases.test_error_message.<locals>.check  s    "":894'@ # B BEG<FLB R\\..q1<|q123B Bs   BB	   ½u   123½z  123 456  z123 z123  245z123 245r  s   123u   123r   r   )r   rn  s   f r   test_error_messageIntTestCases.test_error_message  s    		3 	fimiimR mR lBlBjj"jj"kk2r   c                    V P                  \        R ^4      R4       V P                  \        R^4      R4       V P                  \        R^4      R4       V P                  \        R^ 4      R4       R# )	=1_0_1_0_1_0_1_0_1_0_1_0_1_0_1_0_1_0_1_0_1_0_1_0_1_0_1_0_1_0_1iUUUU1_2_3_4_5_6_7_0_1_2_3iSpS1_2_3_4_5_6_7_8_9l   gF 1_2_3_4_5_6_7i2DNr   r   s   &r   test_issue31619IntTestCases.test_issue31619  se    \^_`:	<4a8-H0"5{C_b1:>r   c                    ^P                  R4      \        ^4      \        ^R4      3 F4  pV P                  V^4       V P                  \	        V4      \
        4       K6  	  R# )r   N)	__round__roundr   r   r   r   )r   vals   & r   $test_round_with_none_arg_direct_call1IntTestCases.test_round_with_none_arg_direct_call	  sN    MM$'!H!TN$C S!$MM$s)S)	$r   r   N)r   r   r   r   r   r   r   r   r   cpython_onlyr   r   r   r   r   r   r   r  r  r-  r?  rL  rf  rq  rx  r~  r   r   r   s   @r   r   r   -   s     x9t
E3& & &#25"F"!(F<2!@-2"&$PB? * *r   r   c                      a a ] tR tRt o]tV 3R ltV 3R ltR tR t	RR lt
R tR tR	 tR
 tR tR tR tR tR tRtVtV ;t# )IntStrDigitLimitsTestsi  c                   < \         SV `  4        \        P                  ! 4       V n        \        P
                  ! R 4       R# )i   NsupersetUpr   get_int_max_str_digits_previous_limitset_int_max_str_digitsr   	__class__s   &r   r  IntStrDigitLimitsTests.setUp  s+    "99;""4(r   c                d   < \         P                  ! V P                  4       \        SV `  4        R # r   r   r  r  r  tearDownr  s   &r   r  IntStrDigitLimitsTests.tearDown  "    ""4#7#78r   c                   V P                  \        P                  ! 4       ^ 4       V P                  \        P                  ! 4       R4       \        P
                  ! ^ 4      ;_uu_ 4        V P                  \        P                  ! 4       ^ 4       V P                  RR,          4      p\        V4       RRR4       V P                  \        P                  ! 4       ^ 4       R#   + '       g   i     L7; i)r    N  1N)	assertGreaterr   r  
assertLessr   adjust_int_max_str_digitsr   	int_classr   )r   is   & r   test_disabled_limit*IntStrDigitLimitsTests.test_disabled_limit  s    3557;224f=..q11S7791=sV|,AF 2 	3557;	 21s   )A	C!!C1	c           	     z   V P                   p\        P                  ! 4       pV! R V,          4       V! RR V,          ,           4       V! R V,          R,           4       V! RR V,          ,           4       V! RR V,          ,           4       V P                  \	        \        ^
V^,
          ,          4      4      V4       R# r  r   r{   r   N)r  r   r  r   lenr   )r   r  	maxdigitss   &  r   test_max_str_digits_edge_cases5IntStrDigitLimitsTests.test_max_str_digits_edge_cases'  s    NN	..0	#	/"#i'(#	/C'(#i'(#i'(S	A!678)Dr   c                    V P                  \        4      ;_uu_ 4        Vf   V P                  V4       MV P                  W4       R R R 4       R #   + '       g   i     R # ; ir   )r   r   r  )r   r  r   s   &&&r   rn  IntStrDigitLimitsTests.check3  s?    z**|q!q'	 +***s   (AA!	c                x   \         P                  ! 4       pV P                  R V^,           ,          4       V P                  RR V^,           ,          ,           4       V P                  R V^,           ,          R,           4       V P                  RR V^,           ,          ,           4       V P                  RR V^,           ,          ,           4       V P                  R V^,           ,          4       ^
V,          pV P                  \        4      ;_uu_ 4        \        V4       RRR4       R#   + '       g   i     R# ; ir  )r   r  rn  r   r   r   )r   r  r  s   &  r   test_max_str_digits*IntStrDigitLimitsTests.test_max_str_digits:  s    ..0	

3)a-()

3	A../

3)a-(3./

3	A../

3	A../

3)a-())Oz**F +***s   D((D9	c                <   \         P                  ! 4       p\        R RR,           2^R7      pRp\        P                  ! V4      ;_uu_ 4        \        P
                  ! 4       ;_uu_ 4       p\        V4      pRRR4       RRR4       V P                  \        X4      V4       XP                  VP                  P                  ^,          8  d%   \        P                  ! RVP                   R24      h\        P                  ! \        RV,          4      4      ;_uu_ 4        V P                  \        4      ;_uu_ 4       p\        P
                  ! 4       ;_uu_ 4       p\        V4       RRR4       RRR4       RRR4       V P!                  R	\        XP"                  4      4       V P%                  XP                  VP                  ^,          4       \        R RR
,           2^R7      pV P                  \        4      ;_uu_ 4       p\        P
                  ! 4       ;_uu_ 4       p	\        V4       RRR4       RRR4       V P!                  R	\        VP"                  4      4       V P'                  X	P                  VP                  ^,          4       R#   + '       g   i     EL&; i  + '       g   i     EL2; i  + '       g   i     EL]; i  + '       g   i     ELi; i  + '       g   i     ELu; i  + '       g   i     L; i  + '       g   i     L; i)r   ci  r   i1 N"slow" conversion took only 	 seconds.gףp=
?
conversioni  )r   r  r   r   r  	Stopwatchr   r   r  seconds
clock_info
resolutionunittestSkipTestr   r   assertInrk  assertLessEqualr  )
r   r  huge_intdigits
sw_converthuge_decimalerrsw_fail_hugeextra_huge_intsw_fail_extra_huges
   &         r   +test_denial_of_service_prevented_int_to_strBIntStrDigitLimitsTests.test_denial_of_service_prevented_int_to_strH  s0   ..0	 CJ<(r211&99!!##zx=L $ : 	\*F3 
 5 5 @ @1 DD##$B'1'9'9&:)%E F F
 ..s4&=/ABB%%j11S%%''<H ( 2 C
 	lC$67\11:3E3Ea3GH r#g+/b9!!*--!!##'9 $ . 	lC$67*22J4F4Fq4HI; $## :99  ('' 211 CBB $# .-s   J(+J	7J( K$>K	J<(K	0K$L$K8	0LJ%	J((J9	<K	K	K!	K$$K5	8LLL	c                   \         P                  ! 4       pR pRV,          p\        P                  ! V4      ;_uu_ 4        \        P                  ! 4       ;_uu_ 4       p\        V4       RRR4       RRR4       XP                  VP                  P                  ^,          8  d%   \        P                  ! RVP                   R24      h\        P                  ! V^,
          4      ;_uu_ 4        V P                  \        4      ;_uu_ 4       p\        P                  ! 4       ;_uu_ 4       p\        V4       RRR4       RRR4       RRR4       V P                  R\        XP                  4      4       V P!                  XP                  VP                  ^,          4       RR,          pV P                  \        4      ;_uu_ 4       p\        P                  ! 4       ;_uu_ 4       p\        V4       RRR4       RRR4       V P                  R\        VP                  4      4       V P!                  XP                  VP                  ^,          4       R#   + '       g   i     EL; i  + '       g   i     EL ; i  + '       g   i     ELO; i  + '       g   i     EL[; i  + '       g   i     ELg; i  + '       g   i     L; i  + '       g   i     L; i)iD
 8Nr  r  r  7iO )r   r  r   r  r  r   r  r  r  r  r  r   r   r  r   rk  r  )	r   r  r  huger  r  r  
extra_huger  s	   &        r   +test_denial_of_service_prevented_str_to_intBIntStrDigitLimitsTests.test_denial_of_service_prevented_str_to_intp  s   ..0	 6z11&99!!##zI $ : 
 5 5 @ @1 DD##$B'1'9'9&:)%E F F ..vz::%%j11S%%''<D	 ( 2 ;
 	lC$67\11:3E3Ea3GH ]
!!*--!!##'9
O $ . 	lC$67/779K9KA9MN5 $## :99 ('' 211 ;:: $# .-s   I(I	)I(.J$J	*I<6J	>J$K$J8	0KI%	I((I9	<J	J	J!	J$$J5	8KKK	c                "   \         P                  ! 4       pR F_  pV P                  VR7      ;_uu_ 4        V P                  RV^,           ,          V4       V P                  RR,          V4       RRR4       Ka  	  R#   + '       g   i     Kv  ; i)   r   r  順 N)r               )r   r  r   r  )r   r  r   s   &  r   !test_power_of_two_bases_unlimited8IntStrDigitLimitsTests.test_power_of_two_bases_unlimited  sf    ..0	%D4((si!m4d;sW}d3 )( &(((s   :A==Bc                    \         P                  ! 4       pV^,          pRV,          pRV,          pV P                  V4       V P                  V4       V P                  V R24       V P                  V R24       R# )r  1111_11_111N)r   r  r  rn  )r   r  triplesr   s_s   &    r   test_underscores_ignored/IntStrDigitLimitsTests.test_underscores_ignored  sh    ..0	q.GOgqr

aS9

bT;r   c                    V P                   p\        P                  ! 4       pR V,          pV! V4      pV! RV 24      pV! RV 24      p\        V4       \        V4       R# )5r{   r   N)r  r   r  r   )r   r  
max_digitsr   r  pos_ineg_is   &      r   test_sign_not_counted,IntStrDigitLimitsTests.test_sign_not_counted  sZ    NN	//1
*aLAaS'"AaS'"E
E
r   c                   V P                   p\        P                  ! 4       pR V,          pV! WA4      pV^
8  d3   V P                  \        4      ;_uu_ 4        \        V4       RRR4       MV^
8  d   \        V4       V P                  \        4      ;_uu_ 4       pV! V R2V4       RRR4       R#   + '       g   i     LD; i  + '       g   i     R# ; i)2Nr  )r  r   r  r   r   r   )r   r   r  r  r   r  r  s   &&     r   _other_base_helper)IntStrDigitLimitsTests._other_base_helper  s    NN	//1
*a"9"":..A /.BYFz**c1gt$ +*	 /. +**s   B2C2C	C	c                ,   ^pV P                  VR7      ;_uu_ 4        V P                  V4       RRR4       ^$pV P                  VR7      ;_uu_ 4        V P                  V4       RRR4       R#   + '       g   i     LH; i  + '       g   i     R# ; i)r  r   N)r   r  r   s   & r   test_int_from_other_bases0IntStrDigitLimitsTests.test_int_from_other_bases  sl    \\t\$$##D) %\\t\$$##D) %$ %$ %$$s   A/B/A?	B	c                D   R p\         P                  ! R4      ;_uu_ 4        \        P                  ! 4       pV P	                  \         P
                  ! V4      ^ R4       \        P                  ! 4       pV P	                  W#4       RRR4       R#   + '       g   i     R# ; i)a8  if 1:
        # Subinterpreters maintain and enforce their own limit
        import sys
        sys.set_int_max_str_digits(2323)
        try:
            int('3'*3333)
        except ValueError:
            pass
        else:
            raise AssertionError('Expected a int max str digits ValueError.')
        i  z%subinterp code failure, check stderr.N)r   r  r   r  r   run_in_subinterp)r   codebefore_valueafter_values   &   r   *test_int_max_str_digits_is_per_interpreterAIntStrDigitLimitsTests.test_int_max_str_digits_is_per_interpreter  sv    
 ..t44557LW55d;QDF446K\7 5444s   A#BB	r  r   )r   r   r   r   r   r  r  r  r  r  rn  r  r  r  r  r  r  r  r  r  r   r   __classcell__r  r   s   @@r   r  r    sZ     I)
<
E(&JP#OJ4	 
%*8 8r   r  c                       ] tR tRt]tRtR# )IntSubclassStrDigitLimitsTestsi  r   N)r   r   r   r   r   r  r   r   r   r   r  r    s    Ir   r  c                     a a ] tR tRt oV 3R ltV 3R ltR tR t]P                  ! R4      R 4       t
R tR	 t]P                  ]P                  ! ]R
4      ]P$                  P'                  ]R4      R 4       4       4       t]P                  ]P                  ! ]R
4      ]P$                  P'                  ]R4      R 4       4       4       tR t]P                  ! R4      ]P                  ! ]R4      R 4       4       t]P                  ! R4      ]P                  ! ]R
4      ]P                  ! ]R4      R 4       4       4       t]P                  ! ]R4      ]P                  ! ]R4      R 4       4       t]P                  ! ]R
4      R 4       tRtVtV ;t# )PyLongModuleTestsi  c                   < \         SV `  4        \        P                  ! 4       V n        \        P
                  ! ^ 4       R# r   r  r  s   &r   r  PyLongModuleTests.setUp  s+    "99;""1%r   c                d   < \         P                  ! V P                  4       \        SV `  4        R # r   r  r  s   &r   r  PyLongModuleTests.tearDown  r  r   c                   \        V4      pV P                  VRR V4       \        V) 4      pV P                  VRV,           4       RV,          pV P                  WS4       RV,          pV P                  WcP                  R4      4       R# )
   Nr   z%ds   %dasciii)r   r   encode)r   re  suffixr   s2s3s4s   &&&    r   _test_pylong_int_to_decimal-PyLongModuleTests._test_pylong_int_to_decimal  sw    F34&)!WS1W%AXQYXXg./r   c                   V P                  ^R,          R4       V P                  ^R,          ^,
          R4       V P                  ^
R,          R4       V P                  ^
R,          ^,
          R4       V P                  ^R,          R4       R	# )
r   r  
9883109376
9883109375i0u  
0000000000
9999999999i`  
9313200001Nr  r   s   &r   test_pylong_int_to_decimal,PyLongModuleTests.test_pylong_int_to_decimal  so    ((!w,F((!w,!);\J((V\B((VaF((FLAr   cpuc                    V P                  ^R,          R4       V P                  ^
R,          R4       V P                  ^R,          R4       R# )r  @B 
2747109376i r  i'	 
3132000001Nr  r   s   &r   test_pylong_int_to_decimal_2.PyLongModuleTests.test_pylong_int_to_decimal_2  s>    ((I|D((WlC((G\Br   c                P    ^R,          p\        V^,          ^,           V4      w  r#R# )r   r  N)divmod)r   re  ar   s   &   r   test_pylong_int_divmod(PyLongModuleTests.test_pylong_int_divmod  s#    '\acAgq!1r   c                ^   ^R,          p\        V4      p\        V4      p\        RV,           4      p\        RV,           R,           4      pV P                  \        4      ;_uu_ 4       p\        VR,           4       RRR4       V P                  \        4      ;_uu_ 4       p\        VR,           4       RRR4       V P                  \        4      ;_uu_ 4       p\        RV,           4       RRR4       R#   + '       g   i     L; i  + '       g   i     L]; i  + '       g   i     R# ; i)r   r  z -z +r   zNr   )r   r   r   r   )r   v1r   v2v3v4r  s   &      r   test_pylong_str_to_int(PyLongModuleTests.test_pylong_str_to_int  s    '\GV]C z**cCL +z**cCL +z**caL +*	 +******s$   (C5 DD5D	D	D,	z_pylong module requiredint_to_decimal_stringc           	     (   \         P                  ! R 4      ;_uu_ 4        \        RR,          4      pRVn        V P	                  \
        4      ;_uu_ 4       p\        V4       RRR4       V P                  R\        XP                  4      4       \        R4      Vn
        V P	                  \        4      ;_uu_ 4        \        V4       RRR4       RRR4       R#   + '       g   i     L; i  + '       g   i     L-; i  + '       g   i     R# ; i)r  r  N  Nz%_pylong.int_to_decimal_string did nottestABC)r   r  r   return_valuer   r   r   r  rk  RuntimeErrorside_effect)r   mock_int_to_str	big_valuectxs   &&  r   )test_pylong_misbehavior_error_path_to_str;PyLongModuleTests.test_pylong_misbehavior_error_path_to_str  s    
 ..v66CJI+/O(""9--I .MMAcmm,.*6y*AO'""<00I 1 76 .-
 10 766s<   7D C	"AD <C-	D C*%D -C=8D  D	int_from_stringc           	        R R,          p\         P                  ! R4      ;_uu_ 4        RVn        V P                  \        4      ;_uu_ 4       p\        V4       RRR4       V P                  R\        XP                  4      4       \        R4      Vn
        V P                  \        4      ;_uu_ 4        \        V4       RRR4       RRR4       R#   + '       g   i     L; i  + '       g   i     L-; i  + '       g   i     R# ; i)r  r  r  s
   not an intNz_pylong.int_from_string did nottest123)r   r  r!  r   r   r   r  r   rk  r"  r#  )r   mock_int_from_strr%  r&  s   &&  r   +test_pylong_misbehavior_error_path_from_str=PyLongModuleTests.test_pylong_misbehavior_error_path_from_str-  s    
 J	..v66-:*""9--I .MM;cmm,. -9,C)""<00I 1 76-- 10 766s<   %C7C	AC73C$	?C7C!C7$C4/C77D	c                   ^ RI HpHp RpVR8:  dx   W1! R^e4      ,          p^V^,
          ,          pWB! V^,
          4      ,          p\        V4      pV P	                  VR4       V P                  V\        V4      4       V^,          pK~  R# )r   )	randrangegetrandbitsi  r  r   Ni)randomr0  r1  r   assertNotStartsWithr   r   )r   r0  r1  bitshibitre  sns   &      r   test_pylong_roundtrip'PyLongModuleTests.test_pylong_roundtrip>  s~    1iIdC((D$(OED1H--AQB$$R-QB(QJD  r   zC _decimal module requiredc                    R pRpRW!,          ^,
          V^,
          ,          ,          pRV,          pV P                  V\        V4      4       V P                  V\        V4      4       R# )r  r   
1234567890Nl    d(	 )r   r   r   )r   ktentotenre  r6  s   &    r   test_pylong_roundtrip_huge,PyLongModuleTests.test_pylong_roundtrip_hugeK  sY     8;?1=>ACG$SV$r   c                R   R R,          p^
\        V4      ,          ^,
          p\        P                  P                  4       p\        P                  P	                  4         V P                  V\        P                  ! V^R7      4       V P                  R\        P                  4       \        P                  P	                  4        \        P                  P                  V4       R#   \        P                  P	                  4        \        P                  P                  T4       i ; i)9i )GUARDi  N)	r  _pylong_spreadcopyclearr   _dec_str_to_int_innerr  update)r   r6  re  orig_spreads   &   r   +test_whitebox_dec_str_to_int_inner_failsafe=PyLongModuleTests.test_whitebox_dec_str_to_int_inner_failsafeV  s     7]BK!Ooo**,	0Q = =b JKMM#w/OO!!#OO"";/ OO!!#OO"";/s    AC' '?D&zpylong module requiredc                     ! R  R\         4      pV! R4      pV P                  \        RVP                  4        R2\        P
                  V4       R# )c                   &   a  ] tR tRt o R tRtV tR# )NPyLongModuleTests.test_whitebox_dec_str_to_int_inner_monster.<locals>.LyingStriq  c                B    \        R\        P                  ,          4      # )r   l          )r   rB  _LOG_10_BASE_256r   s   &r   __len__VPyLongModuleTests.test_whitebox_dec_str_to_int_inner_monster.<locals>.LyingStr.__len__r  s    Gw'?'??@@r   r   N)r   r   r   r   rP  r   r   r   s   @r   LyingStrrM  q  s     A Ar   rR  42z^cannot convert string of len z to int$N)r   r   r   rP  rB  rF  )r   rR  liars   &  r   *test_whitebox_dec_str_to_int_inner_monster<PyLongModuleTests.test_whitebox_dec_str_to_int_inner_monsterk  sL    	As 	A ~ 	z,T\\^,<HE))	r   c           
        a  V 3R  lpR F1  pR F(  pR F  p\        ^R4       F  pV! WRWC4       K  	  K!  	  K*  	  K3  	  R# )c                 2  <aaaaa	 \        4       o	\        4       oVVVVV	3R  loS! V 4       \        P                  ! WSSR7      pS
P                  VP	                  4       S4       VP                  4        F  w  rVS
P                  WaV,          4       K  	  R# )c                    < V S8:  g   V S9   d   R # SP                  V 4       V ^,	          pW,
          pSP                  S'       d   TMT4       S! V4       S! V4       R # r   )add)wlohiinnerlimitneedneed_hiseens   &  r   r^  MPyLongModuleTests.test_pylong_compute_powers.<locals>.consumer.<locals>.inner  sL    :d!VVwB/b	b	r   )ra  N)setrB  compute_powersr   keysitems)r[  r   r_  ra  dr;  r   r^  r`  rb  r   s   &&ff   @@@r   consumer>PyLongModuleTests.test_pylong_compute_powers.<locals>.consumer  sr    5D5D  !H&&qwGAQVVXt,	  AI. "r   i&  N)r     )FT)r      )r   )r   ri  r   ra  r_  r[  s   f     r   test_pylong_compute_powers,PyLongModuleTests.test_pylong_compute_powers  sB    	/$ D&"E"3_ %9 - # ' r   r  )r   r   r   r   r  r  r  r  r   requires_resourcer  r  r  r  r  
skipUnlessrB  r   patchr   r'  r-  r7  _decimalr=  rI  rU  rm  r   r   r  r  s   @@r   r  r    s    &
0B u%C &C
!
  ";<	ZZw 78 9 =  ";<	ZZw 12 3 =  u%#?@% A &% u%";<#?@0 A = &0$ ":;#?@ A <* ";<: =: :r   r  __main__)r   r   )r  r   )r@  	   )r   r  )99c   )r   d   )314r   )z 314r   )z314 r   )z  		  314  		  r   )z  1  r   )r   r  r   testr   test.support.numbersr   r   rB  r   rr  r   r   r   r   r   r   TestCaser   r  r  r  r   mainr   r   r   <module>r}     s1   
   

 	$	ckk	CKK(		Z 	Z	j	Z 	:%*	# 	b*8$$ b*HL8X.. L8^%; w:)) w:r zMMO a  G
  Hs"   C C# 	C C #	C/.C/