MCPcopy Index your code
hub / github.com/RustPython/RustPython / create

Function create

Lib/test/support/channels.py:51–65  ·  view source on GitHub ↗

Return (recv, send) for a new cross-interpreter channel. The channel may be used to pass data safely between interpreters. "unbounditems" sets the default for the send end of the channel. See SendChannel.send() for supported values. The default value is UNBOUND, which replaces the

(*, unbounditems=UNBOUND)

Source from the content-addressed store, hash-verified

49
50
51def create(*, unbounditems=UNBOUND):
52 """Return (recv, send) for a new cross-interpreter channel.
53
54 The channel may be used to pass data safely between interpreters.
55
56 "unbounditems" sets the default for the send end of the channel.
57 See SendChannel.send() for supported values. The default value
58 is UNBOUND, which replaces the unbound item when received.
59 """
60 unbound = _serialize_unbound(unbounditems)
61 unboundop, = unbound
62 cid = _channels.create(unboundop, -1)
63 recv, send = RecvChannel(cid), SendChannel(cid)
64 send._set_unbound(unboundop, unbounditems)
65 return recv, send
66
67
68def list_all():

Callers 1

write_profileFunction · 0.50

Calls 5

_serialize_unboundFunction · 0.85
RecvChannelClass · 0.85
SendChannelClass · 0.85
_set_unboundMethod · 0.80
createMethod · 0.45

Tested by

no test coverage detected