python (3.12.0)

(root)/
lib/
python3.12/
test/
__pycache__/
test_int.cpython-312.pyc

Αe`ddlZddlZddlZddlmZddlmZddlmZmZ	ddl	Z	ddddd	d
ddd
deejejfde
fdde
fde
fde
fde
fde
fgZGddeZGddej"ZGddej"ZGddeZGddej"Zed k(rej.yy#e
$rdZ	YwxYw)!N)mock)support)VALID_UNDERSCORE_LITERALSINVALID_UNDERSCORE_LITERALS)0r)1)9	)10
)99c)100d)314:)z 314r)z314 r)z  		  314  		  rz  1x)z  1  r	z  1     		  uȀceZdZy)IntSubclassN__name__
__module____qualname__A/BuggyBox/python/3.12.0/bootstrap/lib/python3.12/test/test_int.pyrr$srrceZdZdZdZdZdZejdZ	dZ
dZdZd	Z
d
ZdZdZd
ZdZdZdZdZdZdZy)IntTestCasescd|jtdd|jtdd|jtdd|jtdd|jtdd|jtdd|jtd	d|jtd
d|jtdd|jtdd|jtd
ddtD]I\}}dD]?}dD]8}||z|z}|}|dk(r|tur|}	|jt||:AKt	dt
jz
}t|}|j|dzt
j|j|t|jt|ddt
jdztd}|j|ttd}|j|tdt
jz
}|j|dz	|dztd}|j|t|jttdd|jtddd|jtddd|jttdd|jttdd|jttdd |jttdd|jttd!d|jttd!d|jtd"dd#|jtd$dd#|jtd%d&d#|jtd'd(d#|jtd)d*d#|jtd+d,d#|jtd-d d#|jtd.d/d#|jtd0d1d#|jtd2d3d#|jtd4dd#|jtd5d6d#|jtd7d8d#|jtd9d:d#|jtd;dd#|jtd<d=d#|jtd>d?d#|jtd@dAd#|jtdBdCd#|jtdDdEd#|jtdFdGd#|jtdHdId#|jtdJdKd#|jtdLdMd#|jtdNdOd#|jtdPdQd#|jtdRdSd#|jtdTdUd#|jtdVdWd#|jtdXdYd#|jtdZd[d#|jtd\d]d#|jtd^d_d#|jtd`dad#|jtdbdcd#|jtdddd|jtdddd|jtdedd|jtddd|jtddd|jtdfdd&|jtdgdd|jtdhdd|jtdidd&|jt5tdjdddd|jtdkdl|jtdkd1dl|jtddd|jtdd d|jtdfdd&|jtdmdd|jtdnd d|jtdodd&|jttdpd|jttdqd|jttdrd|jttdsd|jttdtd |jttdud |jttdvd |jttdwd |jttdxd|jttdyd|jttdzd|jttd{d|jtd|dd}|jtd~dd}|jtdd&d}|jtdd(d}|jtdd*d}|jtdd,d}|jtdd d}|jtdd/d}|jtdd1d}|jtdd3d}|jtddd}|jtdd6d}|jtdd8d}|jtdd:d}|jtddd}|jtdd=d}|jtdd?d}|jtddAd}|jtddCd}|jtddEd}|jtddGd}|jtddId}|jtddKd}|jtddMd}|jtddOd}|jtddQd}|jtddSd}|jtddUd}|jtddWd}|jtddYd}|jtdd[d}|jtdd]d}|jtdd_d}|jtddad}|jtddcd}y#t$rY
cwxYw#1swYxYw)NrgQ	@gQ	g333333@g333333g@gz-3z -3 u -3 r)r+-)rr	rr'r	g}Ô%ITg}Ô%IX1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111110o123rS0x123i#0x0o0b!100000000000000000000000000000000l1020020222012211112111000000000000000032244002423141
15501040155042113014223544000000000012068657454r
4294967296r

1904440554	9ba461594	535a79889
	2ca5b7464	1a20dcd81	100000000a7ffda91704he7g44f5aff663723ai4g281d55i41fj8b1841606k7icmb994aghek2mgldnchbnmb28jpdm8pfgih476beigg5qmcpqg4q0jto44000000 3aokq94!2qhxjli"2br45qb#1z141z4$z 0o123  0000b100z	 0O123   z 0X123  z 0B100 0100123{0X1230O1230B1000b20b020B20B020o80o080O80O080xg0x0g0Xg0X0g!100000000000000000000000000000001l1020020222012211112121000000000000000132244002423142
15501040155052113014223554000000000112068657455
4294967297
1904440555	9ba461595	535a7988a	2ca5b7465	1a20dcd82	100000001a7ffda92704he7g54f5aff673723ai4h281d55i51fj8b1851606k7idmb994ahhek2mgmdnchbnnb28jpdn8pfgih576beigh5qmcpqh4q0jto540000013aokq952qhxjlj2br45qc1z141z5)
assertEqualintL
ValueErrorreprsysmaxsizeassertIsInstanceassertRaises	TypeError)selfsvsignprefixssvvxs        r
test_basiczIntTestCases.test_basic)sS3'TA&UR(S1%TB'S1%TB'TB'Vb)9:B?T"r*
	DAq$	
7F$*BBs{q
':R((R"5
	

	
CKK F1s{{l+a%QqrUS[[]3
Ja%Ka%
s{{NaA&	Na%	
)S!R0Wa"-Wb)3/	
*c44*c43*c43*c43*c43*c43	
@!DjQ4a8*E0!4jA-q1:>_a0*=^Q/<]A.
;]A.
;\2.
;\2.
;["-z:["-z:["-z:["-z:["-z:Z,j9Z,j9Z,j9Z,j9Z,j9Z,j9Z,j9Y+Z8Y+Z8Y+Z8Y+Z8Y+Z8Y+Z8Y+Z8Y+Z8Y+Z8Y+Z8Y+Z8Y+Z8Y+Z8	
Z+R0Z+R0UA*Wa"-Wa#.Wa!,[!,b1Z+S1Y*A.


z
*	qM		
Vc*VR#.	
Wb)3/Wa"-Wa!,Wb)3/Wa"-Wa!,	
*c5!4*c615*c5!4*c615*c5!4*c615*c5!4*c615*c5"5*c626*c5"5*c626	
@!DjQ4a8*E0!4jA-q1:>_a0*=^Q/<]A.
;]A.
;\2.
;\2.
;["-z:["-z:["-z:["-z:["-z:Z,j9Z,j9Z,j9Z,j9Z,j9Z,j9Z,j9Y+Z8Y+Z8Y+Z8Y+Z8Y+Z8Y+Z8Y+Z8Y+Z8Y+Z8Y+Z8Y+Z8Y+Z8Y+Z8&z		sz<
z%	z"	!z"	%z/c|jt5tdddd|jt5tdddd|jt5tdddd|jt5tdddd|jt5tddddy#1swYxYw#1swYxYw#1swYtxYw#1swYWxYw#1swYyxYw)Nr&r'z- 1z+ 1z + 1 rrrrs rtest_invalid_signszIntTestCases.test_invalid_signss


z
*	H	


z
*	H	


z
*	J	


z
*	J	


z
*	L												s:CC(C'C3:C?CC$'C03C<?Dc|jtdd|jtdd|jtddd|jtdddy)Nu(१२३४५६७८९०1234567890l
>V3&Z
u١٢٣٤٥٦٧٨٩٠iIrrrrs rtest_unicodezIntTestCases.test_unicodes`GHJ^_34jAGKMab3Q7Drc
tD]rtfddDr|jtdt	|jtdtjdddttD]3tfddDr|jttd5|jtddd	|jtd
d|jtdd|jttd
|jttd|jttd|jttdy)Nc3&K|]}|v
ywNr.0chlits  r	<genexpr>z0IntTestCases.test_underscores.<locals>.<genexpr>/29/z.eEjJr_rc3&K|]}|v
ywrrrs  rrz0IntTestCases.test_underscores.<locals>.<genexpr>rr1_00r#r0_100rs1_00_100z+_1001__00100_)	ranyrrevalreplacerrr)rrs @rtest_underscoreszIntTestCases.test_underscoress%,	HC/w//Sa[$s)4Sa[#ckk#r.BA*FG		H
/	7C/w//j#sA6	7
	
VQ+Ws+Ws+*c62*c73*c73*c62rc|jtdd|jtdd|jtdd|jtddy)Nrr
z-1r)s10s-1)assertIsrrs rtest_small_intszIntTestCases.test_small_intssL	


c$i$

c$i$

c%j"%

c%j"%rc8|jtdyNrrrs rtest_no_argszIntTestCases.test_no_argss"rc|jtddd|jtd5tdddd|jtd5tddddd|j	ttd	|j	ttd
y#1swYnxYw#1swYNxYw)Nrr*baser7zkeyword argumentg333333?)r)rrr
r)rrassertRaisesRegexrrrs rtest_keyword_argszIntTestCases.test_keyword_argssU+Q/

#
#I/A
B	#J	

#
#I/A
B	!%a 	!)Sr2)Sq1			!	!s
B.B:.B7:Cc|jtddd|jt5tddddd|jt5tddddd|jt5tddddd|jt5tdddd	zz

ddd|jt5tddd	z
dddt	ddD]}|jtd|
d!y#1swYxYw#1swYxYw#1swYxYw#1swYxYw#1swYhxYw)z9Testing the supported limits of the int() base parameter.rr9rr	N%isr*r)rrrrrangerrs  rtest_int_base_limitsz!IntTestCases.test_int_base_limitss0S!a(


z
*	QK	


z
*	RL	


z
*	TN	


z
*	&!QV*%	&


z
*	"!S&!	"!BK	5DS40!4	5							&	&	"	"s;
D)
D5
E0E
!E)D25D>E

EE"c|jt5tddddd|jt5tdddddy#1swY4xYw#1swYyxYw)z2Not integer types are not valid bases; issue16772.rg@Ng@)rrrrs rtest_int_base_bad_typesz$IntTestCases.test_int_base_bad_types-s_


y
)	SM	


y
)	SM						s
A
A"A"A+cGddt}ddzddzddfD],}|jt5td|ddd.|j	td|d	d
|j	td|d	d|j	td|d
	dy#1swYxYw)NceZdZdZdZy)9IntTestCases.test_int_base_indexable.<locals>.MyIndexablec||_yrvalue)rrs  r__init__zBIntTestCases.test_int_base_indexable.<locals>.MyIndexable.__init__6s	"
rc|jSrrrs r	__index__zCIntTestCases.test_int_base_indexable.<locals>.MyIndexable.__index__8szz!rN)rrrrrrrrMyIndexabler5s
#
"rrr*rr	r43101rr9r
erri)objectrrrr)rrrs   rtest_int_base_indexablez$IntTestCases.test_int_base_indexable4s	"&	"sFQVGQ*	 D"":.
 D$
 
 	 
	
UQ8!<UR93?UR99E

 
 s
B66B?	cGddtGddt}Gddt}ttfd||tg}	dd	lm|jfd
|D]}|d}|jt|5|jt|dt|tttfr|jt|d
dn-d}|jt|5t|d
ddd|jtd5t|dddddddy#t$rYwxYw#1swYSxYw#1swY/xYw#1swYxYw)NceZdZy)<IntTestCases.test_non_numeric_input_types.<locals>.CustomStrNrrrr	CustomStrrHrrceZdZy)>IntTestCases.test_non_numeric_input_types.<locals>.CustomBytesNrrrrCustomBytesrIrrrceZdZy)BIntTestCases.test_non_numeric_input_types.<locals>.CustomByteArrayNrrrrCustomByteArrayrJrrrc0|jSr)decode)brs r<lambda>z;IntTestCases.test_non_numeric_input_types.<locals>.<lambda>Osi
+rr)arraycd|S)NBr)rr
s rr	z;IntTestCases.test_non_numeric_input_types.<locals>.<lambda>Ys
uS!}rs100rr*r7zcan't convert non-stringzinvalid literalsAAAAAAAAAAAAAAAA)strbytes	bytearray
memoryviewr
appendImportErrorsubTesttyperr
isinstancerrr)	rrr	factoriesfrmsgrr
s	       @@rtest_non_numeric_input_typesz)IntTestCases.test_non_numeric_input_typesEsG	#"&%&.i.
+

		6#
45	(A&	Ad1g&	
(  Q-a#ui!89$$SAY24C//	3?"Aq	"++J8IJ(+'(	
(	
(	(		""((	
(	
(sOE	A,E,5
EE, E 2E,	EEEE, E)%E,,E6	c|jttdddd|jttdddd|jttdddd|jttdddd|jttddddy)	Ns123r	r#rX123s123 s123As1234)rrrrs rtest_int_memoryviewz IntTestCases.test_int_memoryviewhsZ/!45r:Z
3Aa892>Z0156;Z0156;Z0156;rc:|jttdy)Nz1.2rrs rtest_string_floatzIntTestCases.test_string_floatos*c51rc	Gdd}|jtt|Gddt}|jtt|Gdd}|j	t|dGdd	}t|fD]L}Gd
d|}|j	t|dGdd
|}|jt5|j	t|ddddGdd|}|jt5|jt5t|ddddddt|fD]r}	Gdd|	Gfdd|}
|jt5|j	t|
ddddGdd|	Gfdd|}|jt5|j	t|
ddddGfdd|	Gfdd|}	|jt5t|ddd|jd||	fGdd|	Gfd d!|}|jt5|jt5t|dddddduOy#1swYxYw#1swYxYw#1swYxYw#1swYQxYw#1swYxYw#1swYxYw#t$r%}
|j	t|
dYd}
~
d}
~
wwxYw#1swYxYw#1swYxYw)"NceZdZy)>IntTestCases.test_intconversion.<locals>.ClassicMissingMethodsNrrrrClassicMissingMethodsr!trr"ceZdZy)7IntTestCases.test_intconversion.<locals>.MissingMethodsNrrrrMissingMethodsr%xr#rr&ceZdZdZy)-IntTestCases.test_intconversion.<locals>.Foo0cyN*rrs r__int__z5IntTestCases.test_intconversion.<locals>.Foo0.__int__}rNrrrr,rrrFoo0r(|
rr/r+ceZdZy)0IntTestCases.test_intconversion.<locals>.ClassicNrrrrClassicr2r#rr3ceZdZdZdZy):IntTestCases.test_intconversion.<locals>.IntOverridesTrunccyr*rrs rr,zBIntTestCases.test_intconversion.<locals>.IntOverridesTrunc.__int__rcy)Nirrs r	__trunc__zDIntTestCases.test_intconversion.<locals>.IntOverridesTrunc.__trunc__srN)rrrr,r9rrrIntOverridesTruncr5srr:ceZdZdZy)2IntTestCases.test_intconversion.<locals>.JustTrunccyr*rrs rr9z<IntTestCases.test_intconversion.<locals>.JustTrunc.__trunc__r7rNrrrr9rrr	JustTruncr<srr?ceZdZdZy)9IntTestCases.test_intconversion.<locals>.ExceptionalTrunccddzy)Nr	rrrs rr9zCIntTestCases.test_intconversion.<locals>.ExceptionalTrunc.__trunc__s	ErNr>rrrExceptionalTruncrAsrrCceZdZdZy).IntTestCases.test_intconversion.<locals>.Indexcyr*rrs rrz8IntTestCases.test_intconversion.<locals>.Index.__index__!rNrrrrrrrIndexrE"rrIceZdZfdZy);IntTestCases.test_intconversion.<locals>.TruncReturnsNonIntcSrr)rrIs rr9zEIntTestCases.test_intconversion.<locals>.TruncReturnsNonInt.__trunc__s
$wrNr>)rIsrTruncReturnsNonIntrLs'rrNceZdZdZy)0IntTestCases.test_intconversion.<locals>.Intablecyr*rrs rr,z8IntTestCases.test_intconversion.<locals>.Intable.__int__rGrNr.rrrIntablerPrJrrRceZdZfdZy)=IntTestCases.test_intconversion.<locals>.TruncReturnsNonIndexcSrr)rrRs rr9zGIntTestCases.test_intconversion.<locals>.TruncReturnsNonIndex.__trunc__s&y(rNr>)rRsrTruncReturnsNonIndexrTs)rrVceZdZfdZy)4IntTestCases.test_intconversion.<locals>.NonIntegralcSrrrNonIntegrals rr9z>IntTestCases.test_intconversion.<locals>.NonIntegral.__trunc__s*},rNr>r[srr[rXs-rr[ceZdZfdZy)@IntTestCases.test_intconversion.<locals>.TruncReturnsNonIntegralcSrrrZs rr9zJIntTestCases.test_intconversion.<locals>.TruncReturnsNonIntegral.__trunc__s*},rNr>r\srTruncReturnsNonIntegralr^s-rr`zFailed to raise TypeError with z2__trunc__ returned non-Integral (type NonIntegral)ceZdZdZy)/IntTestCases.test_intconversion.<locals>.BadIntcyNgE@rrs rr,z7IntTestCases.test_intconversion.<locals>.BadInt.__int__s#rNr.rrrBadIntrbs$rreceZdZfdZy);IntTestCases.test_intconversion.<locals>.TruncReturnsBadIntcSrrrres rr9zEIntTestCases.test_intconversion.<locals>.TruncReturnsBadInt.__trunc__s
%xrNr>resrTruncReturnsBadIntrgs(rrk)
rrrrrassertWarnsDeprecationWarningZeroDivisionErrorfailr
)rr"r&r/r3rr:r?rCtrunc_result_baserNrVr`erkrerIrRr[s               @@@@rtest_intconversionzIntTestCases.test_intconversionrs2		)S*?*AB	V	)S.*:;			
TVb)		W%H	.D
D


S!2!45r:
D
!!"45
7  Y[!126
7
4
""#45
(!!"45
($&'
(
('-g%63
.!"-"''%%&89D$$S);)=%>CD"/")4)%%&89D$$S);)=%>CD-"3-
-d-	<))*<=73567II $&78;<$.$((&&y1.%%&89.*,-...c3
.+H	.
7
7
(
(
(
(DDDD77 =$$SV'<==="....s)!K+2LK8L"!L8!L<L8L,"L8-M5M)	M5+K5	8L=LL	LL),L51L88	M&M!!M&)M2
.M55M?cGddt}Gddt}|d}|j|d|jt|d|jt|dy)NceZdZdZy):IntTestCases.test_int_subclass_with_index.<locals>.MyIndexcyr*rrs rrzDIntTestCases.test_int_subclass_with_index.<locals>.MyIndex.__index__r-rNrHrrrMyIndexrur0rrwceZdZdZy);IntTestCases.test_int_subclass_with_index.<locals>.BadIndexcyrdrrs rrzEIntTestCases.test_int_subclass_with_index.<locals>.BadIndex.__index__rNrHrrrBadIndexry
rr|r=r)rr)rrwr|my_ints    rtest_int_subclass_with_indexz)IntTestCases.test_int_subclass_with_indexs_	c		s	#Va(XZ!,rcGddt}Gddt}|d}|j|d|jt|d|d}|j|d|jtt|y)NceZdZdZy)6IntTestCases.test_int_subclass_with_int.<locals>.MyIntcyr*rrs rr,z>IntTestCases.test_int_subclass_with_int.<locals>.MyInt.__int__r-rNr.rrrMyIntrr0rrceZdZdZy)7IntTestCases.test_int_subclass_with_int.<locals>.BadIntcyrdrrs rr,z?IntTestCases.test_int_subclass_with_int.<locals>.BadInt.__int__r{rNr.rrrrerr}rrer=r+)rrrr)rrrer~s    rtest_int_subclass_with_intz'IntTestCases.test_int_subclass_with_intst	C		S	q#Vb)#)S&1rc	
Gdd	Gddt}Gdd
Gddt}G	fd	d
}G
fdd}Gd
d}	}|jt5t|}ddd|jd|j	t|t|}t|}|j|d|j	t|t
}|jt5t|}ddd|j|d|j	t|t|}|jt5t|}ddd|j|d|j	t|t|}|jt5t|}ddd|j|d|j	t|t|}|jt5|j
tt|ddd|}|jt5t|}ddd|j|d|j	t|t|jt5t|}ddd|j|d|j	t|ty#1swYxYw#1swYxYw#1swYxYw#1swY^xYw#1swYxYw#1swYxYw#1swYxYw)NceZdZdZy)<IntTestCases.test_int_returns_int_subclass.<locals>.BadIndexcyNTrrs rrzFIntTestCases.test_int_returns_int_subclass.<locals>.BadIndex.__index__r{rNrHrrrr|rr}rr|ceZdZdZy)=IntTestCases.test_int_returns_int_subclass.<locals>.BadIndex2cyrrrs rrzGIntTestCases.test_int_returns_int_subclass.<locals>.BadIndex2.__index__r{rNrHrrr	BadIndex2rr}rrceZdZdZy):IntTestCases.test_int_returns_int_subclass.<locals>.BadIntcyrrrs rr,zBIntTestCases.test_int_returns_int_subclass.<locals>.BadInt.__int__r{rNr.rrrrerr}rreceZdZdZy);IntTestCases.test_int_returns_int_subclass.<locals>.BadInt2cyrrrs rr,zCIntTestCases.test_int_returns_int_subclass.<locals>.BadInt2.__int__r{rNr.rrrBadInt2rr}rrceZdZfdZy)HIntTestCases.test_int_returns_int_subclass.<locals>.TruncReturnsBadIndexcSrr)rr|s rr9zRIntTestCases.test_int_returns_int_subclass.<locals>.TruncReturnsBadIndex.__trunc__sz!rNr>)r|srTruncReturnsBadIndexrs
"rrceZdZfdZy)FIntTestCases.test_int_returns_int_subclass.<locals>.TruncReturnsBadIntcSrrris rr9zPIntTestCases.test_int_returns_int_subclass.<locals>.TruncReturnsBadInt.__trunc__s
xrNr>rjsrrkrs
 rrkceZdZdZy)KIntTestCases.test_int_returns_int_subclass.<locals>.TruncReturnsIntSubclasscyrrrs rr9zUIntTestCases.test_int_returns_int_subclass.<locals>.TruncReturnsIntSubclass.__trunc__r{rNr>rrrTruncReturnsIntSubclassrr}rrr	r)	rrlrmrrrrrr)rrrrrkrbad_intngood_intr|res         @@rtest_int_returns_int_subclassz*IntTestCases.test_int_returns_int_subclasss							c		"	"	 	 		*


0
1	GA	A

d1gs#+LA

d1gs#(


0
1	GA	A

d1gs#)


0
1	GA	A

d1gs#&(


0
1	GA	A

d1gs#$&


0
1	7ig6	7+,


0
1	H
A	A

d1gs#


0
1	&H%A	&A

d1g{+Q									7	7			&	&sT3LL'8L4M:M:MM&L$'L14L>MMM#&M/cdfd	}|d|d|d|d|dd|dd|dd	|d
d|d
d	|d|dd|d|dd|d
|d
dy)Ncjtd|d|d5}|t|nt||dddjjj
dd|dn||fzy#1swY<xYw)Nzint(z, ))rrz*invalid literal for int() with base %d: %rr
)rrrr	exceptionargs)rrcmrs   rcheckz.IntTestCases.test_error_message.<locals>.check7s"":894'@#B
!EG<F4L
!
R\\..q1<|q12
3

!
!sA66A?½u123½z  123 456  z123r
z123 245rRr%z123245rs123u123rr)rrs` rtest_error_messagezIntTestCases.test_error_message6s		3	f

i
m
i
i
mR 
mR 
lB
lB
j
j"
j
j"
k
k2rc|jtddd|jtddd|jtddd	|jtd
ddy)
N=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_1r*iUUUU1_2_3_4_5_6_7_0_1_2_3r2iSpS1_2_3_4_5_6_7_8_9r%lgF
1_2_3_4_5_6_7rji2Drrs rtest_issue31619zIntTestCases.test_issue31619Wse\^_`:	<4a8-H0"5{C_b1:>rN)rrrrrrrrcpython_onlyrrrrrrrrrrrrrrrrrrrr!r!'sw9r
E3&
&&#25"F"!(F<2Z.x
-2"F,PB?rr!cveZdZeZfdZfdZdZdZddZ	dZ
dZdZd	Z
d
ZdZdZd
ZdZxZS)IntStrDigitLimitsTestsc~t|tj|_tj
dy)NisupersetUprget_int_max_str_digits_previous_limitset_int_max_str_digitsr	__class__s rrzIntStrDigitLimitsTests.setUpcs+

"99;""4(rc`tj|jt|yrrrrrtearDownrs rrzIntStrDigitLimitsTests.tearDownh"""4#7#78
rc|jtjd|jtjdt	j
d5|j
tjd|jddz}t|ddd|jtjdy#1swY.xYw)Nr Nr)	
assertGreaterrr
assertLessradjust_int_max_str_digitsr	int_classr
)ris  rtest_disabled_limitz*IntStrDigitLimitsTests.test_disabled_limitls3557;224f=

.
.q
1	S7791=sV|,AF		
3557;			s
ACCc	|j}tj}|d|z|dd|zz|d|zdz|dd|zz|dd|zz|jt	td|dz
z|y)z&Ignore the +/- sign and space padding.rrr&r'r
r	N)rrrrlenr
)rr	maxdigitss   rtest_max_str_digits_edge_casesz5IntStrDigitLimitsTests.test_max_str_digits_edge_casesusNN	..0	#	/"#i'(#	/C'(#i'(#i'(S	A
!678)Drc|jt5||j|n|j||dddy#1swYyxYwr)rrr)rrrs   rrzIntStrDigitLimitsTests.checksD


z
*	(|q!q$'		(	(	(s'AActj}|jd|dzz|jdd|dzzz|jd|dzzdz|jdd|dzzz|jdd|dzzz|jd|dzzd|z}|jt5t|dddy#1swYyxYw)Nrr	rr&r'r
)rrrrrr
)rrrs   rtest_max_str_digitsz*IntStrDigitLimitsTests.test_max_str_digitss..0	

3)a-()

3	A
../

3)a-(3./

3	A
../

3	A
../

3)a-())O


z
*	F			sCC#cTtj}|dksJ|tj}|dkrtj}tdddzd}d}t
j|5|}t|}d	d	d	|z
}|jt||d
krtjd|dt
jtd
|z5|jt5}|}t|d	d	d	||z
}	d	d	d	|jdtj |j#	|dztdddzd}
|jt5}|}t|
d	d	d	||z
}|jdt|j |j%||dzy	#1swYsxYw#1swYxYw#1swYxYw#1swYsxYw)?Regression test: ensure we fail before performing O(N**2) work.iPrr0cir%ri1N?"slow" conversion took only 	 seconds.gףp=
?
conversionr*i )rrtimeprocess_time	monotonicrrrr
rrunittestSkipTestrrassertInrassertLessEqualr)rrget_timehuge_intdigitsstarthuge_decimalseconds_to_converterrseconds_to_fail_hugeextra_huge_intseconds_to_fail_extra_huges            r+test_denial_of_service_prevented_int_to_strzBIntStrDigitLimitsTests.test_denial_of_service_prevented_int_to_strs..0	6!,9,$$:?~~HCJ<(r2

.
.v
6	)JEx=L	)&Z%/\*F3$##$B'9&:)%EF
F

.
.s4&=/A
B	6"":.
# 
H

$,:#5 		6
	


lC

$6713Ea3GHr#g+/b9


z
*	 cJE	 &.Z%%7"

lC

$6724Fq4HI?	)	)

	6	6	 	 s<5G94H
HHH9HH	HHH'ctj}|dksJ|tj}|dkrtj}d}d|z}tj|5|}t|ddd|z
}|dkrtjd|dtj|d	z
5|jt5}|}t|ddd||z
}ddd|jd
tj|j|dzdd
z}	|jt5}|}t|	ddd||z
}
|jd
t|j|j|
|dzy#1swYAxYw#1swYxYw#1swYxYw#1swYsxYw)r順riD
8Nrrrr	rr*7iO)rrrrrrrrrrrrrr
rr)rrrrhugerrrr
extra_hugers           r+test_denial_of_service_prevented_str_to_intzBIntStrDigitLimitsTests.test_denial_of_service_prevented_str_to_ints..0	7"-I-$$:?~~H6z

.
.v
6	JEI	&Z%/$##$B'9&:)%EF
F
.
.vz
:	6"":.
# 
D	
$,:#5 		6
	


lC

$6713Ea3GH]



z
*	cJE
O	&.Z%%7"

lC

$6779KA9MN9		

	6	6		s<'F9GG+GG9GG	GGG'ctj}dD]Q}|j|5|jd|dzz||dksJ|jddz|dddSy#1swY^xYw)z-The limit does not apply to power of 2 bases.)r*r7r2r%rjrrr	rN)rrrr)rrrs   r!test_power_of_two_bases_unlimitedz8IntStrDigitLimitsTests.test_power_of_two_bases_unlimiteds{..0	%	4D4(
4si!m4d; 7**sW}d3
4
4	4
4
4s5A,,A5	ctj}|dz}d|z}d|z}|j||j||j|d|j|dy)Nr#1111_11_111)rrrr)rrtriplesrs_s     rtest_underscores_ignoredz/IntStrDigitLimitsTests.test_underscores_ignoredsh..0	q.GO
g
qr

aS9

bT;rc|j}tj}d|z}||}|d|}||k(sJ|d|}||k(sJt|t|y)N5r&r')rrrr
)rr
max_digitsrrpos_ineg_is       rtest_sign_not_countedz,IntStrDigitLimitsTests.test_sign_not_countedspNN	//1
*aLAaS'"EzAaS'"vE
E
rcb|j}tj}d|z}|||}|dkDr*|jt5t|dddn|dkrt||jt5}||d|dddy#1swY4xYw#1swYyxYw)N2r
r)rrrrrr
)rrrrrrrs       r_other_base_helperz)IntStrDigitLimitsTests._other_base_helper
sNN	//1
*a"9"":.
A


BYF


z
*	%c1gt$	%	%	

	%	%s	B
B%B"%B.cd}|j|5|j|dddd}|j|5|j|dddy#1swY8xYw#1swYyxYw)Nr#rrr)rrrs  rtest_int_from_other_basesz0IntStrDigitLimitsTests.test_int_from_other_basesss
\\t\
$	*##D)	*
\\t\
$	*##D)	*	*	*	*	*	*sAA*A'*A3cd}tjd5tj}|j	tj
|ddtj}|j	||dddy#1swYyxYw)Na8if 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.')
        irz%subinterp code failure, check stderr.)rrrrrrun_in_subinterp)rcodebefore_valueafter_values    r*test_int_max_str_digits_is_per_interpreterzAIntStrDigitLimitsTests.test_int_max_str_digits_is_per_interpreters{

.
.t
4	8557LW55d;QD
F446K\;7	8	8	8sA!BBr)rrrrrrrrrrrrrrrrrr	r
__classcell__rs@rrr_sSI)
<
E()JV&OP4	 
%*8rrceZdZeZy)IntSubclassStrDigitLimitsTestsN)rrrrrrrrrr4sIrrcVeZdZfdZfdZdZdZdZeje
jede
jjeddZeje
jede
jjed	d
ZxZS)PyLongModuleTestsc~t|tj|_tj
dyrrrs rrzPyLongModuleTests.setUp<s+

"99;""1%rc`tj|jt|yrrrs rrzPyLongModuleTests.tearDownArrcddzdz
}d}t|}|dd|k(sJt|}|dd|k(sJd|z}|dd|k(sJd|z}|dd|jdk(sJy)Nr	r
9883109375iz%ds%dascii)r
encode)rrsuffixrs    rtest_pylong_int_to_decimalz,PyLongModuleTests.test_pylong_int_to_decimalEs
'\QFw&  Gw&  1Hw&  AIw&--0000rcPddz}t|dzdz|\}}|dk(r|dk(sJy)Nr	rr#)divmod)rrars    rtest_pylong_int_divmodz(PyLongModuleTests.test_pylong_int_divmodQs5
'\acAgq!1Av!q& &rcddz}t|}t|}||k(sJtd|z}||k(sJtd|zdz}||k(sJ|jt5}t|dzddd|jt5}t|dzddd|jt5}td|zdddy#1swYbxYw#1swYBxYw#1swYyxYw)Nr	rz -z +rzr)r
rrr)rv1rv2v3v4rs       rtest_pylong_str_to_intz(PyLongModuleTests.test_pylong_str_to_intVs
'\G
VRx
]sby
C
 Rx


z
*	cCL	


z
*	cCL	


z
*	caL									s$&CC">C.C"C+.C7z_pylong module requiredint_to_decimal_stringctjd5tddz}d|_|j	t
5}t
|ddd|jdt
jtd|_
|j	t5t
|ddddddy#1swYpxYw#1swYxYw#1swYyxYw)NrrNz%_pylong.int_to_decimal_string did nottestABC)rrrreturn_valuerrr
rrRuntimeErrorside_effect)rmock_int_to_str	big_valuectxs    r)test_pylong_misbehavior_error_path_to_strz;PyLongModuleTests.test_pylong_misbehavior_error_path_to_strfs

.
.v
6		CJI+/O(""9-
I
MMAcmm,
.*6y*AO'""<0
I
				




				s<+CB<
ACC+C<C	CC	
CCint_from_stringcddz}tjd5d|_|jt5}t|ddd|j
dtjtd|_
|jt5t|ddddddy#1swYpxYw#1swYxYw#1swYyxYw)Nrr+rs
not an intz_pylong.int_from_string did nottest123)rrr-rrrrr
rr.r/)rmock_int_from_strr1r2s    r+test_pylong_misbehavior_error_path_from_strz=PyLongModuleTests.test_pylong_misbehavior_error_path_from_strvs
J	

.
.v
6		-:*""9-
I
MM;cmm,
.-9,C)""<0
I
				



				s;CB3ACB?"C3B<	8C?C	CC)rrrrrrr!r(rrr
skipUnless_pylongrpatchrr3r8rrs@rrr8s&

1!
 
X";<	ZZw 789=
X";<	ZZw 123=rr__main__)rrrrtestrtest.test_grammarrrr:rrrrrrrTestCaser!rrrrmainrrr<module>rAs
<
	$	
ckk	CKK(		Z 	Z	j	Z 	:%*	#	u?8$$u?pR8X..R8j%;M))M`zHMMOyGsCCC