MCPcopy Index your code
hub / github.com/python/cpython / create

Function create

Lib/test/support/channels.py:47–61  ·  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

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

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…