Files
loustique-home/venv/lib/python3.11/site-packages/werkzeug/__pycache__/local.cpython-311.pyc

254 lines
31 KiB
Plaintext
Raw Normal View History

2026-03-21 10:53:02 +01:00
<EFBFBD>
<00><><EFBFBD>i<EFBFBD>V<00><01><><00>ddlmZddlZddlZddlZddlZddlmZddl m
Z
ddl m Z ddlm Z ddl mZejrdd lmZdd
lmZdd lmZejd <0C><00>Zejd ejdejf<00><0F><00>Zd%d<14>ZGd<15>d<16><00>ZGd<17>deje<00><00>ZGd<19>d<1A><00>ZGd<1B>d<1C><00>ZGd<1D>de<1E><00>Zd&d <20>Z d'd"<22>Z!Gd#<23>d$eje<00><00>Z"dS)(<28>)<01> annotationsN)<01>
ContextVar<EFBFBD><01>partial)<01>update_wrapper)<01>
attrgetter<EFBFBD>)<01>ClosingIterator)<01> StartResponse)<01>WSGIApplication)<01>WSGIEnvironment<6E>T<>F.)<01>bound<6E>local<61>Local | LocalStack[t.Any]<5D>return<72>Nonec<01>.<00>|<00><00><00>dS)z<>Release the data for the current context in a :class:`Local` or
:class:`LocalStack` without using a :class:`LocalManager`.
This should not be needed for modern use cases, and may be removed
in the future.
.. versionadded:: 0.6.1
N)<01>__release_local__)rs <20>Z/home/maxime/Documents/loustiques-home/venv/lib/python3.11/site-packages/werkzeug/local.py<70> release_localrs<00><00>
<EFBFBD><1B><1B><1D><1D><1D><1D><1D>c<01>V<00>eZdZdZdZddd<08>Zdd
<EFBFBD>Zdd <0B>dd<11>Zdd<12>Zdd<14>Z dd<16>Z
dd<17>Z dS) <20>LocalaqCreate a namespace of context-local data. This wraps a
:class:`ContextVar` containing a :class:`dict` value.
This may incur a performance penalty compared to using individual
context vars, as it has to copy data to avoid mutating the dict
between nested contexts.
:param context_var: The :class:`~contextvars.ContextVar` to use as
storage for this local. If not given, one will be created.
Context vars not created at the global scope may interfere with
garbage collection.
.. versionchanged:: 2.0
Uses ``ContextVar`` instead of a custom storage implementation.
)<01> __storageN<65> context_var<61>#ContextVar[dict[str, t.Any]] | Nonerrc<01><><00>|<01> tdt|<00><00><00>d<02><03><00>}t<00>|d|<01><00>dS)Nzwerkzeug.Local<<3C> >.storage<67>_Local__storage)r<00>id<69>object<63> __setattr__<5F><02>selfrs r<00>__init__zLocal.__init__6sH<00><00> <16> <1E>
%<25>%J<>r<EFBFBD>$<24>x<EFBFBD>x<EFBFBD>%J<>%J<>%J<>K<>K<>K<EFBFBD><0E><1A><1A>4<EFBFBD>!2<>K<EFBFBD>@<40>@<40>@<40>@<40>@r<00>t.Iterator[tuple[str, t.Any]]c<01>t<00>t|j<00>i<00><00><00><00><00><00><00>S<00>N)<04>iterr!<00>get<65>items<6D>r&s r<00>__iter__zLocal.__iter__@s,<00><00><13>D<EFBFBD>N<EFBFBD>&<26>&<26>r<EFBFBD>*<2A>*<2A>0<>0<>2<>2<>3<>3<>3r<00><01>unbound_message<67>name<6D>strr1<00>
str | None<6E>LocalProxy[t.Any]c<01>&<00>t|||<02><01><00>S)z<>Create a :class:`LocalProxy` that access an attribute on this
local namespace.
:param name: Proxy this attribute.
:param unbound_message: The error message that the proxy will
show if the attribute isn't set.
r0<00><01>
LocalProxy<EFBFBD>r&r2r1s r<00>__call__zLocal.__call__Cs<00><00><1A>$<24><04>o<EFBFBD>F<>F<>F<>Frc<01>:<00>|j<00>i<00><00>dSr*)r!<00>setr.s rrzLocal.__release_local__Os<00><00> <0C><0E><1A><1A>2<EFBFBD><1E><1E><1E><1E>r<00>t.Anyc<01>l<00>|j<00>i<00><00>}||vr||St|<01><00><00>r*)r!r,<00>AttributeError<6F>r&r2<00>valuess r<00> __getattr__zLocal.__getattr__Rs8<00><00><15><1E>#<23>#<23>B<EFBFBD>'<27>'<27><06> <0F>6<EFBFBD>><3E>><3E><19>$<24><<3C> <1F><1C>T<EFBFBD>"<22>"<22>"r<00>valuec<01><><00>|j<00>i<00><00><00><00><00>}|||<|j<00>|<03><00>dSr*)r!r,<00>copyr<)r&r2rCrAs rr$zLocal.__setattr__ZsH<00><00><15><1E>#<23>#<23>B<EFBFBD>'<27>'<27>,<2C>,<2C>.<2E>.<2E><06><1C><06>t<EFBFBD> <0C> <0C><0E><1A><1A>6<EFBFBD>"<22>"<22>"<22>"<22>"rc<01><><00>|j<00>i<00><00>}||vr3|<02><00><00>}||=|j<00>|<02><00>dSt |<01><00><00>r*)r!r,rEr<r?r@s r<00> __delattr__zLocal.__delattr___s^<00><00><15><1E>#<23>#<23>B<EFBFBD>'<27>'<27><06> <0F>6<EFBFBD>><3E>><3E><1B>[<5B>[<5B>]<5D>]<5D>F<EFBFBD><16>t<EFBFBD> <0C> <10>N<EFBFBD> <1E> <1E>v<EFBFBD> &<26> &<26> &<26> &<26> &<26> <20><14>&<26>&<26> &rr*)rrrr)rr()r2r3r1r4rr5<00>rr)r2r3rr=)r2r3rCr=rr)r2r3rr) <0C>__name__<5F>
__module__<EFBFBD> __qualname__<5F>__doc__<5F> __slots__r'r/r:rrBr$rG<00>rrrr#s<><00><00><00><00><00><00><08><08> <1F>I<EFBFBD>A<01>A<01>A<01>A<01>A<01>4<>4<>4<>4<>;?<3F>
G<01>
G<01>
G<01>
G<01>
G<01>
G<01><1F><1F><1F><1F>#<23>#<23>#<23>#<23>#<23>#<23>#<23>#<23>
'<27>'<27>'<27>'<27>'<27>'rrc<01>b<00>eZdZdZdZddd<08>Zdd <09>Zdd <0A>Zdd<0F>Ze dd<10><04><00>Z
ddd<11>dd<16>Z dS)<1D>
LocalStacka<EFBFBD>Create a stack of context-local data. This wraps a
:class:`ContextVar` containing a :class:`list` value.
This may incur a performance penalty compared to using individual
context vars, as it has to copy data to avoid mutating the list
between nested contexts.
:param context_var: The :class:`~contextvars.ContextVar` to use as
storage for this local. If not given, one will be created.
Context vars not created at the global scope may interfere with
garbage collection.
.. versionchanged:: 2.0
Uses ``ContextVar`` instead of a custom storage implementation.
.. versionadded:: 0.6.1
)<01>_storageNr<00>ContextVar[list[T]] | Nonerrc<01>X<00>|<01> tdt|<00><00><00>d<02><03><00>}||_dS)Nzwerkzeug.LocalStack<r )rr"rQr%s rr'zLocalStack.__init__s4<00><00> <16> <1E>
%<25>%O<>B<EFBFBD>t<EFBFBD>H<EFBFBD>H<EFBFBD>%O<>%O<>%O<>P<>P<>K<EFBFBD>#<23><04> <0A> <0A> rc<01>:<00>|j<00>g<00><00>dSr*)rQr<r.s rrzLocalStack.__release_local__<5F>s<00><00> <0C> <0A><19><19>"<22><1D><1D><1D><1D>r<00>objr<00>list[T]c<01><><00>|j<00>g<00><00><00><00><00>}|<02>|<01><00>|j<00>|<02><00>|S)z'Add a new item to the top of the stack.)rQr,rE<00>appendr<)r&rU<00>stacks r<00>pushzLocalStack.push<73>sP<00><00><14> <0A>!<21>!<21>"<22>%<25>%<25>*<2A>*<2A>,<2C>,<2C><05> <0A> <0C> <0C>S<EFBFBD><19><19><19> <0C> <0A><19><19>%<25> <20> <20> <20><14> r<00>T | Nonec<01><><00>|j<00>g<00><00>}t|<01><00>dkrdS|d}|j<00>|dd<03><00><00>|S)zjRemove the top item from the stack and return it. If the
stack is empty, return ``None``.
rN<><4E><EFBFBD><EFBFBD><EFBFBD>)rQr,<00>lenr<)r&rY<00>rvs r<00>popzLocalStack.pop<6F>sY<00><00><15> <0A>!<21>!<21>"<22>%<25>%<25><05> <0E>u<EFBFBD>:<3A>:<3A><11>?<3F>?<3F><17>4<EFBFBD> <12>2<EFBFBD>Y<EFBFBD><02> <0C> <0A><19><19>%<25><03><12><03>*<2A>%<25>%<25>%<25><11> rc<01>p<00>|j<00>g<00><00>}t|<01><00>dkrdS|dS)z[The topmost item on the stack. If the stack is empty,
`None` is returned.
rNr])rQr,r^)r&rYs r<00>topzLocalStack.top<6F>s7<00><00>
<15> <0A>!<21>!<21>"<22>%<25>%<25><05> <0E>u<EFBFBD>:<3A>:<3A><11>?<3F>?<3F><17>4<EFBFBD><14>R<EFBFBD>y<EFBFBD>rr0r2r4r1r5c<01>&<00>t|||<02><01><00>S)a@Create a :class:`LocalProxy` that accesses the top of this
local stack.
:param name: If given, the proxy access this attribute of the
top item, rather than the item itself.
:param unbound_message: The error message that the proxy will
show if the stack is empty.
r0r7r9s rr:zLocalStack.__call__<5F>s<00><00><1A>$<24><04>o<EFBFBD>F<>F<>F<>Frr*)rrRrrrH)rUrrrV)rr[)r2r4r1r4rr5) rIrJrKrLrMr'rrZr`<00>propertyrbr:rNrrrPrPjs<><00><00><00><00><00><00><08><08>$<1E>I<EFBFBD>$<24>$<24>$<24>$<24>$<24><1E><1E><1E><1E><15><15><15><15> <12> <12> <12> <12><0E> <19> <19> <19><0E>X<EFBFBD> <19>"&<26> G<01>HL<48> G<01> G<01> G<01> G<01> G<01> G<01> G<01> GrrPc<01>B<00>eZdZdZdZ ddd<08>Zdd <09>Zdd <0C>Zdd<0E>Zdd<10>Z dS)<17> LocalManageraManage releasing the data for the current context in one or more
:class:`Local` and :class:`LocalStack` objects.
This should not be needed for modern use cases, and may be removed
in the future.
:param locals: A local or list of locals to manage.
.. versionchanged:: 2.1
The ``ident_func`` was removed.
.. versionchanged:: 0.7
The ``ident_func`` parameter was added.
.. versionchanged:: 0.6.1
The :func:`release_local` function can be used instead of a
manager.
)<01>localsNrg<00>JNone | (Local | LocalStack[t.Any] | t.Iterable[Local | LocalStack[t.Any]])rrc<01><><00>|<01> g|_dSt|t<00><00>r
|g|_dSt|<01><00>|_dSr*)rg<00>
isinstancer<00>list)r&rgs rr'zLocalManager.__init__<5F>sD<00><00>
<12>><3E><1C>D<EFBFBD>K<EFBFBD>K<EFBFBD>K<EFBFBD> <17><06><05> &<26> &<26> '<27>!<21>(<28>D<EFBFBD>K<EFBFBD>K<EFBFBD>K<EFBFBD><1E>v<EFBFBD>,<2C>,<2C>D<EFBFBD>K<EFBFBD>K<EFBFBD>Krc<01>8<00>|jD]}t|<01><00><00>dS)z<>Release the data in the locals for this context. Call this at
the end of each request or use :meth:`make_middleware`.
N)rgr)r&rs r<00>cleanupzLocalManager.cleanup<75>s0<00><00><1A>[<5B> !<21> !<21>E<EFBFBD> <19>%<25> <20> <20> <20> <20> !<21> !r<00>appr c<01><00><00><01>d<08><01>fd<07> }|S) z<>Wrap a WSGI application so that local data is released
automatically after the response has been sent for a request.
<20>environr <00>start_responser r<00>t.Iterable[bytes]c<01>B<00><02>t<00>||<01><00><00>j<00><00>Sr*)r
rm)rprqrnr&s <20><>r<00> applicationz1LocalManager.make_middleware.<locals>.application<6F>s#<00><><00>#<23>3<EFBFBD>3<EFBFBD>w<EFBFBD><0E>#?<3F>#?<3F><14><1C>N<>N<> Nr)rpr rqr rrrrN)r&rnrts`` r<00>make_middlewarezLocalManager.make_middleware<72>s6<00><><EFBFBD><00>
 O<01> O<01> O<01> O<01> O<01> O<01> O<01>
<1B>r<00>funcc<01>H<00>t|<00>|<01><00>|<01><00>S)z<>Like :meth:`make_middleware` but used as a decorator on the
WSGI application function.
.. code-block:: python
@manager.middleware
def application(environ, start_response):
...
)rru)r&rvs r<00>
middlewarezLocalManager.middleware<72>s"<00><00><1E>d<EFBFBD>2<>2<>4<EFBFBD>8<>8<>$<24>?<3F>?<3F>?rr3c<01>\<00>dt|<00><00>j<00>dt|j<00><00><00>d<03>S)N<><z storages: <20>>)<04>typerIr^rgr.s r<00>__repr__zLocalManager.__repr__<5F>s.<00><00>F<>4<EFBFBD><04>:<3A>:<3A>&<26>F<>F<>3<EFBFBD>t<EFBFBD>{<7B>3C<33>3C<33>F<>F<>F<>Frr*)rgrhrrrH)rnr rr )rvr rr <00>rr3)
rIrJrKrLrMr'rmrurxr}rNrrrfrf<00>s<><00><00><00><00><00><00><08><08>&<1C>I<EFBFBD>
QU<01>
'<27>
'<27>
'<27>
'<27>
'<27>!<21>!<21>!<21>!<21>
<1B>
<1B>
<1B>
<1B>
@<01>
@<01>
@<01>
@<01>G<01>G<01>G<01>G<01>G<01>Grrfc<01>J<00>eZdZdZdZ ddd<0F>Zdd<14>Zd d!d<18>Zd"d<19>Zd#d<1C>Z dS)$<24> _ProxyLookupa<70>Descriptor that handles proxied attribute lookup for
:class:`LocalProxy`.
:param f: The built-in function this attribute is accessed through.
Instead of looking up the special method, the function call
is redone on the object.
:param fallback: Return this function if the proxy is unbound
instead of raising a :exc:`RuntimeError`.
:param is_attr: This proxied name is an attribute, not a function.
Call the fallback immediately to get the value.
:param class_value: Value to return when accessed from the
``LocalProxy`` class directly. Used for ``__doc__`` so building
docs still works.
)<05>bind_f<5F>fallback<63>is_attr<74> class_valuer2NF<4E>f<>t.Callable[..., t.Any] | Noner<65><00>-t.Callable[[LocalProxy[t.Any]], t.Any] | Noner<65><00> t.Any | Noner<65><00>boolrrc<01><><00><01>t<00>d<01><00>rd
<EFBFBD>fd<08> }n <0B><01>d
<EFBFBD>fd <09> }nd}||_||_||_||_dS) N<>__get__<5F>instancer5rUr=r<00>t.Callable[..., t.Any]c<01>J<00><01><00><02>|t|<01><00><00><00>Sr*<00>r<>r|<00>r<>rUr<>s <20>rr<>z%_ProxyLookup.__init__.<locals>.bind_fs<00><><00><19>y<EFBFBD>y<EFBFBD><13>d<EFBFBD>3<EFBFBD>i<EFBFBD>i<EFBFBD>0<>0<>0rc<01>$<00><01>t<00>|<01><00>Sr*rr<>s <20>rr<>z%_ProxyLookup.__init__.<locals>.bind_f%s<00><><00><1F>q<EFBFBD>#<23><EFBFBD><EFBFBD>&r<00>r<>r5rUr=rr<>)<05>hasattrr<72>r<>r<>r<>)r&r<>r<>r<>r<>r<>s ` rr'z_ProxyLookup.__init__s<><00><><00> <13>1<EFBFBD>i<EFBFBD> <20> <20> <1A> 1<> 1<> 1<> 1<> 1<> 1<> 1<>
<0F>]<5D> '<27> '<27> '<27> '<27> '<27> '<27> '<27><1A>F<EFBFBD><1C><04> <0B> <20><04> <0A>&<26><04><18><1E><04> <0C> <0C> r<00>ownerr5r2r3c<01><00>||_dSr*<00>r2)r&r<>r2s r<00> __set_name__z_ProxyLookup.__set_name__3s <00><00><18><04> <09> <09> rr<><00> type | Noner=c<01>F<00>|<01>|j<00>|jS|S |<01><00><00>}nH#t$r;|j<00><01>|j<00>||<02><00>}|jr |<04><00>cYS|cYSwxYw|j<00>|<00>||<03><00>St||j<00><00>Sr*) r<><00>_get_current_object<63> RuntimeErrorr<72>r<>r<>r<><00>getattrr2)r&r<>r<>rUr<>s rr<>z_ProxyLookup.__get__6s<><00><00> <13> <1B><13><1F>+<2B><1B>'<27>'<27><17>K<EFBFBD> <1C><1A>.<2E>.<2E>0<>0<>C<EFBFBD>C<EFBFBD><43><1B> <1C> <1C> <1C><13>}<7D>$<24><15><1B>}<7D>,<2C>,<2C>X<EFBFBD>u<EFBFBD>=<3D>=<3D>H<EFBFBD><13>|<7C> "<22> <20>x<EFBFBD>z<EFBFBD>z<EFBFBD>!<21>!<21>!<21><1B>O<EFBFBD>O<EFBFBD>O<EFBFBD> <1C><><EFBFBD><EFBFBD> <10>;<3B> "<22><17>;<3B>;<3B>x<EFBFBD><13>-<2D>-<2D> -<2D><16>s<EFBFBD>D<EFBFBD>I<EFBFBD>&<26>&<26>&s<00>)<00>>A.<03>)A.<03>-A.c<01><00>d|j<00><00>S)Nzproxy r<>r.s rr}z_ProxyLookup.__repr__Qs<00><00>#<23><04> <09>#<23>#<23>#r<00>args<67>kwargsc<01>T<00>|<00>|t|<01><00><00><00>|i|<03><01>S)z<>Support calling unbound methods from the class. For example,
this happens with ``copy.copy``, which does
``type(x).__copy__(x)``. ``type(x)`` can't be proxied, so it
returns the proxy type and descriptor.
r<>)r&r<>r<>r<>s rr:z_ProxyLookup.__call__Ts-<00><00>6<>t<EFBFBD>|<7C>|<7C>H<EFBFBD>d<EFBFBD>8<EFBFBD>n<EFBFBD>n<EFBFBD>5<>5<>t<EFBFBD>F<>v<EFBFBD>F<>F<>Fr)NNNF)
r<EFBFBD>r<>r<>r<>r<>r<>r<>r<>rr)r<>r5r2r3rrr*)r<>r5r<>r<>rr=r~)r<>r5r<>r=r<>r=rr=)
rIrJrKrLrMr'r<>r<>r}r:rNrrr<>r<><00>s<><00><00><00><00><00><00> <08> <08>I<01>I<EFBFBD>,0<>BF<42>$(<28><1D> <1F> <1F> <1F> <1F> <1F>D<19><19><19><19>'<27>'<27>'<27>'<27>'<27>6$<24>$<24>$<24>$<24>G<01>G<01>G<01>G<01>G<01>Grr<>c<01>.<00><00>eZdZdZdZ d d <0C>fd
<EFBFBD> Z<05>xZS) <0A> _ProxyIOpz<70>Look up an augmented assignment method on a proxied object. The
method is wrapped to return the proxy instead of the object.
rNNr<4E>r<>r<>r<>rrc<01>h<00><01><01>t<00><00><00><00>|<02><00>d<08>fd<07> }||_dS) Nr<4E>r5rUr=rr<>c<01>Z<00><01><00>d<07><03>fd<06> }|<02>|t|<01><00><00><00>S)Nr&r=<00>otherrr5c<01> <00><02><00>||<01><00><00>Sr*rN)r&r<>r<>r<>s <20><>r<00>i_opz0_ProxyIOp.__init__.<locals>.bind_f.<locals>.i_opns<00><><00><11><01>$<24><05><0E><0E><0E><1F>r)r&r=r<>r=rr5r<>)r<>rUr<>r<>s` <20>rr<>z"_ProxyIOp.__init__.<locals>.bind_fmsC<00><><EFBFBD><00> <20> <20> <20> <20> <20> <20> <20><18><<3C><<3C><03>T<EFBFBD>#<23>Y<EFBFBD>Y<EFBFBD>/<2F>/<2F> /rr<>)<03>superr'r<>)r&r<>r<>r<><00> __class__s ` <20>rr'z_ProxyIOp.__init__fsK<00><><EFBFBD><00>
<0E><07><07><18><18><11>H<EFBFBD>%<25>%<25>%<25> 0<> 0<> 0<> 0<> 0<> 0<><1D><04> <0B> <0B> r)NN)r<>r<>r<>r<>rr)rIrJrKrLrMr'<00> __classcell__)r<>s@rr<>r<>_s[<00><><00><00><00><00><00><08><08><13>I<EFBFBD>,0<>BF<42><1D><1D><1D><1D><1D><1D><1D><1D><1D><1D>rr<><00>opc<01>D<00><00>d<06>fd<05> }tjt|<01><00>S)z5Swap the argument order to turn an l-op into an r-op.rUr=r<>rc<01><00><01><00>||<00><00>Sr*rN)rUr<>r<>s <20>r<00>r_opz_l_to_r_op.<locals>.r_opzs<00><><00><11>r<EFBFBD>%<25><13>~<7E>~<7E>r)rUr=r<>r=rr=)<03>t<>castr)r<>r<>s` r<00>
_l_to_r_opr<EFBFBD>ws3<00><><00><1E><1E><1E><1E><1E><1E> <0A>6<EFBFBD>!<21>T<EFBFBD>?<3F>?<3F>r<00>oc<01><00>|Sr*rN)r<>s r<00> _identityr<79><00>s<00><00> <0C>Hrc<01><> <00>eZdZUdZdZded< ddd<06>dd<0E>Zeed<0F>d<10><11><00>Zed<12>d<10><13><00>Zee d<14><00><15><00>Z
ee <0B><00>Z ee <0A><00>Ze<07><00>Zeej<00><00>Zeej<00><00>Zeej<00><00>Zeej<00><00>Zeej<00><00>Zeej<00><00>Zee<1D><00>Zeed<16><00><15><00>Z ee!<21><00>Z"ee#<23><00>Z$ee%<25><00>Z&ee'd<17><00><15><00>Z(ed<18>d<10><13><00>Z)ed<19><00><00>Z*ed<1A><00><00>Z+ed<1B><00><00>Z,ee-<2D><00>Z.eej/<00><00>Z0eej1<00><00>Z2eej3<00><00>Z4eej5<00><00>Z6ee7<65><00>Z8ee9<65><00>Z:ee;<3B><00>Z<eej=<00><00>Z>eej?<00><00>Z@eejA<00><00>ZBeejC<00><00>ZDeejE<00><00>ZFeejG<00><00>ZHeejI<00><00>ZJeejK<00><00>ZLeeM<65><00>ZNeeO<65><00>ZPeejQ<00><00>ZReejS<00><00>ZTeejU<00><00>ZVeejW<00><00>ZXeejY<00><00>ZZee[ej?<00><00><00><00>Z\ee[ejA<00><00><00><00>Z]ee[ejC<00><00><00><00>Z^ee[ejE<00><00><00><00>Z_ee[ejG<00><00><00><00>Z`ee[ejI<00><00><00><00>Zaee[ejK<00><00><00><00>Zbee[eM<65><00><00><00>Zcee[eO<65><00><00><00>Zdee[ejQ<00><00><00><00>Zeee[ejS<00><00><00><00>Zfee[ejU<00><00><00><00>Zgee[ejW<00><00><00><00>Zhee[ejY<00><00><00><00>Ziejejk<00><00>Zlejejm<00><00>Znejejo<00><00>Zpejejq<00><00>Zrejejs<00><00>Ztejeju<00><00>Zvejejw<00><00>Zxejejy<00><00>Zzejej{<00><00>Z|ejej}<00><00>Z~ejej<00><00>Z<>ejej<><00><00>Z<>ejej<><00><00>Z<>eej<><00><00>Z<>eej<><00><00>Z<>ee<><65><00>Z<>eej<><00><00>Z<>ee<><65><00>Z<>ee<><65><00>Z<>ee<><65><00>Z<>eej<><00><00>Z<>ee<><65><00>Z<>ee<>j<EFBFBD><00><00>Z<>ee<>j<EFBFBD><00><00>Z<>ee<>j<EFBFBD><00><00>Z<>e<07><00>Z<>e<07><00>Z<>e<07><00>Z<>e<07><00>Z<>e<07><00>Z<>e<07><00>Z<>e<07><00>Z<>ee<>j<EFBFBD><00><00>Z<>ee<>j<EFBFBD><00><00>Z<>dS)r8as A proxy to the object bound to a context-local object. All
operations on the proxy are forwarded to the bound object. If no
object is bound, a ``RuntimeError`` is raised.
:param local: The context-local object that provides the proxied
object.
:param name: Proxy this attribute from the proxied object.
:param unbound_message: The error message to show if the
context-local object is unbound.
Proxy a :class:`~contextvars.ContextVar` to make it easier to
access. Pass a name to proxy that attribute.
.. code-block:: python
_request_var = ContextVar("request")
request = LocalProxy(_request_var)
session = LocalProxy(_request_var, "session")
Proxy an attribute on a :class:`Local` namespace by calling the
local with the attribute name:
.. code-block:: python
data = Local()
user = data("user")
Proxy the top item on a :class:`LocalStack` by calling the local.
Pass a name to proxy that attribute.
.. code-block::
app_stack = LocalStack()
current_app = app_stack()
g = app_stack("g")
Pass a function to proxy the return value from that function. This
was previously used to access attributes of local objects before
that was supported directly.
.. code-block:: python
session = LocalProxy(lambda: request.session)
``__repr__`` and ``__class__`` are proxied, so ``repr(x)`` and
``isinstance(x, cls)`` will look like the proxied object. Use
``issubclass(type(x), LocalProxy)`` to check if an object is a
proxy.
.. code-block:: python
repr(user) # <User admin>
isinstance(user, User) # True
issubclass(type(user), LocalProxy) # True
.. versionchanged:: 2.2.2
``__wrapped__`` is set when wrapping an object, not only when
wrapping a function, to prevent doctest from failing.
.. versionchanged:: 2.2
Can proxy a ``ContextVar`` or ``LocalStack`` directly.
.. versionchanged:: 2.2
The ``name`` parameter can be used with any proxied object, not
only ``Local``.
.. versionchanged:: 2.2
Added the ``unbound_message`` parameter.
.. versionchanged:: 2.0
Updated proxied attributes and methods to reflect the current
data model.
.. versionchanged:: 0.6.1
The class can be instantiated with a callable.
)<02> __wrappedr<64>zt.Callable[[], T]r<>Nr0r<00>9ContextVar[T] | Local | LocalStack[T] | t.Callable[[], T]r2r4r1rrc<01><><00><01><03><05>|<02>t<00>nt|<02><00><00><05><03>d<01>t<00>t<00><00>r|<02>t d<02><00><00>d <0A><05><01>fd<05> }nst<00>t
<00><00>r d <0A><05><01>fd<06> }nUt<00>t <00><00>r d <0A><05><01>fd<07> }n7t<00><01><00>rd <0A><05>fd<08> }n t d t<00><01><00><00>d
<EFBFBD><03><00><00>t<00>
|d <0B><01><00>t<00>
|d |<04><00>dS)Nzobject is not boundz2'name' is required when proxying a 'Local' object.rrc<01>X<00><03> <00><00><01><00>S#t$rt<00><02><00>d<00>wxYwr*)r?r<>)<03>get_namerr1s<00><><EFBFBD>rr<>z0LocalProxy.__init__.<locals>._get_current_object<63>sF<00><><00>B<01>#<23>8<EFBFBD>E<EFBFBD>?<3F>?<3F>*<2A><>%<25>B<01>B<01>B<01>&<26><EFBFBD>7<>7<>T<EFBFBD>A<>B<01><><EFBFBD>s<00>
<00>)c<01>J<00><03><00>j}|<00>t<00><03><00><00><00>|<00><00>Sr*)rbr<><00>rUr<>rr1s <20><><EFBFBD>rr<>z0LocalProxy.__init__.<locals>._get_current_object<63>s+<00><><00><1B>i<EFBFBD><03><16>;<3B>&<26><EFBFBD>7<>7<>7<><1F>x<EFBFBD><03>}<7D>}<7D>$rc<01><><00><03> <00><02><00><00>}n#t$rt<00><03><00>d<00>wxYw<00>|<00><00>Sr*)r,<00> LookupErrorr<72>r<>s <20><><EFBFBD>rr<>z0LocalProxy.__init__.<locals>._get_current_objectsW<00><><00>B<01><1F>)<29>)<29>+<2B>+<2B>C<EFBFBD>C<EFBFBD><43>"<22>B<01>B<01>B<01>&<26><EFBFBD>7<>7<>T<EFBFBD>A<>B<01><><EFBFBD><EFBFBD> <20>x<EFBFBD><03>}<7D>}<7D>$s<00><00>3c<01>*<00><02><00><00><01><00><00><00>Sr*rN)r<>rs<00><>rr<>z0LocalProxy.__init__.<locals>._get_current_object s<00><><00><1F>x<EFBFBD><05><05><07><07>(<28>(<28>(rzDon't know how to proxy 'z'.<2E>_LocalProxy__wrappedr<64>)rr) r<>rrjr<00> TypeErrorrPr<00>callabler|r#r$)r&rr2r1r<>r<>s ` ` @rr'zLocalProxy.__init__<5F>s<><00><><EFBFBD><EFBFBD><00> <10><<3C> <20>H<EFBFBD>H<EFBFBD>!<21>$<24>'<27>'<27>H<EFBFBD> <1A> "<22>3<>O<EFBFBD> <15>e<EFBFBD>U<EFBFBD> #<23> #<23>$ I<01><13>|<7C><1F> T<>U<>U<>U<> B<01> B<01> B<01> B<01> B<01> B<01> B<01> B<01> B<01> <18><05>z<EFBFBD> *<2A> *<2A> I<01> %<25> %<25> %<25> %<25> %<25> %<25> %<25> %<25> %<25><18><05>z<EFBFBD> *<2A> *<2A> I<01> %<25> %<25> %<25> %<25> %<25> %<25> %<25> %<25> %<25><16>e<EFBFBD>_<EFBFBD>_<EFBFBD> I<01> )<29> )<29> )<29> )<29> )<29> )<29> )<29> )<29><1C>G<><04>U<EFBFBD> <0B> <0B>G<>G<>G<>H<>H<> H<><0E><1A><1A>4<EFBFBD>!7<><15>?<3F>?<3F>?<3F><0E><1A><1A>4<EFBFBD>!6<>8K<38>L<>L<>L<>L<>Lrc<01>*<00>t|<00><00>jSr*)r|rLr.s r<00><lambda>zLocalProxy.<lambda>s<00><00>4<EFBFBD><04>:<3A>:<3A>3E<33>rT)r<>r<>r<>c<01><00>|jSr*)r<>r.s rr<>zLocalProxy.<lambda>s <00><00>d<EFBFBD>7<>r)r<>r<>c<01>2<00>dt|<00><00>j<00>d<02>S)Nrzz unbound>)r|rIr.s rr<>zLocalProxy.<lambda>s<00><00>$F<><04>T<EFBFBD>
<EFBFBD>
<EFBFBD>(;<3B>$F<>$F<>$F<>r)r<>c<01><00>dS)NFrNr.s rr<>zLocalProxy.<lambda>+s<00><00><05>rc<01><00>gSr*rNr.s rr<>zLocalProxy.<lambda>0s<00><00>b<EFBFBD>rc<01> <00>t|<00><00>Sr*)r|r.s rr<>zLocalProxy.<lambda>;s <00><00>4<EFBFBD><04>:<3A>:<3A>rc<01>"<00>t||<00><00>Sr*)rj<00>r&r<>s rr<>zLocalProxy.<lambda><<00><00><00><1A>E<EFBFBD>4<EFBFBD>9P<39>9P<39>rc<01>"<00>t||<00><00>Sr*)<01>
issubclassr<EFBFBD>s rr<>zLocalProxy.<lambda>=r<>rc<01><00>||i|<02><01>Sr*rN)r&r<>r<>s rr<>zLocalProxy.<lambda>?s<00><00>$<24>$<24><04>:O<><06>:O<>:O<>rr*)rr<>r2r4r1r4rr)<29>rIrJrKrLrM<00>__annotations__r'r<><00> __wrapped__<5F>reprr}r3<00>__str__<5F>bytes<65> __bytes__<5F>
__format__<EFBFBD>operator<6F>lt<6C>__lt__<5F>le<6C>__le__<5F>eq<65>__eq__<5F>ne<6E>__ne__<5F>gt<67>__gt__<5F>ge<67>__ge__<5F>hash<73>__hash__r<5F><00>__bool__r<5F>rB<00>setattrr$<00>delattrrG<00>dir<69>__dir__r<5F><00>__instancecheck__<5F>__subclasscheck__r:r^<00>__len__<5F> length_hint<6E>__length_hint__<5F>getitem<65> __getitem__<5F>setitem<65> __setitem__<5F>delitem<65> __delitem__r+r/<00>next<78>__next__<5F>reversed<65> __reversed__<5F>contains<6E> __contains__<5F>add<64>__add__<5F>sub<75>__sub__<5F>mul<75>__mul__<5F>matmul<75>
__matmul__<EFBFBD>truediv<69> __truediv__<5F>floordiv<69> __floordiv__<5F>mod<6F>__mod__<5F>divmod<6F>
__divmod__<EFBFBD>pow<6F>__pow__<5F>lshift<66>
__lshift__<EFBFBD>rshift<66>
__rshift__<EFBFBD>and_<64>__and__<5F>xor<6F>__xor__<5F>or_<72>__or__r<5F><00>__radd__<5F>__rsub__<5F>__rmul__<5F> __rmatmul__<5F> __rtruediv__<5F> __rfloordiv__<5F>__rmod__<5F> __rdivmod__<5F>__rpow__<5F> __rlshift__<5F> __rrshift__<5F>__rand__<5F>__rxor__<5F>__ror__r<5F><00>iadd<64>__iadd__<5F>isub<75>__isub__<5F>imul<75>__imul__<5F>imatmul<75> __imatmul__<5F>itruediv<69> __itruediv__<5F> ifloordiv<69> __ifloordiv__<5F>imod<6F>__imod__<5F>ipow<6F>__ipow__<5F>ilshift<66> __ilshift__<5F>irshift<66> __irshift__<5F>iand<6E>__iand__<5F>ixor<6F>__ixor__<5F>ior<6F>__ior__<5F>neg<65>__neg__<5F>pos<6F>__pos__<5F>abs<62>__abs__<5F>invert<72>
__invert__<EFBFBD>complex<65> __complex__<5F>int<6E>__int__<5F>float<61> __float__<5F>index<65> __index__<5F>round<6E> __round__<5F>math<74>trunc<6E> __trunc__<5F>floor<6F> __floor__<5F>ceil<69>__ceil__<5F> __enter__<5F>__exit__<5F> __await__<5F> __aiter__<5F> __anext__<5F>
__aenter__<EFBFBD> __aexit__rE<00>__copy__<5F>deepcopy<70> __deepcopy__rNrrr8r8<00>s*<00><00><00><00><00><00><00>K<08>K<08>Z5<>I<EFBFBD>*<2A>*<2A>*<2A>*<2A><08> <20>6M<01>
'+<2B> 6M<01>6M<01>6M<01>6M<01>6M<01>6M<01>p<1B>l<EFBFBD><1B>&E<>&E<>t<EFBFBD><06><06><06>G<EFBFBD><1F>,<2C>7<>7<><14><06><06><06>K<EFBFBD>
<1C>|<7C> <0C>F<>F<><06><06><06>H<EFBFBD><1B>l<EFBFBD>3<EFBFBD><1F><1F>G<EFBFBD><1C> <0C>U<EFBFBD>#<23>#<23>I<EFBFBD><1D><1C><1E><1E>J<EFBFBD> <19>\<5C>(<28>+<2B> &<26> &<26>F<EFBFBD> <19>\<5C>(<28>+<2B> &<26> &<26>F<EFBFBD> <19>\<5C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> <0C>T<EFBFBD>Z<EFBFBD>(<28>(<28>I<EFBFBD><1B>|<7C>D<EFBFBD>I<EFBFBD>&<26>&<26>H<EFBFBD><1C> <0C><0E><0E>I<EFBFBD><1B>|<7C>~<7E>~<7E>H<EFBFBD><1C> <0C><0E><0E>I<EFBFBD><1C> <0C><0E><0E>I<EFBFBD><1C> <0C><0E><0E>I<EFBFBD><1D><1C><1E><1E>J<EFBFBD><1C> <0C><0E><0E>I<EFBFBD><1B>|<7C>D<EFBFBD>I<EFBFBD>&<26>&<26>H<EFBFBD><1F><<3C><04> <0A>.<2E>.<2E>L<EFBFBD>L<EFBFBD>Lrr8)rrrr)r<>rrr)r<>rrr)#<23>
__future__rrErRr<><00>typingr<67><00> contextvarsr<00> functoolsrrr<00>wsgir
<00> TYPE_CHECKING<4E>_typeshed.wsgir r r <00>TypeVarr<00>Callable<6C>Anyrrr<00>GenericrPrfr<>r<>r<>r<>r8rNrr<00><module>rns<><00><01>"<22>"<22>"<22>"<22>"<22>"<22> <0B> <0B> <0B> <0B> <0B> <0B> <0B> <0B><0F><0F><0F><0F><12><12><12><12>"<22>"<22>"<22>"<22>"<22>"<22><1D><1D><1D><1D><1D><1D>$<24>$<24>$<24>$<24>$<24>$<24><1F><1F><1F><1F><1F><1F>!<21>!<21>!<21>!<21>!<21>!<21><04>?<3F>/<2F>,<2C>,<2C>,<2C>,<2C>,<2C>,<2C>.<2E>.<2E>.<2E>.<2E>.<2E>.<2E>.<2E>.<2E>.<2E>.<2E>.<2E>.<2E> <0A>A<EFBFBD>I<EFBFBD>c<EFBFBD>N<EFBFBD>N<EFBFBD><01> <0A>A<EFBFBD>I<EFBFBD>c<EFBFBD><11><1A>C<EFBFBD><11><15>J<EFBFBD>/<2F>0<>0<>0<><01> <1E> <1E> <1E> <1E>D'<27>D'<27>D'<27>D'<27>D'<27>D'<27>D'<27>D'<27>NMG<01>MG<01>MG<01>MG<01>MG<01><11><19>1<EFBFBD><1C>MG<01>MG<01>MG<01>`BG<01>BG<01>BG<01>BG<01>BG<01>BG<01>BG<01>BG<01>J]G<01>]G<01>]G<01>]G<01>]G<01>]G<01>]G<01>]G<01>@<1D><1D><1D><1D><1D> <0C><1D><1D><1D>0<1B><1B><1B><1B> <0A> <0A> <0A> <0A>C/<2F>C/<2F>C/<2F>C/<2F>C/<2F><11><19>1<EFBFBD><1C>C/<2F>C/<2F>C/<2F>C/<2F>C/r