python (3.11.7)

(root)/
lib/
python3.11/
test/
__pycache__/
test_funcattrs.cpython-311.opt-2.pyc

ep;ddlZddlZddlZdZGddejZGddeZGddeZGd	d
eZGddeZ	Gd
deZ
dZddZGddejZ
GddejZGddejZedkrejdSdS)NcdfdS)Nc&Gdd}da|S)NceZdZdS);global_function.<locals>.inner_function.<locals>.LocalClassN)__name__
__module____qualname__G/BuggyBox/python/3.11.7/bootstrap/lib/python3.11/test/test_funcattrs.py
LocalClassrsDrr
cd}|S)NcdSNr
r
rrinner_function2z.inner_global_function.<locals>.inner_function2rr
)rs rinner_global_functionrs


""r)r)r
s rinner_functionz'global_function.<locals>.inner_functionsA									#	#	#rcSrr
rsr<lambda>z!global_function.<locals>.<lambda>s>rr
rs@rglobal_functionrs#"!!!!rceZdZdZdZdS)
FuncAttrsTestc`Gdd}d}||_||_||_dS)NceZdZdZdS)FuncAttrsTest.setUp.<locals>.FcdSrr
selfs raz FuncAttrsTest.setUp.<locals>.F.arrN)rrr	r!r
rrFrs#




rr"cdSNr
r
rrbzFuncAttrsTest.setUp.<locals>.bs1r)fir"r&)r r"r&s   rsetUpzFuncAttrsTest.setUpsX											!##rc	t||||d|d|n#|$rYnwxYw	t|||d|zdS#|$rYdSwxYw)Nzshouldn't be able to set z to zshouldn't be able to del %s)setattrfaildelattr)r objnamevalue
exceptionss     rcannot_set_attrzFuncAttrsTest.cannot_set_attrs	KCu%%%
IIITTT55IJJJJ			D		<C
II3d:;;;;;			DD	s/77A%%A.-A.N)rrr	r(r1r
rrrrs2<<<<<rrcheZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
dZd
ZdZdZdS)FunctionPropertiesTestcP||jjtdSr)assertEqualr&rrrs rtest_modulez"FunctionPropertiesTest.test_module/s#*H55555rcd|j_|dt|jdd|jj_|dt|jjddS)N
known_attrz+set attributes not in dir listing of methodzEset attribute on function implementations, should show up in next dir)r&r9assertIndirr"r!r'rs rtest_dir_includes_correct_attrsz6FunctionPropertiesTest.test_dir_includes_correct_attrs2sx

lCKK9	;	;	; 

lC	NN5C	D	D	D	D	DrcBd}||j|dS)Nc	dSr$r
r
rr	duplicatezJFunctionPropertiesTest.test_duplicate_function_equality.<locals>.duplicate=s
1r)assertNotEqualr&)r r?s  r test_duplicate_function_equalityz7FunctionPropertiesTest.test_duplicate_function_equality;s1				
DFI.....rcd}||d|jj|_||ddS)NcdSrr
r
rrtestz:FunctionPropertiesTest.test_copying___code__.<locals>.testCrr%)r5r&__code__)r rDs  rtest_copying___code__z,FunctionPropertiesTest.test_copying___code__BsT&&&
#####rc||jjt||jddt
tfdS)N__globals__)assertIsr&rIglobalsr1AttributeError	TypeErrorrs rtest___globals__z'FunctionPropertiesTest.test___globals__HsQ

df('))444TV]A,i8	:	:	:	:	:rc@||jjt||jddtt
fd}i}t
||j|}||j|||jt|	|dd|	|itjd}ddi}t|d}t||||d	j|||d
j|||d	jd||
d|d
jdS)N__builtins__rJc t|Sr)len)ss rfuncz6FunctionPropertiesTest.test___builtins__.<locals>.funcTsCFF]rabcr%z\
            def func3(s): pass
            func4 = type(func3)(func3.__code__, {})
        None)typerQfunc3func4)rKr&rQr1rMrNrXrFrIr5textwrapdedentexecassertNotIn)r rUnsfunc2code
safe_builtinss      rtest___builtins__z(FunctionPropertiesTest.test___builtins__Ms

df)<888TV^Q,i8	:	:	:
	#""
T

4="--

e',,,

e(,777	
uq)))R    

 
M
:
:T2

bk.
>>>

bk.
>>>

bk-n=}MMMG)@AAAAArc&dfd}|j}||t|t	|d||djjd||d|tdS)Nc&tdSrprintr!srfz2FunctionPropertiesTest.test___closure__.<locals>.fnqrrcell__closure__)	rnassertIsInstancetupler5rS	__class__rr1rMr rjcr!s   @rtest___closure__z'FunctionPropertiesTest.test___closure__ls
Ma'''Q###10&999Q
q.AAAAArctjd}||jdtj}d}|t
|5|jddddS#1swxYwYdS)Nrl'shouldn't be able to read an empty cell)msg)typesCellTyper5
cell_contentsassertRaises
ValueError)r cell_objrws   r
test_cell_newz$FunctionPropertiesTest.test_cell_newvs>!$$/333>##7


zs

3
3	#	#""	#	#	#	#	#	#	#	#	#	#	#	#	#	#	#	#	#	#s!A66A:=A:cfd}	|jdj|dn#t$rYnwxYwddS)Nc&tdSrrgrisrrjz1FunctionPropertiesTest.test_empty_cell.<locals>.frkrrrvre)rnrzr+r|)r rjr!s  @rtest_empty_cellz&FunctionPropertiesTest.test_empty_cellsm	A
M!**
II?@@@@			D	
s0
==c\dfd}|j}d|d_||djd||d|d|d`	|dj|dn#t$rYnwxYw|t5|dddn#1swxYwY|t5tddddS#1swxYwYdS)NrecSrr
risrrjz/FunctionPropertiesTest.test_set_cell.<locals>.fsr	rrv)	rnrzr5r+r|r{	NameErrorUnboundLocalErrorrhrrs   @r
test_set_cellz$FunctionPropertiesTest.test_set_cells
M!1+Q///a   A
aD	A
aD
II?@@@@			D	

y
)
)		
ACCC															


0
1
1		!HHH																		s6;
B
B+*B+CC#&C#D!!D%(D%c||jjdd|j_||jjdd|j_||jjd||jddtd}t|dii||jjjd||jjddtdS)	Nr&rsdrr8zdef f(): pass
f.__name__rQr!)	r5r&rr1rNr]r'r!rM)r rTs  r
test___name__z$FunctionPropertiesTest.test___name__s#...#...#...TVZI>>>
,Q$%%%+S111TWY
CHHHHHrcl||jjd|tjjd|t
jd|tjd|tjd|tjd|tjd|t
jdd	|j_||jjd	d
|j_||jjd
||jddtdS)
NzFuncAttrsTest.setUp.<locals>.bzFuncAttrsTest.setUprz!global_function.<locals>.<lambda>z'global_function.<locals>.inner_functionrrz.inner_global_function.<locals>.inner_function2rsrr	r8)	r5r&r	rr(rrr1rNrs rtest___qualname__z(FunctionPropertiesTest.test___qualname__s,.NOOO,9;PQQQ57HIII**7<	>	>	>***,,9B	D	D	D,***,,..;V	X	X	X.;=TUUU.00=?oppp!,c222!,c222TV^Q	BBBBBrcd\d}d}fd}fd}fd}|||||fD]4}|t|jtj5||d||d|j|_||j|j||d	|j|_|d	n#t$rYnwxYw	|j|_|d	dS#t$rYdSwxYw)
N)r8cdSrr
r
rrr!z/FunctionPropertiesTest.test___code__.<locals>.arErcdS)Nrer
r
rrr&z/FunctionPropertiesTest.test___code__.<locals>.bsrcSrr
)num_onesrrsz/FunctionPropertiesTest.test___code__.<locals>.crcSrr
)num_twosrrz/FunctionPropertiesTest.test___code__.<locals>.drrcfSrr
)rrsrez/FunctionPropertiesTest.test___code__.<locals>.es
((rr8rzC__code__ with different numbers of free vars should not be possible)r5rXrFrxCodeTyper+r|)	r r!r&rsrrrUrrs	       @@r
test___code__z$FunctionPropertiesTest.test___code__s

((((((1aO	B	BDT$-00%.AAAAa   a   Z
QZ000a   	)AJ
II(
)
)
)
)			D	
	)AJ
II(
)
)
)
)
)			DD	s$!D
DDD77
EEc||jjd|j`||jjddSr)r5r&__defaults__rs rtest_blank_func_defaultsz/FunctionPropertiesTest.test_blank_func_defaultssF,d333F,d33333rcd}dd}||jd||jdd|_||jd||d||dd||ddd|`||jd	||d	dS#t$rYdSwxYw)
Nc||zSrr
r!r&s  r
first_funczAFunctionPropertiesTest.test_func_default_args.<locals>.first_funcQ3JrrlrJc||zSrr
rs  rsecond_funczBFunctionPropertiesTest.test_func_default_args.<locals>.second_funcrr)rlrJr%rzE__defaults__ does not update; deleting it does not remove requirement)r5rr+rN)r rrs   rtest_func_default_argsz-FunctionPropertiesTest.test_func_default_argssN							0$77716:::"(
0&999q)))A***Aq))1---$14888	,KMMM
II+
,
,
,
,
,			DD	s
C<<
D
	D
N)rrr	r6r<rArGrOrcrtr~rrrrrrrr
rrr3r3-s666DDD///$$$:::
BBB>BBB###(III CCC()))<444
,,,,,rr3c&eZdZdZdZdZdZdS)InstancemethodAttrTestc||jjjj|j||jjd|jtdS)Nrq)r5r'r!__self__rqr"r1rNrs rtest___class__z%InstancemethodAttrTest.test___class__sJ+5tv>>>TWYTVYGGGGGrc||jjj|jj||jjd|jjtdS)N__func__)r5r'r!rr"r1rMrs r
test___func__z$InstancemethodAttrTest.test___func__sK+TVX666TWY
DFHnMMMMMrc||jjj|j||jjd|jt
dS)Nr)r5r'r!rr1rMrs r
test___self__z$InstancemethodAttrTest.test___self__sG+TW555TWY
DG^LLLLLrctjt|j|j_||jt|j	|jjj|dn#t$rYnwxYw||jjddtdS)N4using unknown attributes should raise AttributeErrorunknown_attrrJ)	rx
MethodTypeidr'r5rr+rMr1rs rtest___func___non_methodz/InstancemethodAttrTest.test___func___non_method	s%b$'22
r$'{{333	NGJ##
IILMMMM			D	
	
TWZNKKKKKs*B
BBN)rrr	rrrrr
rrrrs^HHHNNNMMM
L
L
L
L
Lrrc eZdZdZdZdZdS)ArbitraryFunctionAttrTestcd|j_||jjd	d|jj_|ddS#t$rYdSwxYw)Nr8z0setting attributes on methods should raise error)r&r9r5r'r!r+rMrs r
test_set_attrz'ArbitraryFunctionAttrTest.test_set_attrsx*A...	J#$DGI 
IIHIIIII			DD	sA
A$#A$cb	|j`|ddS#t$rYdSwxYw)Nz1deleting unknown attribute should raise TypeError)r&rr+rMrs rtest_delete_unknown_attrz2ArbitraryFunctionAttrTest.test_delete_unknown_attr$sO	K#
IIIJJJJJ			DD	 
..c|j|jjfD]/}	|j|d #t
$rY,wxYwdS)Nr)r&r'r!non_existent_attrr+rM)r rUs  rtest_unset_attrz)ArbitraryFunctionAttrTest.test_unset_attr,sxVTWY'	,	,D
,&&		+,,,,"



	,	,s4
AAN)rrr	rrrr
rrrrsGJJJKKK,,,,,rrc,eZdZdZdZdZdZdZdS)FunctionDictsTestc||jddtddlm}|ddi}||jjjd|tdS)N__dict__r)UserDictr9r8)r1r&rNcollectionsrr'r!r)r rrs   rtest_setting_dict_to_invalidz.FunctionDictsTest.test_setting_dict_to_invalid8skTVZyAAA((((((HlA&''TWY/Q	JJJJJrcPddi}||j_|||jj||jj_|||jjjj|||jjj||jjd||jjdd||jjjjd||jjjddS)Nr9r8)	r&rrKr"r!r'rr5r9)r rs  rtest_setting_dict_to_validz,FunctionDictsTest.test_setting_dict_to_valid>s
1

a)))

a+4555

a+,,,*A...6:::+6:::-q11111rcb	|j`|ddS#t$rYdSwxYw)Nz3deleting function dictionary should raise TypeError)r&rr+rNrs rtest_delete___dict__z&FunctionDictsTest.test_delete___dict__NsN	M
IIKLLLLL			DD	rcF||jjidSr)r5r&rrs rtest_unassigned_dictz&FunctionDictsTest.test_unassigned_dictVs""-----rcdd}i}|||j<|||j|dS)NzSome string)r&r5)r r/rs   rtest_func_as_dict_keyz'FunctionDictsTest.test_func_as_dict_keyYs9$&	46E*****rN)rrr	rrrrrr
rrrr7seKKK222 MMM...+++++rrceZdZdZdZdS)FunctionDocstringTestc\||jjdd}||j_||jj_||jj|||jjj|||jjd|tdS)NzA test method that does nothing__doc__)r5r&rr"r!r'r1rM)r docstrs  rtest_set_docstring_attrz-FunctionDocstringTest.test_set_docstring_attras...2!000*F333TWY	6>JJJJJrcld|j_|j`||jjddS)Nz
The docstring)r&rr5rs rtest_delete_docstringz+FunctionDocstringTest.test_delete_docstringjs2(FN.....rN)rrr	rrr
rrrr`s5KKK/////rrc.	fd}||jdS)Nc&tdSrrgrisrrjzcell.<locals>.fr
arrrn)r/rjr!s  @rrmrmps13
A=rTc2	fd}|sd|jdS)Nc&tdSrrgrisrrjzempty_cell.<locals>.fyrrirr)emptyrjr!s  @r
empty_cellrws;
=rceZdZdZdS)CellTestc|tdtdk|ttdk|ttk|tdtdk|tdtkdS)NrJr%saturdayigBT)
assertTruermrrs rtest_comparisonzCellTest.test_comparisons
	
Q$q'')***
tJ'7'77888

4555S		T%[[0111T

Z\\122222rN)rrr	rr
rrrrs#	3	3	3	3	3rrceZdZdZdS)StaticMethodAttrsTestcd}t|}||j|ut|}||j|udS)NcdSrr
r
rrrjz4StaticMethodAttrsTest.test_func_attribute.<locals>.fsDr)classmethodrrstaticmethod)r rjrsrTs    rtest_func_attributez)StaticMethodAttrsTest.test_func_attributes_			
NN
a(((OO
a(((((rN)rrr	rr
rrrrs#)))))rrceZdZdZdS)BuiltinFunctionPropertiesTestc>ddl}|tjd||jjd|tjjd|tjjd|tj	jd|tj	jd|gdjjd	|d
dijjddS)
NrrStimez
dict.fromkeyszfloat.__getformat__z
str.maketranszbytes.maketrans)rlrJr%zlist.appendfoobarzdict.pop)
rr5rSr	dictfromkeysfloat
__getformat__str	maketransbytesappendpop)r rs  rtest_builtin__qualname__z6BuiltinFunctionPropertiesTest.test_builtin__qualname__s	
)5111/888	
3_EEE,9.	0	0	0	
3_EEE57HIII	
)6
FFF%+8*EEEEErN)rrr	rr
rrrrs(FFFFFrr__main__)T)r[rxunittestrTestCaserr3rrrrrmrrrrrmainr
rr<module>rs
"
"
"<<<<<H%<<<4K,K,K,K,K,]K,K,K,\LLLLL]LLL<,,,,,
,,,<&+&+&+&+&+
&+&+&+R
/
/
/
/
/M
/
/
/ 				
3
3
3
3
3x 
3
3
3	)	)	)	)	)H-	)	)	)FFFFFH$5FFF2zHMOOOOOr