Files
PowerToys/PythonHome/Lib/weakref.pyc

100 lines
16 KiB
Plaintext
Raw Normal View History

2014-07-09 18:15:23 +08:00
<03>
<EFBFBD>W`Sc @s<>dZddlZddlmZmZmZmZmZmZm Z ddl
m Z m Z ddl mZeefZdddd d
d d d ddddg Zdejfd<00><00>YZdefd<00><00>YZd
ejfd<00><00>YZdS(s{Weak reference support for Python.
This module is an implementation of PEP 205:
http://www.python.org/dev/peps/pep-0205/
i<EFBFBD><EFBFBD><EFBFBD><EFBFBD>N(tgetweakrefcountt getweakrefstreftproxytCallableProxyTypet ProxyTypet ReferenceType(tWeakSett_IterationGuard(tReferenceErrorRRRRtWeakKeyDictionaryR RRRt
ProxyTypestWeakValueDictionaryRcBs<>eZdZd<00>Zd<00>Zd<00>Zd<00>Zd<00>Zd<00>Zd<00>Z d<00>Z
d <00>Z d
<00>Z e Z d <00>Zdd <00>Zd <00>Zd<00>Zd<00>ZeZd<00>Zd<00>Zd<00>Zd<00>Zdd<00>Zdd<00>Zd<00>Zd<00>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|<00>d<00>}||_g|_t<00>|_tjj|||<00>dS(NcSsH|<00>}|dk rD|jr4|jj|j<00>qD|j|j=ndS(N(tNonet
2014-07-10 23:57:08 +08:00
_iteratingt_pending_removalstappendtkeytdata(twrtselfreftself((s<e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\weakref.pytremove0s
   (Rt_removeRtsetRtUserDictt__init__(RtargstkwR((s<e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\weakref.pyR/s
   cCs0|j}|j}x|r+||j<00>=qWdS(N(RRtpop(Rtltd((s<e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\weakref.pyt_commit_removals=s   cCs0|j|<19>}|dkr(t|<00>n|SdS(N(RR tKeyError(RRto((s<e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\weakref.pyt __getitem__Es  cCs$|jr|j<00>n|j|=dS(N(RR R(RR((s<e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\weakref.pyt __delitem__Ls  cCs3y|j|<19>}Wntk
r(tSX|dk S(N(RR!tFalseR (RRR"((s<e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\weakref.pyt __contains__Qs
2014-07-09 18:15:23 +08:00
 cCs3y|j|<19>}Wntk
2014-07-10 23:57:08 +08:00
r(tSX|dk S(N(RR!R%R (RRR"((s<e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\weakref.pythas_keyXs
 cCsdt|<00>S(Ns<WeakValueDictionary at %s>(tid(R((s<e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\weakref.pyt__repr___scCs6|jr|j<00>nt||j|<00>|j|<dS(N(RR tKeyedRefRR(RRtvalue((s<e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\weakref.pyt __setitem__bs  cCs'|jr|j<00>n|jj<00>dS(N(RR Rtclear(R((s<e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\weakref.pyR-gs  cCsOt<00>}x?|jj<00>D].\}}|<00>}|dk r|||<qqW|S(N(R RtitemsR (RtnewRRR"((s<e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\weakref.pytcopyls    cCskddlm}|j<00>}xH|jj<00>D]7\}}|<00>}|dk r,|||||<00><q,q,W|S(Ni<4E><69><EFBFBD><EFBFBD>(tdeepcopy(R0R1t __class__RR.R (RtmemoR1R/RRR"((s<e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\weakref.pyt __deepcopy__vs   cCsGy|j|}Wntk
r%|SX|<00>}|dkr?|S|SdS(N(RR!R (RRtdefaultRR"((s<e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\weakref.pytgets   cCsUg}xH|jj<00>D]7\}}|<00>}|dk r|j||f<00>qqW|S(N(RR.R R(RtLRRR"((s<e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\weakref.pyR.<00>s   ccsWt|<00><00>Ex=|jj<00>D],}|<00>}|dk r|j|fVqqWWdQXdS(N(RRt
itervaluesR R(RRR+((s<e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\weakref.pyt iteritems<6D>s
   ccs6t|<00><00>$x|jj<00>D] }|VqWWdQXdS(N(RRtiterkeys(Rtk((s<e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\weakref.pyR:<00>s ccs6t|<00><00>$x|jj<00>D] }|VqWWdQXdS(s<>Return an iterator that yields the weak references to the values.
2014-07-09 18:15:23 +08:00
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.
2014-07-10 23:57:08 +08:00
N(RRR8(RR((s<e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\weakref.pyt itervaluerefs<66>s
ccsNt|<00><00><x4|jj<00>D]#}|<00>}|dk r|VqqWWdQXdS(N(RRR8R (RRtobj((s<e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\weakref.pyR8<00>s
   cCsT|jr|j<00>nx7|jj<00>\}}|<00>}|dk r||fSqdS(N(RR RtpopitemR (RRRR"((s<e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\weakref.pyR><00>s    cGst|jr|j<00>ny|jj|<00><00>}Wn"tk
rS|rM|dS<>nX|dkrlt|<00>n|SdS(Ni(RR RRR!R (RRRR"((s<e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\weakref.pyR<00>s     cCscy|j|}WnDtk
rW|jr7|j<00>nt||j|<00>|j|<|SX|<00>SdS(N(RR!RR R*R(RRR5R((s<e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\weakref.pyt
2014-07-09 18:15:23 +08:00
setdefault<6C>s   cKs<>|jr|j<00>n|j}|dk r<>t|d<00>sOti<00>|<00>}nx6|j<00>D]%\}}t||j|<00>||<q\Wnt |<00>r<>|j
2014-07-10 23:57:08 +08:00
|<00>ndS(NR.( RR RR thasattrttypeR.R*Rtlentupdate(RtdicttkwargsRRR"((s<e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\weakref.pyRC<00>s      cCs |jj<00>S(s~Return a list of weak references to the values.
2014-07-09 18:15:23 +08:00
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.
2014-07-10 23:57:08 +08:00
(Rtvalues(R((s<e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\weakref.pyt valuerefs<66>s
cCsIg}x<|jj<00>D]+}|<00>}|dk r|j|<00>qqW|S(N(RRFR R(RR7RR"((s<e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\weakref.pyRF<00>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<e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\weakref.pyR #s4                 R*cBs&eZdZdZd<00>Zd<00>ZRS(s[Specialized reference that includes a key corresponding to the value.
2014-07-09 18:15:23 +08:00
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.
2014-07-10 23:57:08 +08:00
RcCs"tj|||<00>}||_|S(N(Rt__new__R(RAtobtcallbackRR((s<e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\weakref.pyRMs cCstt|<00>j||<00>dS(N(tsuperR*R(RRNROR((s<e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\weakref.pyR s(skey(RHRIRJt __slots__RMR(((s<e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\weakref.pyR*<00>s cBs<>eZdZdd<00>Zd<00>Zd<00>Zd<00>Zd<00>Zd<00>Z d<00>Z
2014-07-09 18:15:23 +08:00
e
Z d<00>Z dd <00>Z d
<00>Zd <00>Zd <00>Zd <00>Zd<00>Zd<00>ZeZd<00>Zd<00>Zd<00>Zd<00>Zd<00>Zdd<00>Zdd<00>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.
2014-07-10 23:57:08 +08:00
cCsYi|_t|<00>d<00>}||_g|_t<00>|_|dk rU|j|<00>ndS(NcSsB|<00>}|dk r>|jr1|jj|<00>q>|j|=ndS(N(R RRRR(R;RR((s<e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\weakref.pyRs
   (RRRRRRR RC(RRDR((s<e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\weakref.pyRs     cCsH|j}|j}x/|rCy||j<00>=Wqtk
r?qXqWdS(N(RRRR!(RRR((s<e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\weakref.pyR *s    cCs|jt|<00>=dS(N(RR(RR((s<e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\weakref.pyR$7scCs|jt|<00>S(N(RR(RR((s<e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\weakref.pyR#:scCsdt|<00>S(Ns<WeakKeyDictionary at %s>(R((R((s<e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\weakref.pyR)=scCs||jt||j<00><dS(N(RRR(RRR+((s<e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\weakref.pyR,@scCsOt<00>}x?|jj<00>D].\}}|<00>}|dk r|||<qqW|S(N(R
RR.R (RR/RR+R"((s<e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\weakref.pyR0Cs    cCskddlm}|j<00>}xH|jj<00>D]7\}}|<00>}|dk r,|||<00>||<q,q,W|S(Ni<4E><69><EFBFBD><EFBFBD>(R1(R0R1R2RR.R (RR3R1R/RR+R"((s<e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\weakref.pyR4Ms   cCs|jjt|<00>|<00>S(N(RR6R(RRR5((s<e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\weakref.pyR6VscCs2yt|<00>}Wntk
r$dSX||jkS(Ni(Rt TypeErrorR(RRR((s<e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\weakref.pyR'Ys
2014-07-09 18:15:23 +08:00
 cCs2yt|<00>}Wntk
2014-07-10 23:57:08 +08:00
r$dSX||jkS(Ni(RRRR(RRR((s<e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\weakref.pyR&`s
 cCsUg}xH|jj<00>D]7\}}|<00>}|dk r|j||f<00>qqW|S(N(RR.R R(RR7RR+R"((s<e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\weakref.pyR.gs   ccsZt|<00><00>Hx@|jj<00>D]/\}}|<00>}|dk r||fVqqWWdQXdS(N(RRR9R (RRR+R((s<e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\weakref.pyR9os
2014-07-09 18:15:23 +08:00
   ccs6t|<00><00>$x|jj<00>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.
2014-07-10 23:57:08 +08:00
N(RRR:(RR((s<e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\weakref.pyt iterkeyrefsvs
ccsNt|<00><00><x4|jj<00>D]#}|<00>}|dk r|VqqWWdQXdS(N(RRR:R (RRR=((s<e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\weakref.pyR:<00>s
   ccs6t|<00><00>$x|jj<00>D] }|VqWWdQXdS(N(RRR8(RR+((s<e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\weakref.pyR8<00>s cCs |jj<00>S(szReturn a list of weak references to the keys.
2014-07-09 18:15:23 +08:00
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.
2014-07-10 23:57:08 +08:00
(Rtkeys(R((s<e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\weakref.pytkeyrefs<66>s
cCsIg}x<|jj<00>D]+}|<00>}|dk r|j|<00>qqW|S(N(RRTR R(RR7RR"((s<e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\weakref.pyRT<00>s   cCs>x7|jj<00>\}}|<00>}|dk r||fSqdS(N(RR>R (RRR+R"((s<e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\weakref.pyR><00>s
  cGs|jjt|<00>|<00>S(N(RRR(RRR((s<e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\weakref.pyR<00>scCs|jjt||j<00>|<00>S(N(RR?RR(RRR5((s<e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\weakref.pyR?<00>scKs<>|j}|dk rot|d<00>s9ti<00>|<00>}nx3|j<00>D]"\}}||t||j<00><qFWnt|<00>r<>|j|<00>ndS(NR.( RR R@RAR.RRRBRC(RRDRERRR+((s<e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\weakref.pyRC<00>s   N(RHRIRJR RR R$R#R)R,R0RKR4R6R'R&R.R9RSR:RLR8RURTR>RR?RC(((s<e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\weakref.pyR
2014-07-09 18:15:23 +08:00
s2                   (RJRt_weakrefRRRRRRRt _weakrefsetRRt
exceptionsR R t__all__R R*R
2014-07-10 23:57:08 +08:00
(((s<e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\weakref.pyt<module>s 4    <19>