May 2018
Intermediate to advanced
380 pages
9h 37m
English
Subinterpreters are able to share data via channels; the Go language does this as well, as the concept comes from Communicating Sequential Processes (CSP), which describes interactions within concurrent systems.
Channels provide two modes: send and receive. In Python's case, one interpreter opens a channel to another. When data is sent, it is actually data derived from an object; when it is received, that data is converted back into the original object. In this way, objects can be passed between different interpreters without actually having access to the objects themselves.
Implicit calls to channels are accomplished via send(), recv(), and close() calls. This eliminates the need for explicit functions such as add_channel() and ...