I have the following foo.pyx file which contains a cdef class:
cdef class Foo:
cdef int test_1(self):
...
return 0
cdef int test_2(self):
...
return 0
And the corresponding foo.pxd:
cdef class Foo:
cdef int test_1(self)
cdef int test_2(self)
I would like to protect my resulting pyd to only export the test_1 function. Because (correct me if I'm wrong) both functions are importable in others pyx file via cimport. To do so they must be "exported" in their pyd, meaning they are available from outside the pyd.
I tried removing test_2 from the declarations (in foo.pxd) but I get a compilation error.
My questions:
- Is there a way to control what is exported from the pyd?
- If not what can I do to protect or obfsucate function names that are exported?
My fear is that someone seeing the exported functions signature of the pyd, would guess what they do.