ACC SHELL

Path : /usr/lib/python/
File Upload :
Current File : //usr/lib/python/weakref.pyo

Ñò
oÄMc@sÕdZddkZddklZlZlZlZlZlZl	Z	ddk
lZeefZddddd	d
ddd
ddgZ
deifd„ƒYZdefd„ƒYZd	eifd„ƒYZdS(s{Weak reference support for Python.

This module is an implementation of PEP 205:

http://www.python.org/dev/peps/pep-0205/
iÿÿÿÿN(tgetweakrefcounttgetweakrefstreftproxytCallableProxyTypet	ProxyTypet
ReferenceType(tReferenceErrorRRRRtWeakKeyDictionaryRRRRt
ProxyTypestWeakValueDictionarycBsËeZdZd„Zd„Zd„Zd„Zd„Zd„Zd„Z	dd„Zd	„Zd
„Z
d„Zd„Zd
„Zd„Zd„Zd„Zdd„Zdd„Zd„Zd„ZRS(s›Mapping class that references values weakly.

    Entries in the dictionary will be discarded when no strong
    reference to the value exists anymore
    cOs5t|ƒd„}||_tii|||ŽdS(NcSs+|ƒ}|dj	o|i|i=ndS(N(tNonetdatatkey(twrtselfreftself((s/usr/lib/python2.6/weakref.pytremove.s	
(Rt_removetUserDictt__init__(RtargstkwR((s/usr/lib/python2.6/weakref.pyR-s	cCs2|i|ƒ}|djo
t|‚n|SdS(N(RRtKeyError(RR
to((s/usr/lib/python2.6/weakref.pyt__getitem__5s

cCs5y|i|ƒ}Wntj
otSX|dj	S(N(RRtFalseR(RR
R((s/usr/lib/python2.6/weakref.pyt__contains__<s
cCs5y|i|ƒ}Wntj
otSX|dj	S(N(RRRR(RR
R((s/usr/lib/python2.6/weakref.pythas_keyCs
cCsdt|ƒS(Ns<WeakValueDictionary at %s>(tid(R((s/usr/lib/python2.6/weakref.pyt__repr__JscCs t||i|ƒ|i|<dS(N(tKeyedRefRR(RR
tvalue((s/usr/lib/python2.6/weakref.pyt__setitem__MscCsQtƒ}xA|iiƒD]0\}}|ƒ}|dj	o|||<qqW|S(N(R
RtitemsR(RtnewR
RR((s/usr/lib/python2.6/weakref.pytcopyPs		
cCsKy|i|}Wntj
o|SX|ƒ}|djo|S|SdS(N(RRR(RR
tdefaultRR((s/usr/lib/python2.6/weakref.pytgetXs	
cCsWg}xJ|iiƒD]9\}}|ƒ}|dj	o|i||fƒqqW|S(N(RR"Rtappend(RtLR
RR((s/usr/lib/python2.6/weakref.pyR"es	
ccsFx?|iiƒD].}|ƒ}|dj	o|i|fVqqWdS(N(Rt
itervaluesRR
(RRR ((s/usr/lib/python2.6/weakref.pyt	iteritemsms
	
cCs
|iiƒS(N(Rtiterkeys(R((s/usr/lib/python2.6/weakref.pyR+sscCs
|iiƒS(N(RR+(R((s/usr/lib/python2.6/weakref.pyt__iter__vscCs
|iiƒS(sReturn an iterator that yields the weak references to the values.

        The references are not guaranteed to be 'live' at the time
        they are used, so the result of calling the references needs
        to be checked before being used.  This can be used to avoid
        creating references that will cause the garbage collector to
        keep the values around longer than needed.

        (RR)(R((s/usr/lib/python2.6/weakref.pyt
itervaluerefsys
ccs=x6|iiƒD]%}|ƒ}|dj	o	|VqqWdS(N(RR)R(RRtobj((s/usr/lib/python2.6/weakref.pyR)…s
	
cCs@x9|iiƒ\}}|ƒ}|dj	o||fSqdS(N(RtpopitemR(RR
RR((s/usr/lib/python2.6/weakref.pyR/‹s
	
cGsdy|ii|ƒƒ}Wn&tj
o|o	|dS‚nX|djo
t|‚n|SdS(Ni(RtpopRR(RR
RR((s/usr/lib/python2.6/weakref.pyR0’s	

cCsOy|i|}Wn0tj
o$t||i|ƒ|i|<|SX|ƒSdS(N(RRRR(RR
R%R((s/usr/lib/python2.6/weakref.pyt
setdefaultžscKs˜|i}|dj	o`t|dƒpthƒ|ƒ}nx7|iƒD]%\}}t||i|ƒ||<qIWnt|ƒo|i|ƒndS(NR"(	RRthasattrttypeR"RRtlentupdate(RtdicttkwargstdR
R((s/usr/lib/python2.6/weakref.pyR5§s	

!
cCs
|iiƒS(s~Return a list of weak references to the values.

        The references are not guaranteed to be 'live' at the time
        they are used, so the result of calling the references needs
        to be checked before being used.  This can be used to avoid
        creating references that will cause the garbage collector to
        keep the values around longer than needed.

        (Rtvalues(R((s/usr/lib/python2.6/weakref.pyt	valuerefs±s
cCsKg}x>|iiƒD]-}|ƒ}|dj	o|i|ƒqqW|S(N(RR9RR'(RR(RR((s/usr/lib/python2.6/weakref.pyR9½s	
N(t__name__t
__module__t__doc__RRRRRR!R$RR&R"R*R+R,R-R)R/R0R1R5R:R9(((s/usr/lib/python2.6/weakref.pyR
!s*							
									
	RcBs&eZdZdZd„Zd„ZRS(s[Specialized reference that includes a key corresponding to the value.

    This is used in the WeakValueDictionary to avoid having to create
    a function object for each key stored in the mapping.  A shared
    callback object can use the 'key' attribute of a KeyedRef instead
    of getting a reference to the key from an enclosing scope.

    R
cCs"ti|||ƒ}||_|S(N(Rt__new__R
(R3tobtcallbackR
R((s/usr/lib/python2.6/weakref.pyR>Òs	cCstt|ƒi||ƒdS(N(tsuperRR(RR?R@R
((s/usr/lib/python2.6/weakref.pyR×s(skey(R;R<R=t	__slots__R>R(((s/usr/lib/python2.6/weakref.pyRÆs	cBs×eZdZdd„Zd„Zd„Zd„Zd„Zd„Z	dd„Z
d„Zd	„Zd
„Z
d„Zd„Zd
„Zd„Zd„Zd„Zd„Zd„Zd„Zdd„Zdd„ZRS(s‰ Mapping class that references keys weakly.

    Entries in the dictionary will be discarded when there is no
    longer a strong reference to the key. This can be used to
    associate additional data with an object owned by other parts of
    an application without adding attributes to those objects. This
    can be especially useful with objects that override attribute
    accesses.
    cCsFh|_t|ƒd„}||_|dj	o|i|ƒndS(NcSs(|ƒ}|dj	o|i|=ndS(N(RR(tkRR((s/usr/lib/python2.6/weakref.pyRès	
(RRRRR5(RR6R((s/usr/lib/python2.6/weakref.pyRæs
		
cCs|it|ƒ=dS(N(RR(RR
((s/usr/lib/python2.6/weakref.pyt__delitem__ïscCs|it|ƒS(N(RR(RR
((s/usr/lib/python2.6/weakref.pyRòscCsdt|ƒS(Ns<WeakKeyDictionary at %s>(R(R((s/usr/lib/python2.6/weakref.pyRõscCs||it||iƒ<dS(N(RRR(RR
R ((s/usr/lib/python2.6/weakref.pyR!øscCsQtƒ}xA|iiƒD]0\}}|ƒ}|dj	o|||<qqW|S(N(RRR"R(RR#R
R R((s/usr/lib/python2.6/weakref.pyR$ûs		
cCs|iit|ƒ|ƒS(N(RR&R(RR
R%((s/usr/lib/python2.6/weakref.pyR&scCs4yt|ƒ}Wntj
odSX||ijS(Ni(Rt	TypeErrorR(RR
R((s/usr/lib/python2.6/weakref.pyRs
cCs4yt|ƒ}Wntj
odSX||ijS(Ni(RRER(RR
R((s/usr/lib/python2.6/weakref.pyR
s
cCsWg}xJ|iiƒD]9\}}|ƒ}|dj	o|i||fƒqqW|S(N(RR"RR'(RR(R
R R((s/usr/lib/python2.6/weakref.pyR"s	
ccsIxB|iiƒD]1\}}|ƒ}|dj	o||fVqqWdS(N(RR*R(RRR R
((s/usr/lib/python2.6/weakref.pyR*s
	
cCs
|iiƒS(sŒReturn an iterator that yields the weak references to the keys.

        The references are not guaranteed to be 'live' at the time
        they are used, so the result of calling the references needs
        to be checked before being used.  This can be used to avoid
        creating references that will cause the garbage collector to
        keep the keys around longer than needed.

        (RR+(R((s/usr/lib/python2.6/weakref.pytiterkeyrefs"s
ccs=x6|iiƒD]%}|ƒ}|dj	o	|VqqWdS(N(RR+R(RRR.((s/usr/lib/python2.6/weakref.pyR+.s
	
cCs
|iƒS(N(R+(R((s/usr/lib/python2.6/weakref.pyR,4scCs
|iiƒS(N(RR)(R((s/usr/lib/python2.6/weakref.pyR)7scCs
|iiƒS(szReturn a list of weak references to the keys.

        The references are not guaranteed to be 'live' at the time
        they are used, so the result of calling the references needs
        to be checked before being used.  This can be used to avoid
        creating references that will cause the garbage collector to
        keep the keys around longer than needed.

        (Rtkeys(R((s/usr/lib/python2.6/weakref.pytkeyrefs:s
cCsKg}x>|iiƒD]-}|ƒ}|dj	o|i|ƒqqW|S(N(RRGRR'(RR(RR((s/usr/lib/python2.6/weakref.pyRGFs	
cCs@x9|iiƒ\}}|ƒ}|dj	o||fSqdS(N(RR/R(RR
R R((s/usr/lib/python2.6/weakref.pyR/Ns
	
cGs|iit|ƒ|ŒS(N(RR0R(RR
R((s/usr/lib/python2.6/weakref.pyR0UscCs|iit||iƒ|ƒS(N(RR1RR(RR
R%((s/usr/lib/python2.6/weakref.pyR1XscKs•|i}|dj	o]t|dƒpthƒ|ƒ}nx4|iƒD]"\}}||t||iƒ<qIWnt|ƒo|i|ƒndS(NR"(	RRR2R3R"RRR4R5(RR6R7R8R
R ((s/usr/lib/python2.6/weakref.pyR5[s	


N(R;R<R=RRRDRRR!R$R&RRR"R*RFR+R,R)RHRGR/R0R1R5(((s/usr/lib/python2.6/weakref.pyRÛs,																			(R=Rt_weakrefRRRRRRRt
exceptionsRR	t__all__R
RR(((s/usr/lib/python2.6/weakref.pyt<module>s4	¥

ACC SHELL 2018