Ñò §ÚêLc@sÕdZddkZddklZlZlZlZlZlZl Z ddk l Z eefZ ddddd d d d d ddg Z 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(tgetweakrefcountt getweakrefstreftproxytCallableProxyTypet ProxyTypet ReferenceType(tReferenceErrorRRRRtWeakKeyDictionaryRRRRt ProxyTypestWeakValueDictionarycBsËeZdZd„Zd„Zd„Zd„Zd„Zd„Zd„Z dd„Z d „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/lib64/python2.6/weakref.pytremove.s  (Rt_removetUserDictt__init__(RtargstkwR((s/usr/lib64/python2.6/weakref.pyR-s cCs2|i|ƒ}|djo t|‚n|SdS(N(R R tKeyError(RR to((s/usr/lib64/python2.6/weakref.pyt __getitem__5s  cCs5y|i|ƒ}Wntj otSX|dj S(N(R RtFalseR (RR R((s/usr/lib64/python2.6/weakref.pyt __contains__<s cCs5y|i|ƒ}Wntj otSX|dj S(N(R RRR (RR R((s/usr/lib64/python2.6/weakref.pythas_keyCs cCsdt|ƒS(Ns(tid(R((s/usr/lib64/python2.6/weakref.pyt__repr__JscCs t||i|ƒ|i||iiƒD]-}|ƒ}|dj o|i|ƒqqW|S(N(R R9R R'(RR(RR((s/usr/lib64/python2.6/weakref.pyR9½s  N(t__name__t __module__t__doc__RRRRRR!R$R R&R"R*R+R,R-R)R/R0R1R5R:R9(((s/usr/lib64/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/lib64/python2.6/weakref.pyR>Òs cCstt|ƒi||ƒdS(N(tsuperRR(RR?R@R ((s/usr/lib64/python2.6/weakref.pyR×s(skey(R;R<R=t __slots__R>R(((s/usr/lib64/python2.6/weakref.pyRÆs cBs×eZdZdd„Zd„Zd„Zd„Zd„Zd„Z dd„Z d„Z d „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(R R (tkRR((s/usr/lib64/python2.6/weakref.pyRès  (R RRR R5(RR6R((s/usr/lib64/python2.6/weakref.pyRæs    cCs|it|ƒ=dS(N(R R(RR ((s/usr/lib64/python2.6/weakref.pyt __delitem__ïscCs|it|ƒS(N(R R(RR ((s/usr/lib64/python2.6/weakref.pyRòscCsdt|ƒS(Ns(R(R((s/usr/lib64/python2.6/weakref.pyRõscCs||it||iƒ|iiƒD]-}|ƒ}|dj o|i|ƒqqW|S(N(R RGR R'(RR(RR((s/usr/lib64/python2.6/weakref.pyRGFs  cCs@x9|iiƒ\}}|ƒ}|dj o ||fSqdS(N(R R/R (RR R R((s/usr/lib64/python2.6/weakref.pyR/Ns   cGs|iit|ƒ|ŒS(N(R R0R(RR R((s/usr/lib64/python2.6/weakref.pyR0UscCs|iit||iƒ|ƒS(N(R R1RR(RR R%((s/usr/lib64/python2.6/weakref.pyR1XscKs•|i}|dj o]t|dƒpthƒ|ƒ}nx4|iƒD]"\}}||t||iƒs 4    ¥