ACC SHELL

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

Ñò
nÄMc@sydZddkZddklZdddgZdefd„ƒYZd	„Zed
„ƒZdefd„ƒYZ	dS(s4Utilities for with-statement contexts.  See PEP 343.iÿÿÿÿN(twrapstcontextmanagertnestedtclosingtGeneratorContextManagercBs)eZdZd„Zd„Zd„ZRS(s%Helper for @contextmanager decorator.cCs
||_dS(N(tgen(tselfR((s /usr/lib/python2.6/contextlib.pyt__init__scCs7y|iiƒSWntj
otdƒ‚nXdS(Nsgenerator didn't yield(Rtnextt
StopIterationtRuntimeError(R((s /usr/lib/python2.6/contextlib.pyt	__enter__scCsÌ|djo8y|iiƒWntj
odSXtdƒ‚n„|djo
|ƒ}ny&|ii|||ƒtdƒ‚Wn@tj
o}||j	Stiƒd|j	o‚qÈnXdS(Nsgenerator didn't stops#generator didn't stop after throw()i(tNoneRRR	R
tthrowtsystexc_info(Rttypetvaluet	tracebacktexc((s /usr/lib/python2.6/contextlib.pyt__exit__s 


(t__name__t
__module__t__doc__RRR(((s /usr/lib/python2.6/contextlib.pyRs		cstˆƒ‡fd†ƒ}|S(sÜ@contextmanager decorator.

    Typical usage:

        @contextmanager
        def some_generator(<arguments>):
            <setup>
            try:
                yield <value>
            finally:
                <cleanup>

    This makes this:

        with some_generator(<arguments>) as <variable>:
            <body>

    equivalent to this:

        <setup>
        try:
            <variable> = <value>
            <body>
        finally:
            <cleanup>

    cstˆ||ŽƒS(N(R(targstkwds(tfunc(s /usr/lib/python2.6/contextlib.pythelperQs(R(RR((Rs /usr/lib/python2.6/contextlib.pyR5scgsòg}g}d}zcyIx=|D]5}|i}|i}|i|ƒƒ|i|ƒqW|VWntiƒ}nXWdxI|oA|iƒ}y||Œo
d}nWq{tiƒ}q{Xq{W|djo|d|d|d‚nXdS(sSupport multiple context managers in a single with-statement.

    Code like this:

        with nested(A, B, C) as (X, Y, Z):
            <body>

    is equivalent to this:

        with A as X:
            with B as Y:
                with C as Z:
                    <body>

    Niii(NNN(NNN(NNN(RRRtappendRRtpop(tmanagerstexitstvarsRtmgrtexittenter((s /usr/lib/python2.6/contextlib.pyRWs0			

cBs)eZdZd„Zd„Zd„ZRS(s2Context to automatically close something at the end of a block.

    Code like this:

        with closing(<module>.open(<arguments>)) as f:
            <block>

    is equivalent to this:

        f = <module>.open(<arguments>)
        try:
            <block>
        finally:
            f.close()

    cCs
||_dS(N(tthing(RR$((s /usr/lib/python2.6/contextlib.pyR”scCs|iS(N(R$(R((s /usr/lib/python2.6/contextlib.pyR–scGs|iiƒdS(N(R$tclose(RR((s /usr/lib/python2.6/contextlib.pyR˜s(RRRRRR(((s /usr/lib/python2.6/contextlib.pyRƒs		(
RRt	functoolsRt__all__tobjectRRRR(((s /usr/lib/python2.6/contextlib.pyt<module>s-	",

ACC SHELL 2018