Using Functions in CPy2PyΒΆ
Functions are lightweight, callable cousing of objects:
- plain functions, behaving like
object
instances twinfunction()
, behaving likeTwinObject
Normal functions live separately in each twinterpreter, and passing them between twinterpreters creates clones.
A twinfunction()
can be passed around transparently;
unlike a TwinObject
, this only affects its nature as being callable.
Other actions, such as assigning attributes, are not transparent across twinterpreters.