python (3.12.0)

(root)/
lib/
python3.12/
test/
support/
__pycache__/
interpreters.cpython-312.opt-1.pyc

ϑedZddlZddlZddlZddlmZmZddlmZm	Z	m
Z
gdZdddZd	Z
d
ZdZGdd
ZdZdZGddZeZGddeZGddeZy)z"Subinterpreters High Level Module.N)is_shareableRunFailedError)ChannelErrorChannelNotFoundErrorChannelEmptyError)
Interpreterget_currentget_maincreatelist_allSendChannelRecvChannelcreate_channellist_all_channelsrrrrTisolatedcHtj|}t||S)z'Return a new (idle) Python interpreter.r)
_interpretersrr)rids  M/BuggyBox/python/3.12.0/bootstrap/lib/python3.12/test/support/interpreters.pyrrs			x	0BrH--cbtjDcgc]
}t|c}Scc}w)z!Return all existing interpreters.)rrrrs rrrs#&3&<&<&>?KO???s,c@tj}t|S)z)Return the currently running interpreter.)rr	rrs rr	r	"s		"	"	$Br?rc@tj}t|S)zReturn the main interpreter.)rr
rrs rr
r
(s				!Br?rcfeZdZdZdddZdZdZdZedZ	ed	Z
d
ZdZddd
Z
y)rzA single Python interpreter.Nrc|t|ttjfst	d|||_||_yNzid must be an int, got )
isinstanceintr
InterpreterID	TypeError_id	_isolated)selfrrs   r__init__zInterpreter.__init__1s8"sM$?$?@A5bV<==!rctt|j|j}d|j	D}t|jddj|dS)N)rrc30K|]\}}|d|yw)=N).0kvs   r	<genexpr>z'Interpreter.__repr__.<locals>.<genexpr>9s841aQCq,8s(z, ))dictr r#r$itemstype__name__join)r%datakwargss   r__repr__zInterpreter.__repr__7sRs488}t~~>84::<8t*%%&a		&(9':!<<rc,t|jSNhashr#r%s r__hash__zInterpreter.__hash__<DHH~rc`t|tstS|j|jk(Sr:)rrNotImplementedr#r%others  r__eq__zInterpreter.__eq__?s%%-!!99((rc|jSr:r#r=s rrzInterpreter.idExxrcz|j$tj|j|_|jSr:)r$ris_isolatedr#r=s rrzInterpreter.isolatedIs.>>!+66txx@DN~~rc@tj|jS)z<Return whether or not the identified interpreter is running.)r
is_runningr#r=s rrKzInterpreter.is_runningQs''11rc@tj|jS)zFinalize and destroy the interpreter.

        Attempting to destroy the current interpreter results
        in a RuntimeError.
        )rdestroyr#r=s rclosezInterpreter.closeUs$$TXX..r)channelscFtj|j||y)zqRun the given source code in the interpreter.

        This blocks the current Python thread until done.
        N)r
run_stringr#)r%src_strrOs   rrunzInterpreter.run]s
	  7H=r)r4
__module____qualname____doc__r&r8r>rDpropertyrrrKrNrSr*rrrr.sX&'+"=
)2/+/>rrc^tj}t|t|}}||fS)zReturn (recv, send) for a new cross-interpreter channel.

    The channel may be used to pass data safely between interpreters.
    )	_channelsrrr
)cidrecvsends   rrres/



CS!;s#3$D:rcxtjDcgc]}t|t|fc}Scc}w)z4Return a list of (recv, send) for all open channels.)rYrrr
)rZs rrros<!))+-
{3/0---s7c8eZdZdZdZdZdZdZedZ	y)_ChannelEndz/The base class for RecvChannel and SendChannel.cnt|ttjfst	d|||_yr)rr rY	ChannelIDr"r#)r%rs  rr&z_ChannelEnd.__init__xs1"sI$7$7895bV<==rc^t|jdt|jdS)Nz(id=r0)r3r4r r#r=s rr8z_ChannelEnd.__repr__}s(t*%%&d3txx=/;;rc,t|jSr:r;r=s rr>z_ChannelEnd.__hash__r?rct|trt|tstSt|tstS|j|jk(Sr:)rrrAr
r#rBs  rrDz_ChannelEnd.__eq__s?dK(e[1%%E;/!!yyDHH$$rc|jSr:rFr=s rrz_ChannelEnd.idrGrN)
r4rTrUrVr&r8r>rDrWrr*rrr_r_us-9
<%rr_c2eZdZdZedddZefdZy)rz1The receiving end of a cross-interpreter channel.g{Gz?)	_sentinel_delayctj|j|}||ur:tj|tj|j|}||ur:|S)zReturn the next object from the channel.

        This blocks until an object has been sent, if none have been
        sent already.
        )rYr[r#timesleep)r%rgrhobjs    rr[zRecvChannel.recvsQnnTXXy1YJJv..95CY
rc|turtj|jStj|j|S)zReturn the next object from the channel.

        If none have been sent then return the default if one
        is provided or fail with ChannelEmptyError.  Otherwise this
        is the same as recv().
        )_NOT_SETrYr[r#)r%defaults  rrecv_nowaitzRecvChannel.recv_nowaits4h>>$((++>>$((G44rN)r4rTrUrVobjectr[rnrpr*rrrrs; &
#+
5rrceZdZdZdZdZy)r
z/The sending end of a cross-interpreter channel.cntj|j|tjdy)z{Send the object (i.e. its data) to the channel's receiving end.

        This blocks until the object is received.
        N)rYr\r#rjrkr%rls  rr\zSendChannel.sends#
	txx%	

1
rcBtj|j|S)zSend the object to the channel's receiving end.

        If the object is immediately received then return True
        (else False).  Otherwise this is the same as send().
        )rYr\r#rus  rsend_nowaitzSendChannel.send_nowaits~~dhh,,rN)r4rTrUrVr\rwr*rrr
r
s9		-rr
)rVrj_xxsubinterpretersr_xxinterpchannelsrYrrrrr__all__rrr	r
rrrr_rqrnrr
r*rr<module>r{s(*%<
.@
4>4>n-685+58-+-r