Python API: Add support for shared memory prefix