Current File : //opt/imh-python/lib/python2.7/test/test_weakref.pyc
�
��Wc@s�ddlZddlZddlZddlZddlZddlZddlZddlZddlm	Z	e
adfd��YZdfd��YZ
d�Zd�Zd	�Zd
fd��YZdfd
��YZdejfd��YZdefd��YZdefd��YZdefd��YZddlmZdejfd��YZdejfd��YZdZied6Zd�Zedkr�e�ndS(i����N(ttest_supporttCcBseZd�ZRS(cCsdS(N((tself((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pytmethods(t__name__t
__module__R(((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyRstCallablecBseZdZd�ZRS(cCs
||_dS(N(tbar(Rtx((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyt__call__sN(RRtNoneRR	(((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyRscCs
d�}|S(NcSsdS(N((((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pytfs((R((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pytcreate_functions	cCs
t�jS(N(RR(((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pytcreate_bound_methodscCstjS(N(RR(((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pytcreate_unbound_method"stObjectcBs5eZd�Zd�Zd�Zd�Zd�ZRS(cCs
||_dS(N(targ(RR((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyt__init__'scCsd|jS(Ns<Object %r>(R(R((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyt__repr__)scCs#t|t�r|j|jkStS(N(t
isinstanceRRtNotImplemented(Rtother((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyt__eq__+scCs#t|t�r|j|jkStS(N(RRRR(RR((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyt__ne__/scCs
t|j�S(N(thashR(R((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyt__hash__3s(RRRRRRR(((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyR&s
				tRefCyclecBseZd�ZRS(cCs
||_dS(N(tcycle(R((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyR7s(RRR(((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyR6stTestBasecBseZd�Zd�ZRS(cCs
d|_dS(Ni(tcbcalled(R((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pytsetUp=scCs|jd7_dS(Ni(R(Rtref((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pytcallback@s(RRRR (((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyR;s	tReferencesTestCasecBsyeZd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z d�Z!d �Z"d!�Z#d"�Z$d#�Z%d$�Z&d%�Z'd&�Z(d'�Z)d(�Z*RS()cCsg|jt�|jt�|jt�|jt�t�}tj|�}t|�~t|�dS(N(tcheck_basic_refRRR
RtweakrefRtrepr(Rtotwr((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyttest_basic_refFs



	
cCs8|jt�|jt�|jt�|jt�dS(N(tcheck_basic_callbackRRR
R(R((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyttest_basic_callbackUs


cCsvt�}tj||j�}tj||j�}~|j|�d�|j|�d�|j|jdd�dS(Ns$expected reference to be invalidatedis-callback not called the right number of times(RR#RR tassertIsNonetassertEqualR(RR%tref1tref2((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyttest_multiple_callbacks[s	cCsC|d�}t�}tj||�|_tj||�}~dS(NcSs|j�dS(N(R(tobjectR((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyR ps(RR#R(RR tcR,((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyttest_multiple_selfref_callbackses
	cCs)t�}|jttj|dd�dS(NR (RtassertRaisest	TypeErrorR#RR
(RR0((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyttest_constructor_kwargsws	cCs�t�}d|_tj||j�}tj||j�}~d�}|jtj||�|jtj||�|jtjttjt���|j|j	d�dS(NicSs|jdS(N(R(tproxy((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pytcheck�si(
RRR#R5R R2tReferenceErrortboolR+R(RR%R,R-R6((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyttest_proxy_ref{s			"cCsK|�}tj|�}|j|�d�|�}|j||d�dS(Ns,weak reference to live object should be lives-<ref>() should return original object if live(R#RtassertIsNotNonetassertIs(RtfactoryR%Rto2((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyR"�s		cCsWd|_|�}tj||j�}~|j|jdd�|j|�d�dS(Niis(callback did not properly set 'cbcalled's3ref2 should be dead after deleting object reference(RR#RR R+R*(RR<R%R((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyR(�s		cCs�t�}tj|�}tj|�}tj|�}|j||d�t�}tj|�}tj|�}tj|�}|j||d�|jtj|�dd�~|jtj|�dd�dS(Ns1reference object w/out callback should be re-usediswrong weak ref count for objectis4wrong weak ref count for object after deleting proxy(RR#RR5R;R+tgetweakrefcount(RR%R,R5R-((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyttest_ref_reuse�s"		cCsMt�}tj|�}tj|�}tj|�}|j||d�dS(Ns4proxy object w/out callback should have been re-used(RR#R5RR;(RR%tproxy1Rtproxy2((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyttest_proxy_reuse�s	c
Cs�t�}|j|tj|��tj�}tj|�}|j|d�|jd�|jt|�d�|j	|d�t
j��ddg|(WdQX|jt|�d�|jt|�d�|jd|d�d|d<|j|dd�|j|dd�tj|�}tj|�}|j||�tjt
d	��}tj|�}t
j��e|j||�|j|d|d�|j|d |d �|j|dd!|dd!�WdQXdS(
Ns(proxy for empty UserList should be falseiis+proxy for non-empty UserList should be trueiis,proxy didn't support __contains__() properlyii
(Rtcheck_proxyR#R5tUserListtassertFalsetappendR+tlent
assertTrueRtcheck_py3k_warningstassertIntrange(RR%tLtptL2tp2tL3tp3((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyttest_basic_proxy�s4	



cCsadtfd��Y}|�}|jdttj|���|jttj|��d�dS(NRcBseZd�Zd�ZRS(cSsdS(Ntstring((R((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyt__str__�scSsdS(Nuunicode((R((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyt__unicode__�s(RRRTRU(((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyR�s	RUuunicode(R/RJtdirR#R5R+tunicode(RRtinstance((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyttest_proxy_unicode�s	cCsHddd��Y}|�}tj|�}|jtj|�d�dS(NRcBseZd�ZRS(cSsdS(Ni
((R((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyt	__index__�s(RRRZ(((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyR�si
((R#R5R+toperatortindex(RRR%RM((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyttest_proxy_index�s	cCs]ddd��Y}|�}tj|�}|j|dd�|d}|j|d�dS(NRcBseZd�Zd�ZRS(cSsdS(Ni*((RR((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyt__floordiv__�scSsdS(Ni((RR((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyt
__ifloordiv__�s(RRR^R_(((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyR�s	ii*i((R#R5R+(RRR%RM((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyttest_proxy_div�s	
cCs|jtj�dS(N(tcheck_shared_without_callbackR#R(R((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyt test_shared_ref_without_callbackscCs|jtj�dS(N(RaR#R5(R((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyt"test_shared_proxy_without_callbackscCs�td�}||d�}||d�}|j||d�~~||�}||d�}|j||d�~~||�}||�}|j||d�~~||d�}||�}|j||d�dS(Nis%both callbacks were None in the C APIs&callbacks were NULL, None in the C APIs%both callbacks were NULL in the C APIs&callbacks were None, NULL in the C API(RR
R;(RtmakerefR%tp1RO((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyRas cCs�t�}tj|�}|j||�|jt|�tjd�|d�|j|jdd�|dd�|j|jdd�|j	t
|�|j	t
|ddd�dS(	Nsproxy is not of callable types	twinkies!s1call through proxy not passed through to originalRsSplat.iii(RR#R5RCR;ttypetCallableProxyTypeR+RR2R3(RR%R,((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyttest_callable_proxys	

cCs�d|_|j|jdd�d|_|j|jdd�|`|jt|d�d�d|_|j|jdd�d|_|j|jdd�|`|jt|d�d	�dS(
Nis)proxy does not reflect attribute additionis-proxy does not reflect attribute modificationtfoos(proxy does not reflect attribute removals4object does not reflect attribute addition via proxys8object does not reflect attribute modification via proxys3object does not reflect attribute removal via proxy(RiR+REthasattr(RR%R5((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyRC-s$				cCsIddd��Y}|�}tj|�}|d=|j|jd�dS(NtFoocBseZdZd�ZRS(cSs
||_dS(N(tresult(Rtaccessor((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyt__delitem__FsN(RRR
RlRn(((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyRkDsi((R#R5R+Rl(RRktgR((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyttest_proxy_deletionBs
	cCsHdtfd��Y}|�}|jttj|��t|��dS(NtListcBseZRS((RR(((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyRqOs(tlistR+R8R#R5(RRqtlyst((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyttest_proxy_boolMs	cCs�t�}tj|�}tj||j�}|jtj|�dd�tj|�}tj||j�}|jtj|�dd�~~~~|jtj|�dd�|jtjd�dd�dS(Nis*got wrong number of weak reference objectsiisAweak reference objects not unlinked from referent when discarded.is2got wrong number of weak reference objects for int(RR#RR R+R>R5(RR%R,R-R@RA((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyttest_getweakrefcountSs	cCs�t�}tj||j�}tj||j�}~|jtj|�|gd�t�}tj||j�}tj||j�}~|jtj|�|gd�~|jtj|�gd�|jtjd�gd�dS(Nslist of refs does not matchslist of refs not clearedis#list of refs does not match for int(RR#RR R+tgetweakrefs(RR%R,R-((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyttest_getweakrefshs"		cCs]dtfd��Y}|d�}tj|�}|j|dd�|jd|d�dS(NtFcBseZRS((RR(((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyRx�sg@g�?g@(tfloatR#R5R+(RRxRRM((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyttest_newstyle_number_opss
cs�dtfd��Y�i��fd�����fd�}y|�Wn�k
r^nX|jd�y|�Wn�k
r�nX|jd�dS(Nt
BogusErrorcBseZRS((RR(((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyR{�scs�|=dS(N((tk(tdata(sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pytremove�scs)d�}d�tj|��<��dS(NcSsdS(N(((((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyt<lambda>�s(R
R#R(R(R{R}R~(sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pytencapsulate�s	sexception not properly restored(t	Exceptiontfail(RR�((R{R}R~sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyttest_callbacks_protected�s


cs�ddl�dtfd��Y}|�}tj|�fd��}~~|�}|�|_tj|j�fd��}|�}||_~~dS(Ni����RcBseZRS((RR(((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyR�scs
�j�S(N(tcollect(tignore(tgc(sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyR�scs
�j�S(N(R�(R�(R�(sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyR�s(R�R/R#Rtitc1(RRR0R&R�tc2((R�sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyttest_sf_bug_840829�s					cCsyddl}dtfd��Y}dtfd��Y}|�}||_tj||j�|_~~~|j�dS(Ni����tJcBseZRS((RR(((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyR��stIIcBseZd�ZRS(cSs|jdS(N(R�(RR�((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyt	acallback�s(RRR�(((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyR��s(R�R/R�R#RR�R&R�(RR�R�R�tI((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyttest_callback_in_cycle_1�s			cCsvddl}dtfd��Y}ddd��Y}|�}||_tj||j�|_~~~|j�dS(Ni����R�cBseZRS((RR(((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyR��sR�cBseZd�ZRS(cSs|jdS(N(R�(RR�((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyR�s(RRR�(((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyR�s((R�R/R�R#RR�R&R�(RR�R�R�R�((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyttest_callback_in_cycle_2�s			cCspddl}ddd��Y}|�|�}}||_||_tj||j�|_~~|j�dS(Ni����RcBseZd�ZRS(cSs|j|j|jdS(N(tmeR�R&(RR�((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pytcbs(RRR�(((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyRs((R�R�R�R#RR�R&R�(RR�RR�R�((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyttest_callback_in_cycle_3
s		cCs�ddl}dtfd��Y}ddd��Y}|�|�}}||_||_tj||j�|_~~~~|j�dS(Ni����RcBseZd�ZRS(cSs|j|j|jdS(N(R�R�R&(RR�((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyR�0s(RRR�(((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyR/stDcBseZRS((RR(((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyR�5s((	R�R/R�R�R#RR�R&R�(RR�RR�R�R�((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyttest_callback_in_cycle_4%s			csddl}g�dtf�fd��Y}|d�|d�}}||_||_tj||j�|_tj||j�|_�fd�}tj||�}~~~|j�g�|j�|j�dg�|j|�d��2|j�|j�g�dS(Ni����Rcs eZd�Z�fd�ZRS(cSs
||_dS(N(t	attribute(Rtvalue((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyROscs�j|j�dS(N(RFR0(RR�(talist(sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyR�Rs(RRRR�((R�(sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyRNs	iics�jd�dS(NsC went away(RF(R�(R�(sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pytC_went_away[ssC went away(
R�R/R0R#RR�R&R+R�R
(RR�RR�R�R�R&((R�sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyt#test_callback_in_cycle_resurrectionAs$			

cs+ddl}g��fd�}dtf�fd��Y}|�|�}}||_||_|j}tj||�|_tj||j�|_tj||�}|j|�|�~~~~|j�g�|j	�|j�dg�|j|�d��2|j	�|j�g�dS(Ni����cs�jd�dS(Nssafe_callback called(RF(R�(R�(sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyt
safe_callbacktsRcseZ�fd�ZRS(cs�jd�dS(Ns	cb called(RF(RR�(R�(sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyR�xs(RRR�((R�(sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyRwsssafe_callback called(R�R/RR�R#RR&R;R+R�R
(RR�R�RR0tdR texternal_wr((R�sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyttest_callbacks_on_callbackos(				

cCs|jtj�dS(N(tcheck_gc_during_creationR#R(R((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyttest_gc_during_ref_creation�scCs|jtj�dS(N(R�R#R5(R((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyttest_gc_during_proxy_creation�scCs�tj�}tjddd�tj�ddd��Y}d�}|�}|�}||_||�|_z|�}tj||�Wdtj|�XdS(NitAcBseZRS((RR(((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyR��scWsdS(N((targs((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyR �s((R�t
get_thresholdt
set_thresholdR�taR&R#R(RRdt
thresholdsR�R t
referencedR�((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyR��s
					cCs#dtfd��Y}|�}dS(NtTargetcBseZd�ZRS(cSstj|�adS(N(R#Rtref_from_del(R((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyt__del__�s(RRR�(((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyR��s(R/(RR�tw((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyttest_ref_created_during_del�scCs?tjt�}|jt|jddddd�tj�dS(Ni(R#RR�R2R3RR�R�(Rtr((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyt	test_init�s"cCs�dtfd��Y}ddd��Y}g}tjt�tj||j�}d}tj�|j|�d�|j||g�tj||j�}d}tj�|j|�d�|j|||g�dS(NR�cBseZRS((RR(((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyR��stBcBseZRS((RR(((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyR��s((	R/R#RtintRFR
R�R�R+(RR�R�tlR�tb((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyttest_classes�s


c	Cs�td�}td�}td�}tj|�}tj|�}tj|�}tj|�}|j||k�|j||k�|j||k�|j||k�|j||k�|j||k�~~~tj�x*|||fD]}|j|�d�q�W|j||k�|j||k�|j||k�|j||k�|j	||k||k�|j	||k||k	�dS(Nii(
RR#RRHRER�R�R;R
R+(	RRtytzR�R�R0R�R�((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyt
test_equality�s.	
cCs�td�}td�}tj|�}tj|�}|jt|�td��~~tj�|jt|�td��|jtt|�dS(Ni*(	RR#RR+RR�R�R2R3(RRR�R�R�((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyttest_hashing�s
cCsndtfd��Y}tj�}|d�}}x(td�D]}||�||<}q?W~tj�dS(NRcBseZd�ZRS(csA|s
dStj|���fd�}tj||�|_dS(Ncs
��}dS(N((twparentR%(twself(sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyR�s(R#RR�(RtparentR�((R�sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyRs
(RRR(((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyRsid(R/R#tWeakKeyDictionaryR
RKR�R�(RRR�trootR0tn((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyttest_trashcan_16602s	(+RRR'R)R.R1R4R9R"R(R?RBRRRYR]R`RbRcRaRhRCRpRtRuRwRzR�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�(((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyR!DsR			
						
																		(	(				.	&							!	tSubclassableWeakrefTestCasecBs5eZd�Zd�Zd�Zd�Zd�ZRS(cs�dtjf�fd��Y�td�}�|dd�}|j|�|�|j|j�|j|jd�~|j|��|j|j�dS(NtMyRefcs,eZdd�fd�Z�fd�ZRS(i*cs&||_t�|�j||�dS(N(R�tsuperR(RtobR R�(R�(sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyR&s	cst|_t�|�j�S(N(tTruetcalledR�R	(R(R�(sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyR	)s	N(RRR
RR	((R�(sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyR�%sRiR�i(	R#RRR;RHR�R+R�R*(RR%tmr((R�sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyttest_subclass_refs$scCsdtjfd��Y}td�}||�}tj|�}|j||�|jtj|�||g�|jtj|�d�||�}|jtj|�d�tj|�}|jt|�d�|j||d�|j	||d�|j	||d�dS(NR�cBseZRS((RR(((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyR�6si*iiii(
R#RRtassertIsNotR+RvR>RGR;RJ(RR�R%tr1tr2tr3trefs((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyt-test_subclass_refs_dont_replace_standard_refs5scCs�dtjfd��Y}td�}||t�}||t�}|j||�tj|�}|j||�|j||�dS(NR�cBseZRS((RR(((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyR�Gsi*(R#RRtidtstrR�RvRJ(RR�R%R�R�R�((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyt*test_subclass_refs_dont_conflate_callbacksFscCs�dtjfd��Y}td�}||ddd�}|j|jd�|j|jd�|j|j�d�|jt	|d��dS(NR�cBs)eZdZd�Zd�Zd�ZRS(tslot1tslot2cSstjj|||�S(N(R#Rt__new__(RfR�R R�R�((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyR�TscSs||_||_dS(N(R�R�(RR�R R�R�((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyRVs	cSs|j|jS(N(R�R�(R((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pytmethYs(sslot1sslot2(RRt	__slots__R�RR�(((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyR�Rs		i*tabctdeftabcdeft__dict__(
R#RRR
R+R�R�R�RERj(RR�R%R�((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyttest_subclass_refs_with_slotsQs	cs�dtjfd��Y}�fd�}t�}|||�}||_~~�j�jd�t�}|||�}|||�}||_||_~~~�j�jd�dS(NR�cBseZRS((RR(((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyR�iscs�jd7_dS(Ni(R(R�(R(sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyR nsi(R#RRR%R+RR�(RR�R R%R�R�((Rsj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyttest_subclass_refs_with_cyclebs"					(RRR�R�R�R�R�(((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyR�"s
				tMappingTestCasecBs7eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z d�Z!d �Z"d!�Z#RS("i
c
s�d}gt|�D]}t�^q}|�fd�t|�D��}|j�}yt|�Wntk
rwnX~tj�t|�}t	|�~tj�t|�}	|j
|d�|j
|	d�dS(Nic3s$|]\}}�||�VqdS(N((t.0R�R%(tcons(sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pys	<genexpr>�si(RKRt	enumeratet	iteritemstnextt
StopIterationR�R�RGRrR+(
Rt	dict_typeR�tNR�titemstdcttittn1tn2((R�sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pytcheck_len_cycles�s"""



cCs|jtjd��dS(NcSs
||fS(N((R�R|((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyR�s(R�R#R�(R((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyttest_weak_keyed_len_cycles�scCs|jtjd��dS(NcSs
||fS(N((R�R|((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyR�s(R�R#tWeakValueDictionary(R((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyttest_weak_valued_len_cycles�scs'|jtjtj��xtdd�D]�}d}tjd�tj|||�gt|�D]}t�^qb}|�fd�|D��}~|j�}yt|�Wnt	k
r�nXt
|�}	~t
|�}
|j|	d�|j|	|�|j|
d�|j|
|	�q)WdS(Niidiic3s|]}�|�VqdS(N((R�R%(R�(sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pys	<genexpr>�s(
t
addCleanupR�R�R�RKR�RR�R�R�RGtassertGreaterEqualtassertLessEqual(RR�R�tthR�R�R�R�R�R�R�((R�sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pytcheck_len_race�s(
"
cCs|jtjd��dS(NcSs
|dfS(Ni((R|((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyR�s(R�R#R�(R((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyttest_weak_keyed_len_race�scCs|jtjd��dS(NcSs
d|fS(Ni((R|((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyR�s(R�R#R�(R((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyttest_weak_valued_len_race�scCsP|j�\}}xH|D]@}|jtj|�dd|�|j|||jd�qW|j�}|j�j�}|j�|j�|j||d�~~|jt	|�|j
�|d=|jt	|�|j
dd�~~|jt	|�dd�tj�}|jt
|jd�t�|d<|jt
|jd�dS(	Nis&wrong number of weak references to %r!s#wrong object returned by weak dict!s/cloning of weak-valued dictionary did not work!is/deleting object did not cause dictionary updates0deleting the values did not clear the dictionaryi(tmake_weak_valued_dictR+R#R>R;RR�tcopytsortRGtCOUNTR�R2tKeyErrort__getitem__R(RtdicttobjectsR%titems1titems2((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyttest_weak_values�s0



cCs9|j�\}}xH|D]@}|jtj|�dd|�|j|j||d�qW|j�}|j�j�}|jt|�t|�d�~~|jt	|�|j
�|d=|jt	|�|j
dd�~~|jt	|�dd�td�}d	||<|j||�|j
d
|�dS(Nis&wrong number of weak references to %r!s#wrong object returned by weak dict!s.cloning of weak-keyed dictionary did not work!is/deleting object did not cause dictionary updates.deleting the keys did not clear the dictionaryi*s$What is the meaning of the universe?i"(tmake_weak_keyed_dictR+R#R>R;RR�R�tsetRGR�RRJtassertNotIn(RR�R�R%R�R�((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyttest_weak_keys�s,

cCsY|j�\}}|j|�|j�}|jt|�t|��t|�}xK|D]C}|�}|j||�|j|j||�|j|�qZW|jt|�d�t|�}|jtt|j	���t|��xQ|j	�D]C}|�}|j||�|j|j||�|j|�q�W|jt|�d�dS(Ni(
Rtcheck_iterstkeyrefsR+RGRrRJRR~titerkeyrefs(RR�R�R�tobjects2R&R�((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyttest_weak_keyed_iterss&

	(	cCss|j�\}}|j|�|j�}|jt|�t|��t|�}xX|D]P}|�}|j|||j�|j|j||jj�|j|�qZW|jt|�d�t|�}|jtt|j���t|��x^|j�D]P}|�}|j|||j�|j|j||jj�|j|�qW|jt|�d�dS(Ni(	R�Rt	valuerefsR+RGRrRR~t
itervaluerefs(RR�R�R�RR&R�((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyttest_weak_valued_iterss&

	(	cCs"|j�}x!|j�D]}|j|�qW|jt|�dd�|j�}x|D]}|j|�q\W|jt|�dd�|j�}x!|j�D]}|j|�q�W|jt|�dd�|j�}x!|j�D]}|j|�q�W|jt|�dd�dS(Nis#iteritems() did not touch all itemss!__iter__() did not touch all keyss!iterkeys() did not touch all keyss%itervalues() did not touch all values(	R�R�R~R+RGtkeystiterkeystvaluest
itervalues(RR�R�titemRR|Rtv((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyR6s"
cCs�t|�}tt||���}t|�|d=tj�|jtt|��t|�t|�dg�~|jt|�|d�dS(Ni����i(	RGtitertgetattrR�R�R�RJRrR+(RR�R�t	iter_nameR�R�((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyt"check_weak_destroy_while_iteratingPs

2cCsc|�� \}}|j||k�WdQX|��#\}}|jt|j|�WdQX|j||k�|��#\}}|jt|j|�WdQX|j||k�|��\}}|||<WdQX|j|||�tj|�}|��\}}|j|�WdQX|j||�|��\}}|j�WdQX|jt	|�d�dS(Ni(
RER2R�RntpopR+R�tupdatetclearRG(RR�ttestcontextR|Rtddict((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyt-check_weak_destroy_and_mutate_while_iterating]s$cs�|j�\��|j��d�|j��d�|j��d�|j��d�|j�\��tj��fd��}|j�|�dS(NR
R�RRc3sbzJt�j��}t|��j�j}tj�t|�|fVWdd}tj�XdS(N(	RR�R�RRR�R�RR
(R�R(R�R�(sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyR~s

(RRt
contextlibtcontextmanagerR(RR((R�R�sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyt&test_weak_keys_destroy_while_iteratingvscs�|j�\��|j��d�|j��d�|j��d�|j��d�|j�\��tj��fd��}|j�|�dS(NR
R�RR
c3sbzJt�j��}t|��j�j}tj�|t|�fVWdd}tj�XdS(N(	RR�R�RRR�R�RR
(R�R|(R�R�(sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyR�s

(R�RRRR(RR((R�R�sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyt(test_weak_values_destroy_while_iterating�scCs:td�}tjid|6�}|j||d�dS(Niil(RR#R�R+(RR%R�((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyt#test_make_weak_keyed_dict_from_dict�scCsItd�}tjid|6�}tj|�}|j||d�dS(Niil(RR#R�R+(RR%R�tdict2((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyt.test_make_weak_keyed_dict_from_weak_keyed_dict�scCsLtj�}ttt|j��}x|D]}|j||<q+W||fS(N(R#R�tmapRRKR�R(RR�R�R%((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyR�s

cCs�|jttjj�|jttjii�|jttjdd�td�}xWdD]O}tji||6�}|jt|j��|g�|j|||�q[WdS(NiRRtiterable(((sselfsothersiterable(	R2R3R#R�RRR+RrR(RR%tkwR�((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyttest_make_weak_valued_dict_misc�s
cCsLtj�}ttt|j��}x|D]}|||j<q+W||fS(N(R#R�R#RRKR�R(RR�R�R%((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyR��s

c	Cs�|�}|||<|||<|jt|�d�|j�\}}|jt|�d�||krz|j||�n|j||�|j�\}}|jt|�d�||kr�|j||�n|j||�dS(Niii(R+RGtpopitemR;(	Rtklasstkey1tvalue1tkey2tvalue2tweakdictR|R((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyt
check_popitem�s	

cCs&|jtjdt�dt��dS(NR)R+(R.R#R�R(R((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyttest_weak_valued_dict_popitem�scCs&|jtjt�dt�d�dS(Nsvalue 1svalue 2(R.R#R�R(R((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyttest_weak_keyed_dict_popitem�scCs�|j||d�|�}|j||�}|j||�|j||�|j|j|�|�|j|||�|j||�}|j||�|j||�|j|j|�|�|j|||�dS(Ns9invalid test -- value parameters must be distinct objects(R�t
setdefaultR;RJtget(RR(tkeyR*R,R-R%((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pytcheck_setdefault�s	cCs#|jtjdt�t��dS(NR3(R4R#R�R(R((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyt test_weak_valued_dict_setdefault�scCs |jtjt�dd�dS(Nsvalue 1svalue 2(R4R#R�R(R((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyttest_weak_keyed_dict_setdefault�scCs�|�}|j|�|jt|�t|��xc|j�D]U}|j||d�|j|�}|j|||�|j||j|��q?Wx^|j�D]P}|j||d�||}|j|||�|j||j|��q�WdS(Ns(mysterious new key appeared in weak dicts%original key disappeared in weak dict(RR+RGRRJR2R;(RR(R�R-R|R((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pytcheck_update�s	

cCs|jtjit�d6t�d6t�t�6�|jttjj�tj�}|jt|jii�|jt|jdd	�|jt|j	��g�t
d�}xad
D]Y}tj�}|ji||6�|jt|j	��|g�|j|||�q�WdS(NiR�iRR�RR$(((sselfsdictsothersiterable(R7R#R�RR2R3RR+RrRR(RR�R%R%((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyttest_weak_valued_dict_updates(
cCs5|jtjidt�6dt�6dt�6�dS(Niii(R7R#R�R(R((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyttest_weak_keyed_dict_update scCs�tj�}td�}td�}d||<d||<|jt|�d�||=|jt|�d�|j|j�|g�dS(Nt1t2t	somethingii(R#R�RR+RGR(RR�to1R=((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyttest_weak_keyed_delitem$s

cCs�tj�}td�}td�}||d<||d<|jt|�d�|d=|jt|�d�|j|j�d|fg�dS(NR:R;R<ssomething elseii(R#R�RR+RGR�(RR�R=R=((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyttest_weak_valued_delitem/s

cCs�tj�}td�}|jt|j|�|jt|j|�|jt|jd�|jt|jd�|jt|jdd�dS(NR:i
(	R#R�RR2R�RnR�R3t__setitem__(RR�R%((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyttest_weak_keyed_bad_delitem:scs�tj�}t�dtf��fd��Y}gtd�D]}||�^q>�x�D]}|j||<q]W~|j���j�t�d}x�D]}|d7}||=q�W|j	t
|�d�|j	|d�dS(NRcs,eZd�Zd�Z��fd�ZRS(cSs
||_dS(N(R�(RR�((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyRQscSs
t|j�S(N(RR�(R((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyRSscs �r�d=n|j|jkS(Ni����(R�(RR(tmutatetobjs(sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyRUs
(RRRRR((RBRC(sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyRPs		iiii(R#R�tFalseR/RKR�RtreverseR�R+RG(RR�RR�R%tcount((RBRCsj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyt!test_weak_keyed_cascading_deletesHs %

	

($RRR�R�R�R�R�R�R�R�RRRRRRRRR R"RR&R�R.R/R0R4R5R6R7R8R9R>R?RARG(((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyR��sD												
																				(t
mapping_teststWeakValueDictionaryTestCasecBsMeZdZied�d6ed�d6ed�d6ZejZd�ZRS(s?Check that WeakValueDictionary conforms to the mapping protocoliR)iR+itkey3cCs
|jj�S(N(t!_WeakValueDictionaryTestCase__refR�(R((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyt
_reference{s(	RRt__doc__RRKR#R�t	type2testRL(((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyRIws-	tWeakKeyDictionaryTestCasecBsMeZdZided�6ded�6ded�6ZejZd�ZRS(s=Check that WeakKeyDictionary conforms to the mapping protocoliR)iR+iRJcCs
|jj�S(N(t_WeakKeyDictionaryTestCase__refR�(R((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyRL�s(	RRRMRRPR#R�RNRL(((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyRO~s-	s� Doctest for examples in the library reference: weakref.rst

>>> import weakref
>>> class Dict(dict):
...     pass
...
>>> obj = Dict(red=1, green=2, blue=3)   # this object is weak referencable
>>> r = weakref.ref(obj)
>>> print r() is obj
True

>>> import weakref
>>> class Object:
...     pass
...
>>> o = Object()
>>> r = weakref.ref(o)
>>> o2 = r()
>>> o is o2
True
>>> del o, o2
>>> print r()
None

>>> import weakref
>>> class ExtendedRef(weakref.ref):
...     def __init__(self, ob, callback=None, **annotations):
...         super(ExtendedRef, self).__init__(ob, callback)
...         self.__counter = 0
...         for k, v in annotations.iteritems():
...             setattr(self, k, v)
...     def __call__(self):
...         '''Return a pair containing the referent and the number of
...         times the reference has been called.
...         '''
...         ob = super(ExtendedRef, self).__call__()
...         if ob is not None:
...             self.__counter += 1
...             ob = (ob, self.__counter)
...         return ob
...
>>> class A:   # not in docs from here, just testing the ExtendedRef
...     pass
...
>>> a = A()
>>> r = ExtendedRef(a, foo=1, bar="baz")
>>> r.foo
1
>>> r.bar
'baz'
>>> r()[1]
1
>>> r()[1]
2
>>> r()[0] is a
True


>>> import weakref
>>> _id2obj_dict = weakref.WeakValueDictionary()
>>> def remember(obj):
...     oid = id(obj)
...     _id2obj_dict[oid] = obj
...     return oid
...
>>> def id2obj(oid):
...     return _id2obj_dict[oid]
...
>>> a = A()             # from here, just testing
>>> a_id = remember(a)
>>> id2obj(a_id) is a
True
>>> del a
>>> try:
...     id2obj(a_id)
... except KeyError:
...     print 'OK'
... else:
...     print 'WeakValueDictionary error'
OK

t
libreftestcCs1tjttttt�tjtj	t
�dS(N(Rtrun_unittestR!R�RIROR�trun_doctesttsystmodulesR(((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyt	test_main�st__main__( R�RTtunittestRDR#R[RR�ttestRR
R�RRRR
RRRtTestCaseRR!R�R�RHtBasicTestMappingProtocolRIRORQt__test__RVR(((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_weakref.pyt<module>s>				���g��X