config root man

Current Path : /compat/linux/proc/self/root/usr/local/lib/python2.5/test/

FreeBSD hs32.drive.ne.jp 9.1-RELEASE FreeBSD 9.1-RELEASE #1: Wed Jan 14 12:18:08 JST 2015 root@hs32.drive.ne.jp:/sys/amd64/compile/hs32 amd64
Upload File :
Current File : //compat/linux/proc/self/root/usr/local/lib/python2.5/test/test_weakref.pyc

³ò
h”Rc@s}ddkZddkZddkZddkZddkZddklZeadfd„ƒYZ	dfd„ƒYZ
d„Zd„Zd	„Z
d
eifd„ƒYZdefd
„ƒYZdefd„ƒYZdfd„ƒYZdefd„ƒYZddklZdeifd„ƒYZdeifd„ƒYZdZhed<Zd„ZedjoeƒndS(iÿÿÿÿN(ttest_supporttCcBseZd„ZRS(cCsdS(N((tself((s-/usr/local/lib/python2.5/test/test_weakref.pytmethod
s(t__name__t
__module__R(((s-/usr/local/lib/python2.5/test/test_weakref.pyRstCallablecBseZdZd„ZRS(cCs
||_dS(N(tbar(Rtx((s-/usr/local/lib/python2.5/test/test_weakref.pyt__call__sN(RRtNoneRR	(((s-/usr/local/lib/python2.5/test/test_weakref.pyRscCs
d„}|S(NcSsdS(N((((s-/usr/local/lib/python2.5/test/test_weakref.pytfs((R((s-/usr/local/lib/python2.5/test/test_weakref.pytcreate_functions	cCs
tƒiS(N(RR(((s-/usr/local/lib/python2.5/test/test_weakref.pytcreate_bound_methodscCstiS(N(RR(((s-/usr/local/lib/python2.5/test/test_weakref.pytcreate_unbound_methodstTestBasecBseZd„Zd„ZRS(cCs
d|_dS(Ni(tcbcalled(R((s-/usr/local/lib/python2.5/test/test_weakref.pytsetUp%scCs|id7_dS(Ni(R(Rtref((s-/usr/local/lib/python2.5/test/test_weakref.pytcallback(s(RRRR(((s-/usr/local/lib/python2.5/test/test_weakref.pyR#s	tReferencesTestCasecBs(eZd„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!RS( cCs]|itƒ|itƒ|itƒ|itƒtƒ}ti|ƒ}|
~|
dS(N(tcheck_basic_refRRR
RtweakrefR(Rtotwr((s-/usr/local/lib/python2.5/test/test_weakref.pyttest_basic_ref.s



	cCs8|itƒ|itƒ|itƒ|itƒdS(N(tcheck_basic_callbackRRR
R(R((s-/usr/local/lib/python2.5/test/test_weakref.pyttest_basic_callback=s


cCs…tƒ}ti||iƒ}ti||iƒ}~|i|ƒdjdƒ|i|ƒdjdƒ|i|idjdƒdS(Ns$expected reference to be invalidatedis-callback not called the right number of times(RRRRtassert_R
R(RRtref1tref2((s-/usr/local/lib/python2.5/test/test_weakref.pyttest_multiple_callbacksCs	cCsC|d„}tƒ}ti||ƒ|_ti||ƒ}~dS(NcSs|iƒdS(N(R(tobjectR((s-/usr/local/lib/python2.5/test/test_weakref.pyRZs(RRR(RRtcR((s-/usr/local/lib/python2.5/test/test_weakref.pyttest_multiple_selfref_callbacksOs
	cCs°tƒ}d|_ti||iƒ}ti||iƒ}~d„}|iti||ƒ|iti||ƒ|itittitƒƒƒ|i|i	djƒdS(NicSs|idS(N(R(tproxy((s-/usr/local/lib/python2.5/test/test_weakref.pytcheckhsi(
RRRR#RtassertRaisestReferenceErrortboolRR(RRRRR$((s-/usr/local/lib/python2.5/test/test_weakref.pyttest_proxy_refas			"cCsT|ƒ}ti|ƒ}|i|ƒdj	dƒ|ƒ}|i||jdƒdS(Ns,weak reference to live object should be lives-<ref>() should return original object if live(RRRR
(RtfactoryRRto2((s-/usr/local/lib/python2.5/test/test_weakref.pyRps		cCs`d|_|ƒ}ti||iƒ}~|i|idjdƒ|i|ƒdjdƒdS(Niis(callback did not properly set 'cbcalled's3ref2 should be dead after deleting object reference(RRRRRR
(RR)RR((s-/usr/local/lib/python2.5/test/test_weakref.pyRys		cCsÝtƒ}ti|ƒ}ti|ƒ}ti|ƒ}|i||jdƒtƒ}ti|ƒ}ti|ƒ}ti|ƒ}|i||jdƒ|iti|ƒdjdƒ~|iti|ƒdjdƒdS(Ns1reference object w/out callback should be re-usediswrong weak ref count for objectis4wrong weak ref count for object after deleting proxy(RRRR#Rtgetweakrefcount(RRRR#R((s-/usr/local/lib/python2.5/test/test_weakref.pyttest_ref_reuseƒs"		cCsPtƒ}ti|ƒ}ti|ƒ}ti|ƒ}|i||jdƒdS(Ns4proxy object w/out callback should have been re-used(RRR#RR(RRtproxy1Rtproxy2((s-/usr/local/lib/python2.5/test/test_weakref.pyttest_proxy_reuse™s	cCs·tƒ}|i|ti|ƒƒtiƒ}ti|ƒ}|i|dƒ|idƒ|it|ƒdƒ|i	|dƒddg|(|it|ƒdƒ|it|ƒdƒ|i	d|jdƒd|d<|i|ddƒ|i|ddƒti|ƒ}ti|ƒ}|i||ƒtit
d	ƒƒ}ti|ƒ}|i||ƒ|i|d|dƒ|i|d |d ƒ|i|dd!|dd!ƒdS(
Ns(proxy for empty UserList should be falseiis+proxy for non-empty UserList should be trueiis,proxy didn't support __contains__() properlyii
(Rtcheck_proxyRR#tUserListtfailIftappendtassertEqualtlent
failUnlesstrange(RRtLtptL2tp2tL3tp3((s-/usr/local/lib/python2.5/test/test_weakref.pyttest_basic_proxy¡s2	


cCs|itiƒdS(N(tcheck_shared_without_callbackRR(R((s-/usr/local/lib/python2.5/test/test_weakref.pyt test_shared_ref_without_callbackÆscCs|itiƒdS(N(R?RR#(R((s-/usr/local/lib/python2.5/test/test_weakref.pyt"test_shared_proxy_without_callbackÉscCsætdƒ}||dƒ}||dƒ}|i||jdƒ~~||ƒ}||dƒ}|i||jdƒ~~||ƒ}||ƒ}|i||jdƒ~~||dƒ}||ƒ}|i||jdƒ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(tObjectR
R(RtmakerefRtp1R;((s-/usr/local/lib/python2.5/test/test_weakref.pyR?Ìs cCs½tƒ}ti|ƒ}|i||ƒ|it|ƒtijdƒ|dƒ|i|idjdƒ|ddƒ|i|idjdƒ|it	|ƒ|it	|dddƒdS(	Nsproxy is not of callable types	twinkies!s1call through proxy not passed through to originalRsSplat.iii(
RRR#R0RttypetCallableProxyTypeRR%t	TypeError(RRR((s-/usr/local/lib/python2.5/test/test_weakref.pyttest_callable_proxyÞs	

cCsÌd|_|i|idjdƒd|_|i|idjdƒ|`|it|dƒdƒd|_|i|idjdƒd|_|i|idjdƒ|`|it|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(RIRthasattr(RRR#((s-/usr/local/lib/python2.5/test/test_weakref.pyR0ós&				cCsIddd„ƒY}|ƒ}ti|ƒ}|d=|i|idƒdS(NtFoocBseZdZd„ZRS(cSs
||_dS(N(tresult(Rtaccessor((s-/usr/local/lib/python2.5/test/test_weakref.pyt__delitem__
sN(RRR
RLRN(((s-/usr/local/lib/python2.5/test/test_weakref.pyRKsi((RR#R4RL(RRKtgR((s-/usr/local/lib/python2.5/test/test_weakref.pyttest_proxy_deletion	s
	cCsHdtfd„ƒY}|ƒ}|itti|ƒƒt|ƒƒdS(NtListcBseZRS((RR(((s-/usr/local/lib/python2.5/test/test_weakref.pyRQs(tlistR4R'RR#(RRQtlyst((s-/usr/local/lib/python2.5/test/test_weakref.pyttest_proxy_bools	cCsÝtƒ}ti|ƒ}ti||iƒ}|iti|ƒdjdƒti|ƒ}ti||iƒ}|iti|ƒdjdƒ~~~~|iti|ƒdjdƒ|itidƒdjdƒ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(RRRRRR+R#(RRRRR-R.((s-/usr/local/lib/python2.5/test/test_weakref.pyttest_getweakrefcounts	cCsõtƒ}ti||iƒ}ti||iƒ}~|iti|ƒ|gjdƒtƒ}ti||iƒ}ti||iƒ}~|iti|ƒ|gjdƒ~|iti|ƒgjdƒ|itidƒgjdƒdS(Nslist of refs does not matchslist of refs not clearedis#list of refs does not match for int(RRRRRtgetweakrefs(RRRR((s-/usr/local/lib/python2.5/test/test_weakref.pyttest_getweakrefs/s"		cCscdtfd„ƒY}|dƒ}ti|ƒ}|i|ddjƒ|id|djƒdS(NtFcBseZRS((RR(((s-/usr/local/lib/python2.5/test/test_weakref.pyRXGsg@gð?g@(tfloatRR#R(RRXRR9((s-/usr/local/lib/python2.5/test/test_weakref.pyttest_newstyle_number_opsFs
c
s dtfd„ƒY‰h‰‡fd†‰‡‡‡fd†}y|ƒWnˆj
onX|idƒy|ƒWnˆj
onX|idƒdS(Nt
BogusErrorcBseZRS((RR(((s-/usr/local/lib/python2.5/test/test_weakref.pyR[Qscsˆ|=dS(N((tk(tdata(s-/usr/local/lib/python2.5/test/test_weakref.pytremoveTscs)d„}dˆti|ˆƒ<ˆ‚dS(NcSsdS((((((s-/usr/local/lib/python2.5/test/test_weakref.pyt<lambda>Ws(R
RR(R(R[R^R](s-/usr/local/lib/python2.5/test/test_weakref.pytencapsulateVs	sexception not properly restored(t	Exceptiontfail(RR`((R[R]R^s-/usr/local/lib/python2.5/test/test_weakref.pyttest_callbacks_protectedNs
cs›ddk‰dtfd„ƒY}|ƒ}ti|‡fd†ƒ}~~|ƒ}|ƒ|_ti|i‡fd†ƒ}|ƒ}||_~~dS(NiÿÿÿÿRcBseZRS((RR(((s-/usr/local/lib/python2.5/test/test_weakref.pyRtscs
ˆiƒS((tcollect(tignore(tgc(s-/usr/local/lib/python2.5/test/test_weakref.pyR_xscs
ˆiƒS((Rd(Re(Rf(s-/usr/local/lib/python2.5/test/test_weakref.pyR_€s(RfR RRtitc1(RRR!RRhtc2((Rfs-/usr/local/lib/python2.5/test/test_weakref.pyttest_sf_bug_840829gs					cCsyddk}dtfd„ƒY}dtfd„ƒY}|ƒ}||_ti||iƒ|_~~~|iƒdS(NiÿÿÿÿtJcBseZRS((RR(((s-/usr/local/lib/python2.5/test/test_weakref.pyRk’stIIcBseZd„ZRS(cSs|idS(N(Rk(RRe((s-/usr/local/lib/python2.5/test/test_weakref.pyt	acallback–s(RRRm(((s-/usr/local/lib/python2.5/test/test_weakref.pyRl•s(RfR RkRRRmRRd(RRfRkRltI((s-/usr/local/lib/python2.5/test/test_weakref.pyttest_callback_in_cycle_1s			cCsvddk}dtfd„ƒY}ddd„ƒY}|ƒ}||_ti||iƒ|_~~~|iƒdS(NiÿÿÿÿRkcBseZRS((RR(((s-/usr/local/lib/python2.5/test/test_weakref.pyRkÆsRlcBseZd„ZRS(cSs|idS(N(Rk(RRe((s-/usr/local/lib/python2.5/test/test_weakref.pyRmÊs(RRRm(((s-/usr/local/lib/python2.5/test/test_weakref.pyRlÉs((RfR RkRRRmRRd(RRfRkRlRn((s-/usr/local/lib/python2.5/test/test_weakref.pyttest_callback_in_cycle_2·s			cCspddk}ddd„ƒY}|ƒ|ƒ}}||_||_ti||iƒ|_~~|iƒdS(NiÿÿÿÿRcBseZd„ZRS(cSs|i|i|idS(N(tmeRhR(RRe((s-/usr/local/lib/python2.5/test/test_weakref.pytcbÞs(RRRr(((s-/usr/local/lib/python2.5/test/test_weakref.pyRÝs((RfRqRhRRRrRRd(RRfRRhRi((s-/usr/local/lib/python2.5/test/test_weakref.pyttest_callback_in_cycle_3Ôs		cCsŒddk}dtfd„ƒY}ddd„ƒY}|ƒ|ƒ}}||_||_ti||iƒ|_~~~~|iƒdS(NiÿÿÿÿRcBseZd„ZRS(cSs|i|i|idS(N(RqRhR(RRe((s-/usr/local/lib/python2.5/test/test_weakref.pyRr÷s(RRRr(((s-/usr/local/lib/python2.5/test/test_weakref.pyRöstDcBseZRS((RR(((s-/usr/local/lib/python2.5/test/test_weakref.pyRtüs((	RfR RqRhRRRrRRd(RRfRRtRhRi((s-/usr/local/lib/python2.5/test/test_weakref.pyttest_callback_in_cycle_4ìs			csddk}g‰dtf‡fd†ƒY}|dƒ|dƒ}}||_||_ti||iƒ|_ti||iƒ|_‡fd†}ti||ƒ}~~~|iˆgƒ|iƒ|iˆdgƒ|i|ƒdƒˆ2|iƒ|iˆgƒdS(NiÿÿÿÿRcs eZd„Z‡fd†ZRS(cSs
||_dS(N(t	attribute(Rtvalue((s-/usr/local/lib/python2.5/test/test_weakref.pyt__init__scsˆi|iƒdS(N(R3R!(RRe(talist(s-/usr/local/lib/python2.5/test/test_weakref.pyRms(RRRxRm((Ry(s-/usr/local/lib/python2.5/test/test_weakref.pyRs	iicsˆidƒdS(NsC went away(R3(Re(Ry(s-/usr/local/lib/python2.5/test/test_weakref.pytC_went_away"ssC went away(
RfR R!RRRmRR4RdR
(RRfRRhRiRzR((Rys-/usr/local/lib/python2.5/test/test_weakref.pyt#test_callback_in_cycle_resurrections$			

cs.ddk}g‰‡fd†}dtf‡fd†ƒY}|ƒ|ƒ}}||_||_|i}ti||ƒ|_ti||iƒ|_ti||ƒ}|i|ƒ|jƒ~~~~|iˆgƒ|i	ƒ|iˆdgƒ|i|ƒdƒˆ2|i	ƒ|iˆgƒdS(NiÿÿÿÿcsˆidƒdS(Nssafe_callback called(R3(Re(Ry(s-/usr/local/lib/python2.5/test/test_weakref.pyt
safe_callback;sRcseZ‡fd†ZRS(csˆidƒdS(Ns	cb called(R3(RRe(Ry(s-/usr/local/lib/python2.5/test/test_weakref.pyRr?s(RRRr((Ry(s-/usr/local/lib/python2.5/test/test_weakref.pyR>sssafe_callback called(RfR totherRrRRRRR4RdR
(RRfR|RR!tdRtexternal_wr((Rys-/usr/local/lib/python2.5/test/test_weakref.pyttest_callbacks_on_callback6s(				

cCs|itiƒdS(N(tcheck_gc_during_creationRR(R((s-/usr/local/lib/python2.5/test/test_weakref.pyttest_gc_during_ref_creation\scCs|itiƒdS(N(RRR#(R((s-/usr/local/lib/python2.5/test/test_weakref.pyttest_gc_during_proxy_creation_scCs¡tiƒ}tidddƒtiƒddd„ƒY}d„}|ƒ}|ƒ}||_||ƒ|_z|ƒ}ti||ƒWdti|ŒXdS(NitAcBseZRS((RR(((s-/usr/local/lib/python2.5/test/test_weakref.pyR„fscWsdS(N((targs((s-/usr/local/lib/python2.5/test/test_weakref.pyRis((Rft
get_thresholdt
set_thresholdRdtaRRR(RRCt
thresholdsR„Rt
referencedRˆ((s-/usr/local/lib/python2.5/test/test_weakref.pyRbs
					cCs#dtfd„ƒY}|ƒ}dS(NtTargetcBseZd„ZRS(cSsti|ƒadS(N(RRtref_from_del(R((s-/usr/local/lib/python2.5/test/test_weakref.pyt__del__s(RRR(((s-/usr/local/lib/python2.5/test/test_weakref.pyR‹€s(R (RR‹tw((s-/usr/local/lib/python2.5/test/test_weakref.pyttest_ref_created_during_del{s("RRRRRR"R(RRR,R/R>R@RAR?RHR0RPRTRURWRZRcRjRoRpRsRuR{R€R‚RƒRR(((s-/usr/local/lib/python2.5/test/test_weakref.pyR,s@								
			%												(	(				.	&			tSubclassableWeakrefTestCasecBs5eZd„Zd„Zd„Zd„Zd„ZRS(cs£dtif‡fd†ƒY‰tdƒ}ˆ|ddƒ}|i|ƒ|jƒ|i|iƒ|i|idƒ~|i|ƒdjƒ|i|iƒdS(NtMyRefcs,eZdd‡fd†Z‡fd†ZRS(i*cs&||_tˆ|ƒi||ƒdS(N(RwtsuperRx(RtobRRw(R‘(s-/usr/local/lib/python2.5/test/test_weakref.pyRxŒs	cst|_tˆ|ƒiƒS(N(tTruetcalledR’R	(R(R‘(s-/usr/local/lib/python2.5/test/test_weakref.pyR	s	N(RRR
RxR	((R‘(s-/usr/local/lib/python2.5/test/test_weakref.pyR‘‹sRIRwi(RRRBRR•R4RwR
(RRtmr((R‘s-/usr/local/lib/python2.5/test/test_weakref.pyttest_subclass_refsŠscCsdtifd„ƒY}tdƒ}||ƒ}ti|ƒ}|i||j	ƒ|iti|ƒ||gƒ|iti|ƒdƒ||ƒ}|iti|ƒdƒti|ƒ}|it|ƒdƒ|i||djƒ|i||djƒ|i||djƒdS(NR‘cBseZRS((RR(((s-/usr/local/lib/python2.5/test/test_weakref.pyR‘œsi*iiii(RRRBRR4RVR+R5(RR‘Rtr1tr2tr3trefs((s-/usr/local/lib/python2.5/test/test_weakref.pyt-test_subclass_refs_dont_replace_standard_refs›scCsdtifd„ƒY}tdƒ}||tƒ}||tƒ}|i||j	ƒti|ƒ}|i||jƒ|i||jƒdS(NR‘cBseZRS((RR(((s-/usr/local/lib/python2.5/test/test_weakref.pyR‘­si*(RRRBtidtstrRRV(RR‘RR˜R™R›((s-/usr/local/lib/python2.5/test/test_weakref.pyt*test_subclass_refs_dont_conflate_callbacks¬scCsdtifd„ƒY}tdƒ}||dddƒ}|i|idƒ|i|idƒ|i|iƒdƒ|it	|dƒƒdS(NR‘cBs)eZdZd„Zd„Zd„ZRS(tslot1tslot2cSstii|||ƒS(N(RRt__new__(RER“RR R¡((s-/usr/local/lib/python2.5/test/test_weakref.pyR¢ºscSs||_||_dS(N(R R¡(RR“RR R¡((s-/usr/local/lib/python2.5/test/test_weakref.pyRx¼s	cSs|i|iS(N(R R¡(R((s-/usr/local/lib/python2.5/test/test_weakref.pytmeth¿s(sslot1sslot2(RRt	__slots__R¢RxR£(((s-/usr/local/lib/python2.5/test/test_weakref.pyR‘¸s		i*tabctdeftabcdeft__dict__(
RRRBR
R4R R¡R£R2RJ(RR‘Rtr((s-/usr/local/lib/python2.5/test/test_weakref.pyttest_subclass_refs_with_slots·s	cs»dtifd„ƒY}‡fd†}tƒ}|||ƒ}||_~~ˆiˆidƒtƒ}|||ƒ}|||ƒ}||_||_~~~ˆiˆidƒdS(NR‘cBseZRS((RR(((s-/usr/local/lib/python2.5/test/test_weakref.pyR‘Ïscsˆid7_dS(Ni(R(RŽ(R(s-/usr/local/lib/python2.5/test/test_weakref.pyRÔsi(RRRRR4RR©(RR‘RRR˜R™((Rs-/usr/local/lib/python2.5/test/test_weakref.pyttest_subclass_refs_with_cycleÈs"					(RRR—RœRŸRªR«(((s-/usr/local/lib/python2.5/test/test_weakref.pyRˆs
				RBcBseZd„Zd„ZRS(cCs
||_dS(N(targ(RR¬((s-/usr/local/lib/python2.5/test/test_weakref.pyRxðscCsd|iS(Ns<Object %r>(R¬(R((s-/usr/local/lib/python2.5/test/test_weakref.pyt__repr__òs(RRRxR­(((s-/usr/local/lib/python2.5/test/test_weakref.pyRBïs	tMappingTestCasecBsÔeZdZd„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„ZRS(i
cCsb|iƒ\}}xN|D]F}|iti|ƒdjd|ƒ|i|||ijdƒqW|iƒ}|iƒiƒ}|iƒ|iƒ|i||jdƒ~~|it|ƒ|i	jƒ|d=|it|ƒ|i	djdƒ~~|it|ƒdjdƒti
ƒ}|it|i
dƒtƒ|d<|it|i
dƒ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_dictRRR+R¬titemstcopytsortR5tCOUNTtWeakValueDictionaryR%tKeyErrort__getitem__R(RtdicttobjectsRtitems1titems2((s-/usr/local/lib/python2.5/test/test_weakref.pyttest_weak_valuesús2


cCsX|iƒ\}}xN|D]F}|iti|ƒdjd|ƒ|i|i||jdƒqW|iƒ}|iƒiƒ}|it|ƒt|ƒjdƒ~~|it|ƒ|i	jƒ|d=|it|ƒ|i	djdƒ~~|it|ƒdjdƒt
dƒ}d	||<|i|i|ƒƒ|i|id
ƒƒ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_dictRRR+R¬R°R±tsetR5R³RBthas_key(RR·R¸RR¹Rº((s-/usr/local/lib/python2.5/test/test_weakref.pyttest_weak_keyss.
cCs‹|iƒ\}}|i|ƒ|iƒ}|it|ƒt|ƒƒt|ƒ}xd|D]\}|ƒ}|i|i|ƒƒ|i||jƒ|i|i||ƒ|i	|ƒqZW|it|ƒdƒt|ƒ}|itt|i
ƒƒƒt|ƒƒxj|i
ƒD]\}|ƒ}|i|i|ƒƒ|i||jƒ|i|i||ƒ|i	|ƒqW|it|ƒdƒdS(Ni(R¼tcheck_iterstkeyrefsR4R5RRRR¾R¬R^titerkeyrefs(RR·R¸R›tobjects2RR“((s-/usr/local/lib/python2.5/test/test_weakref.pyttest_weak_keyed_iters4s.
	(
	cCss|iƒ\}}|i|ƒ|iƒ}|it|ƒt|ƒƒt|ƒ}xX|D]P}|ƒ}|i|||iƒ|i|i||iiƒ|i|ƒqZW|it|ƒdƒt|ƒ}|itt|iƒƒƒt|ƒƒx^|iƒD]P}|ƒ}|i|||iƒ|i|i||iiƒ|i|ƒqW|it|ƒdƒdS(Ni(	R¯RÀt	valuerefsR4R5RRR¬R^t
itervaluerefs(RR·R¸R›RÃRR“((s-/usr/local/lib/python2.5/test/test_weakref.pyttest_weak_valued_itersOs*
	(
	cCs.|iƒ}x!|iƒD]}|i|ƒqW|it|ƒdjdƒ|iƒ}x|D]}|i|ƒq_W|it|ƒdjdƒ|iƒ}x!|iƒD]}|i|ƒq«W|it|ƒdjdƒ|iƒ}x!|iƒD]}|i|ƒq÷W|it|ƒdjdƒ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°t	iteritemsR^RR5tkeystiterkeystvaluest
itervalues(RR·R°titemRÉR\RËtv((s-/usr/local/lib/python2.5/test/test_weakref.pyRÀhs*


cCs?tdƒ}tihd|<ƒ}|i||djƒdS(Niil(RBRtWeakKeyDictionaryR(RRR·((s-/usr/local/lib/python2.5/test/test_weakref.pyt#test_make_weak_keyed_dict_from_dict‚scCsNtdƒ}tihd|<ƒ}ti|ƒ}|i||djƒdS(Niil(RBRRÏR(RRR·tdict2((s-/usr/local/lib/python2.5/test/test_weakref.pyt.test_make_weak_keyed_dict_from_weak_keyed_dict‡scCsLtiƒ}ttt|iƒƒ}x|D]}|i||<q+W||fS(N(RRÏtmapRBR7R³R¬(RR·R¸R((s-/usr/local/lib/python2.5/test/test_weakref.pyR¼scCsLtiƒ}ttt|iƒƒ}x|D]}|||i<q+W||fS(N(RR´RÓRBR7R³R¬(RR·R¸R((s-/usr/local/lib/python2.5/test/test_weakref.pyR¯”sc	Csþ|ƒ}|||<|||<|it|ƒdjƒ|iƒ\}}|it|ƒdjƒ||jo|i||jƒn|i||jƒ|iƒ\}}|it|ƒdjƒ||jo|i||jƒn|i||jƒdS(Niii(RR5tpopitem(	Rtklasstkey1tvalue1tkey2tvalue2tweakdictR\RÎ((s-/usr/local/lib/python2.5/test/test_weakref.pyt
check_popitem›s	



cCs&|itidtƒdtƒƒdS(NRÖRØ(RÛRR´R(R((s-/usr/local/lib/python2.5/test/test_weakref.pyttest_weak_valued_dict_popitem­scCs&|ititƒdtƒdƒdS(Nsvalue 1svalue 2(RÛRRÏR(R((s-/usr/local/lib/python2.5/test/test_weakref.pyttest_weak_keyed_dict_popitem±scCsÿ|i||j	dƒ|ƒ}|i||ƒ}|i||jƒ|i|i|ƒƒ|i|i|ƒ|jƒ|i|||jƒ|i||ƒ}|i||jƒ|i|i|ƒƒ|i|i|ƒ|jƒ|i|||jƒdS(Ns9invalid test -- value parameters must be distinct objects(Rt
setdefaultR¾tget(RRÕtkeyR×RÙRÚR((s-/usr/local/lib/python2.5/test/test_weakref.pytcheck_setdefaultµs	cCs#|itidtƒtƒƒdS(NRà(RáRR´R(R((s-/usr/local/lib/python2.5/test/test_weakref.pyt test_weak_valued_dict_setdefaultÆscCs |ititƒddƒdS(Nsvalue 1svalue 2(RáRRÏR(R((s-/usr/local/lib/python2.5/test/test_weakref.pyttest_weak_keyed_dict_setdefaultÊscCs|ƒ}|i|ƒ|it|ƒt|ƒjƒxo|iƒD]a}|i|i|ƒdƒ|i|ƒ}|i|||jƒ|i||i|ƒjƒqBWxj|iƒD]\}|i|i|ƒdƒ||}|i|||jƒ|i||i|ƒjƒq´WdS(Ns(mysterious new key appeared in weak dicts%original key disappeared in weak dict(tupdateRR5RÉR¾Rß(RRÕR·RÚR\RÎ((s-/usr/local/lib/python2.5/test/test_weakref.pytcheck_updateÎs"	

 

cCs>|itihtƒd<tƒd<tƒtƒ<ƒdS(NiRˆ(RåRR´R(R((s-/usr/local/lib/python2.5/test/test_weakref.pyttest_weak_valued_dict_updateãscCs;|itihdtƒ<dtƒ<dtƒ<ƒdS(Niii(RåRRÏR(R((s-/usr/local/lib/python2.5/test/test_weakref.pyttest_weak_keyed_dict_updateçscCs‘tiƒ}tdƒ}tdƒ}d||<d||<|it|ƒdjƒ||=|it|ƒdjƒ|i|iƒ|gjƒdS(Nt1t2t	somethingii(RRÏRBRR5RÉ(RR~to1R*((s-/usr/local/lib/python2.5/test/test_weakref.pyttest_weak_keyed_delitemës

cCs—tiƒ}tdƒ}tdƒ}||d<||d<|it|ƒdjƒ|d=|it|ƒdjƒ|i|iƒd|fgjƒdS(NRèRéRêssomething elseii(RR´RBRR5R°(RR~RëR*((s-/usr/local/lib/python2.5/test/test_weakref.pyttest_weak_valued_delitemös

cCstiƒ}tdƒ}|it|i|ƒ|it|i|ƒ|it|idƒ|it|idƒ|it|iddƒdS(NRèi
(	RRÏRBR%RµRNR¶RGt__setitem__(RR~R((s-/usr/local/lib/python2.5/test/test_weakref.pyttest_weak_keyed_bad_delitemsc
sítiƒ}t‰dtf‡‡fd†ƒY}g}tdƒD]}|||ƒqB~‰xˆD]}|i||<qeW~|iƒ‰ˆiƒt‰d}xˆD]}|d7}||=q¨W|i	t
|ƒdƒ|i	|dƒdS(NRcs,eZd„Zd„Z‡‡fd†ZRS(cSs
||_dS(N(Rw(RRg((s-/usr/local/lib/python2.5/test/test_weakref.pyRxscSs
t|iƒS(N(thashRw(R((s-/usr/local/lib/python2.5/test/test_weakref.pyt__hash__scs"ˆoˆd=n|i|ijS(Niÿÿÿÿ(Rw(RR}(tmutatetobjs(s-/usr/local/lib/python2.5/test/test_weakref.pyt__eq__s(RRRxRñRô((RòRó(s-/usr/local/lib/python2.5/test/test_weakref.pyRs		iiii(RRÏtFalseR R7RwRÉtreverseR”R4R5(RR~Rt_[1]RgRtcount((RòRós-/usr/local/lib/python2.5/test/test_weakref.pyt!test_weak_keyed_cascading_deletess$-
	
(RRR³R»R¿RÄRÇRÀRÐRÒR¼R¯RÛRÜRÝRáRâRãRåRæRçRìRíRïRù(((s-/usr/local/lib/python2.5/test/test_weakref.pyR®ös.																					(t
mapping_teststWeakValueDictionaryTestCasecBsSeZdZhedƒd<edƒd<edƒd<ZeiZd„ZRS(s?Check that WeakValueDictionary conforms to the mapping protocoliRÖiRØitkey3cCs
|iiƒS(N(t!_WeakValueDictionaryTestCase__refR±(R((s-/usr/local/lib/python2.5/test/test_weakref.pyt
_referenceBs(	RRt__doc__RBRýRR´t	type2testRþ(((s-/usr/local/lib/python2.5/test/test_weakref.pyRû>s3	tWeakKeyDictionaryTestCasecBsSeZdZhdedƒ<dedƒ<dedƒ<ZeiZd„ZRS(s=Check that WeakKeyDictionary conforms to the mapping protocoliRÖiRØiRücCs
|iiƒS(N(t_WeakKeyDictionaryTestCase__refR±(R((s-/usr/local/lib/python2.5/test/test_weakref.pyRþIs(	RRRÿRBRRRÏRRþ(((s-/usr/local/lib/python2.5/test/test_weakref.pyREs3	sà Doctest for examples in the library reference: libweakref.tex

>>> 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
libreftestcCs1titttttƒtiti	t
ƒdS(N(Rtrun_unittestRR®RûRRtrun_doctesttsystmodulesR(((s-/usr/local/lib/python2.5/test/test_weakref.pyt	test_main¡st__main__(RfRtunittestR1RttestRR
RŒRRRR
RtTestCaseRRRRBR®RútBasicTestMappingProtocolRûRRt__test__RR(((s-/usr/local/lib/python2.5/test/test_weakref.pys<module>s6				ÿÿ^gÿGX	


Man Man