Limit interface exposed in pyd file?

27 views
Skip to first unread message

Czarek

unread,
Nov 27, 2011, 3:34:00 AM11/27/11
to cython-users
Is there a way to limit what functions are exposed in generated .pyd
file? I'm using Cython as a way to hide my sources better, as .pyc
files are easier to decode (they even keep all multiline comments).
What I really need is to include .pyd file and call main() function,
the rest of the interface I would like to hide. I include the .pyd and
call dir(pydmodule) and it shows all global functions/classes/
variables. I would like it to show only the main() function.

Currently I've bypass the problem by obfuscating all global symbols
in .py source file, before compiling it to pyd, but maybe there is a
better way?

Czarek.

mark florisson

unread,
Nov 28, 2011, 3:08:26 PM11/28/11
to cython...@googlegroups.com

cdef functions are not exposed to python, although their names are
mangled deterministically. Cython is really not a code obfuscator and
as such may not be the right tool.

Reply all
Reply to author
Forward
0 new messages