python (3.11.7)

(root)/
lib/
python3.11/
test/
__pycache__/
test_funcattrs.cpython-311.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"cdS)Nr
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'r0r
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%r8assertIndirr"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)NcdS)zmy docstringr$r
r
rr	duplicatezJFunctionPropertiesTest.test_duplicate_function_equality.<locals>.duplicate=s1r)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$)r4r%__code__)r rCs  rtest_copying___code__z,FunctionPropertiesTest.test_copying___code__BsT&&&
#####rc||jjt||jddt
tfdS)N__globals__)assertIsr%rHglobalsr0AttributeError	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__rIc t|Sr)len)ss rfuncz6FunctionPropertiesTest.test___builtins__.<locals>.funcTsCFF]rabcr$z\
            def func3(s): pass
            func4 = type(func3)(func3.__code__, {})
        None)typerPfunc3func4)rJr%rPr0rLrMrWrErHr4textwrapdedentexecassertNotIn)r rTnsfunc2code
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__)	rmassertIsInstancetupler4rR	__class__rr0rLr ricr!s   @rtest___closure__z'FunctionPropertiesTest.test___closure__ls
Ma'''Q###10&999Q
q.AAAAArctjd}||jdtj}d}|t
|5|jddddS#1swxYwYdS)Nrk'shouldn't be able to read an empty cell)msg)typesCellTyper4
cell_contentsassertRaises
ValueError)r cell_objrvs   r
test_cell_newz$FunctionPropertiesTest.test_cell_newvs>!$$/333>##7


zs

3
3	#	#""	#	#	#	#	#	#	#	#	#	#	#	#	#	#	#	#	#	#s!A66A:=A:cfd}	|jdj|dn#t$rYnwxYwddS)Nc&tdSrrfrhsrriz1FunctionPropertiesTest.test_empty_cell.<locals>.frjrrrurd)rmryr*r{)r rir!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)NrdcSrr
rhsrriz/FunctionPropertiesTest.test_set_cell.<locals>.fsr	rru)	rmryr4r*r{rz	NameErrorUnboundLocalErrorrgrqs   @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%rrdrr7zdef f(): pass
f.__name__rPr!)	r4r%rr0rMr\r&r!rL)r rSs  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_function2rrrr	r7)	r4r%r	rr'rrr0rMrs 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)r7cdSrr
r
rrr!z/FunctionPropertiesTest.test___code__.<locals>.arDrcdS)Nrdr
r
rrr%z/FunctionPropertiesTest.test___code__.<locals>.bsrcSrr
)num_onesrrrz/FunctionPropertiesTest.test___code__.<locals>.crcSrr
)num_twosrrz/FunctionPropertiesTest.test___code__.<locals>.drrcfSrr
)rrsrez/FunctionPropertiesTest.test___code__.<locals>.es
((rr7rzC__code__ with different numbers of free vars should not be possible)r4rWrErwCodeTyper*r{)	r r!r%rrrrrTrrs	       @@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)r4r%__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_funcQ3JrrkrIc||zSrr
rs  rsecond_funczBFunctionPropertiesTest.test_func_default_args.<locals>.second_funcrr)rkrIr$rzE__defaults__ does not update; deleting it does not remove requirement)r4rr*rM)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	r5r;r@rFrNrbrsr}rrrrrrrr
rrr2r2-s666DDD///$$$:::
BBB>BBB###(III CCC()))<444
,,,,,rr2c&eZdZdZdZdZdZdS)InstancemethodAttrTestc||jjjj|j||jjd|jtdS)Nrp)r4r&r!__self__rpr"r0rMrs rtest___class__z%InstancemethodAttrTest.test___class__sJ+5tv>>>TWYTVYGGGGGrc||jjj|jj||jjd|jjtdS)N__func__)r4r&r!rr"r0rLrs r
test___func__z$InstancemethodAttrTest.test___func__sK+TVX666TWY
DFHnMMMMMrc||jjj|j||jjd|jt
dS)Nr)r4r&r!rr0rLrs 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_attrrI)	rw
MethodTypeidr&r4rr*rLr0rs 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)Nr7z0setting attributes on methods should raise error)r%r8r4r&r!r*rLrs 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*rLrs 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*rL)r rTs  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)UserDictr8r7)r0r%rMcollectionsrr&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)Nr8r7)	r%rrJr"r!r&rr4r8)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*rMrs rtest_delete___dict__z&FunctionDictsTest.test_delete___dict__NsN	M
IIKLLLLL			DD	rcF||jjidSr)r4r%rrs rtest_unassigned_dictz&FunctionDictsTest.test_unassigned_dictVs""-----rcdd}i}|||j<|||j|dS)NzSome string)r%r4)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__)r4r%rr"r!r&r0rL)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%rr4rs rtest_delete_docstringz+FunctionDocstringTest.test_delete_docstringjs2(FN.....rN)rrr	rrr
rrrr`s5KKK/////rrc,fd}||jdS)z)Create a cell containing the given value.c&tdSrrfrhsrrizcell.<locals>.fr
arrrm)r.rir!s  @rrlrlps.
A=rTc0fd}|sd|jdS)zCreate an empty cell.c&tdSrrfrhsrrizempty_cell.<locals>.fyrrirr)emptyrir!s  @r
empty_cellrws8
=rceZdZdZdS)CellTestc|tdtdk|ttdk|ttk|tdtdk|tdtkdS)NrIr$saturdayigBT)
assertTruerlrrs 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riz4StaticMethodAttrsTest.test_func_attribute.<locals>.fsDr)classmethodrrstaticmethod)r rirrrSs    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)
NrrRtimez
dict.fromkeyszfloat.__getformat__z
str.maketranszbytes.maketrans)rkrIr$zlist.appendfoobarzdict.pop)
rr4rRr	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)rZrwunittestrTestCaserr2rrrrrlrrrrrmainr
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