-=[ Mr. Bumblebee ]=-
_Indonesia_

Path : /usr/lib/python2.7/
File Upload :
Current File : //usr/lib/python2.7/weakref.pyc

ó
ºV}]c@sîdZddlZddlmZmZmZmZmZmZm	Z	ddl
mZmZddl
mZeefZdddd	d
ddd
ddddgZdejfd„ƒYZdefd„ƒYZd
ejfd„ƒ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(tWeakSett_IterationGuard(tReferenceErrorRRRRtWeakKeyDictionaryR	RRRt
ProxyTypestWeakValueDictionaryRcBsòeZdZd„Zd„Zd„Zd„Zd„Zd„Zd„Z	d„Z
d	„Zd
„ZeZ
d„Zdd„Zd
„Zd„Zd„ZeZd„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
    cOsJt|ƒd„}||_g|_tƒ|_tjj|||ŽdS(NcSsH|ƒ}|dk	rD|jr4|jj|jƒqD|j|j=ndS(N(tNonet
_iteratingt_pending_removalstappendtkeytdata(twrtselfreftself((s/usr/lib/python2.7/weakref.pytremove0s
		(Rt_removeRtsetRtUserDictt__init__(RtargstkwR((s/usr/lib/python2.7/weakref.pyR/s
		cCs0|j}|j}x|r+||jƒ=qWdS(N(RRtpop(Rtltd((s/usr/lib/python2.7/weakref.pyt_commit_removals=s			cCs0|j|ƒ}|dkr(t|‚n|SdS(N(RR
tKeyError(RRto((s/usr/lib/python2.7/weakref.pyt__getitem__EscCs$|jr|jƒn|j|=dS(N(RR R(RR((s/usr/lib/python2.7/weakref.pyt__delitem__Ls	
cCs3y|j|ƒ}Wntk
r(tSX|dk	S(N(RR!tFalseR
(RRR"((s/usr/lib/python2.7/weakref.pyt__contains__Qs

cCs3y|j|ƒ}Wntk
r(tSX|dk	S(N(RR!R%R
(RRR"((s/usr/lib/python2.7/weakref.pythas_keyXs

cCsdt|ƒS(Ns<WeakValueDictionary at %s>(tid(R((s/usr/lib/python2.7/weakref.pyt__repr___scCs6|jr|jƒnt||j|ƒ|j|<dS(N(RR tKeyedRefRR(RRtvalue((s/usr/lib/python2.7/weakref.pyt__setitem__bs	
cCs'|jr|jƒn|jjƒdS(N(RR Rtclear(R((s/usr/lib/python2.7/weakref.pyR-gs	
cCsOtƒ}x?|jjƒD].\}}|ƒ}|dk	r|||<qqW|S(N(RRtitemsR
(RtnewRRR"((s/usr/lib/python2.7/weakref.pytcopyls		cCskddlm}|jƒ}xH|jjƒD]7\}}|ƒ}|dk	r,|||||ƒ<q,q,W|S(Niÿÿÿÿ(tdeepcopy(R0R1t	__class__RR.R
(RtmemoR1R/RRR"((s/usr/lib/python2.7/weakref.pyt__deepcopy__vs	cCsGy|j|}Wntk
r%|SX|ƒ}|dkr?|S|SdS(N(RR!R
(RRtdefaultRR"((s/usr/lib/python2.7/weakref.pytgets
	cCsUg}xH|jjƒD]7\}}|ƒ}|dk	r|j||fƒqqW|S(N(RR.R
R(RtLRRR"((s/usr/lib/python2.7/weakref.pyR.Œs	ccsWt|ƒEx=|jjƒD],}|ƒ}|dk	r|j|fVqqWWdQXdS(N(RRt
itervaluesR
R(RRR+((s/usr/lib/python2.7/weakref.pyt	iteritems”s

	ccs6t|ƒ$x|jjƒD]}|VqWWdQXdS(N(RRtiterkeys(Rtk((s/usr/lib/python2.7/weakref.pyR:›s
ccs6t|ƒ$x|jjƒD]}|VqWWdQXdS(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.

        N(RRR8(RR((s/usr/lib/python2.7/weakref.pyt
itervaluerefs¢s

ccsNt|ƒ<x4|jjƒD]#}|ƒ}|dk	r|VqqWWdQXdS(N(RRR8R
(RRtobj((s/usr/lib/python2.7/weakref.pyR8°s

	cCsT|jr|jƒnx7|jjƒ\}}|ƒ}|dk	r||fSqdS(N(RR RtpopitemR
(RRRR"((s/usr/lib/python2.7/weakref.pyR>·s	
	cGst|jr|jƒny|jj|ƒƒ}Wn"tk
rS|rM|dS‚nX|dkrlt|‚n|SdS(Ni(RR RRR!R
(RRRR"((s/usr/lib/python2.7/weakref.pyRÀs	

cCscy|j|}WnDtk
rW|jr7|jƒnt||j|ƒ|j|<|SX|ƒSdS(N(RR!RR R*R(RRR5R((s/usr/lib/python2.7/weakref.pyt
setdefaultÎs
	
cKs¨|jr|jƒn|j}|dk	rˆt|dƒsOtiƒ|ƒ}nx6|jƒD]%\}}t||j|ƒ||<q\Wnt	|ƒr¤|j
|ƒndS(NR.(RR RR
thasattrttypeR.R*Rtlentupdate(RtdicttkwargsRRR"((s/usr/lib/python2.7/weakref.pyRCÙs	
	 cCs
|jjƒ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.

        (Rtvalues(R((s/usr/lib/python2.7/weakref.pyt	valuerefsås
cCsIg}x<|jjƒD]+}|ƒ}|dk	r|j|ƒqqW|S(N(RRFR
R(RR7RR"((s/usr/lib/python2.7/weakref.pyRFñs	N(t__name__t
__module__t__doc__RR R#R$R&R'R)R,R-R0t__copy__R4R
R6R.R9R:t__iter__R<R8R>RR?RCRGRF(((s/usr/lib/python2.7/weakref.pyR#s4												
									R*cBs&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.

    RcCs"tj|||ƒ}||_|S(N(Rt__new__R(RAtobtcallbackRR((s/usr/lib/python2.7/weakref.pyRMs	cCstt|ƒj||ƒdS(N(tsuperR*R(RRNROR((s/usr/lib/python2.7/weakref.pyRs(skey(RHRIRJt	__slots__RMR(((s/usr/lib/python2.7/weakref.pyR*ús	cBsìeZdZdd„Zd„Zd„Zd„Zd„Zd„Z	d„Z
e
Zd„Zdd	„Z
d
„Zd„Zd„Zd
„Zd„Zd„ZeZd„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.
    cCsYi|_t|ƒd„}||_g|_tƒ|_|dk	rU|j|ƒndS(NcSsB|ƒ}|dk	r>|jr1|jj|ƒq>|j|=ndS(N(R
RRRR(R;RR((s/usr/lib/python2.7/weakref.pyRs
		(RRRRRRR
RC(RRDR((s/usr/lib/python2.7/weakref.pyRs			cCsH|j}|j}x/|rCy||jƒ=Wqtk
r?qXqWdS(N(RRRR!(RRR((s/usr/lib/python2.7/weakref.pyR *s			
cCs|jt|ƒ=dS(N(RR(RR((s/usr/lib/python2.7/weakref.pyR$7scCs|jt|ƒS(N(RR(RR((s/usr/lib/python2.7/weakref.pyR#:scCsdt|ƒS(Ns<WeakKeyDictionary at %s>(R((R((s/usr/lib/python2.7/weakref.pyR)=scCs||jt||jƒ<dS(N(RRR(RRR+((s/usr/lib/python2.7/weakref.pyR,@scCsOtƒ}x?|jjƒD].\}}|ƒ}|dk	r|||<qqW|S(N(R
RR.R
(RR/RR+R"((s/usr/lib/python2.7/weakref.pyR0Cs		cCskddlm}|jƒ}xH|jjƒD]7\}}|ƒ}|dk	r,|||ƒ||<q,q,W|S(Niÿÿÿÿ(R1(R0R1R2RR.R
(RR3R1R/RR+R"((s/usr/lib/python2.7/weakref.pyR4Ms	cCs|jjt|ƒ|ƒS(N(RR6R(RRR5((s/usr/lib/python2.7/weakref.pyR6VscCs2yt|ƒ}Wntk
r$dSX||jkS(Ni(Rt	TypeErrorR(RRR((s/usr/lib/python2.7/weakref.pyR'Ys

cCs2yt|ƒ}Wntk
r$dSX||jkS(Ni(RRRR(RRR((s/usr/lib/python2.7/weakref.pyR&`s

cCsUg}xH|jjƒD]7\}}|ƒ}|dk	r|j||fƒqqW|S(N(RR.R
R(RR7RR+R"((s/usr/lib/python2.7/weakref.pyR.gs	ccsZt|ƒHx@|jjƒD]/\}}|ƒ}|dk	r||fVqqWWdQXdS(N(RRR9R
(RRR+R((s/usr/lib/python2.7/weakref.pyR9os

	ccs6t|ƒ$x|jjƒD]}|VqWWdQXdS(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.

        N(RRR:(RR((s/usr/lib/python2.7/weakref.pytiterkeyrefsvs

ccsNt|ƒ<x4|jjƒD]#}|ƒ}|dk	r|VqqWWdQXdS(N(RRR:R
(RRR=((s/usr/lib/python2.7/weakref.pyR:„s

	ccs6t|ƒ$x|jjƒD]}|VqWWdQXdS(N(RRR8(RR+((s/usr/lib/python2.7/weakref.pyR8s
cCs
|jjƒ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.

        (Rtkeys(R((s/usr/lib/python2.7/weakref.pytkeyrefs’s
cCsIg}x<|jjƒD]+}|ƒ}|dk	r|j|ƒqqW|S(N(RRTR
R(RR7RR"((s/usr/lib/python2.7/weakref.pyRTžs	cCs>x7|jjƒ\}}|ƒ}|dk	r||fSqdS(N(RR>R
(RRR+R"((s/usr/lib/python2.7/weakref.pyR>¦s
	cGs|jjt|ƒ|ŒS(N(RRR(RRR((s/usr/lib/python2.7/weakref.pyR­scCs|jjt||jƒ|ƒS(N(RR?RR(RRR5((s/usr/lib/python2.7/weakref.pyR?°scKs|j}|dk	rot|dƒs9tiƒ|ƒ}nx3|jƒD]"\}}||t||jƒ<qFWnt|ƒr‹|j|ƒndS(NR.(	RR
R@RAR.RRRBRC(RRDRERRR+((s/usr/lib/python2.7/weakref.pyRC³s	N(RHRIRJR
RR R$R#R)R,R0RKR4R6R'R&R.R9RSR:RLR8RURTR>RR?RC(((s/usr/lib/python2.7/weakref.pyR
s2		
																		(RJRt_weakrefRRRRRRRt_weakrefsetRRt
exceptionsR	Rt__all__RR*R
(((s/usr/lib/python2.7/weakref.pyt<module>s4	×

Copyright © 2017 || Recoded By Mr.Bumblebee