How to get C and python functions into the same namespace?

Wojciech Zabolotny wzab at ise.pw.edu.pl
Sat Dec 11 06:09:33 EST 1999


Hi All,

I'm preparing a python extension module which is partially implemented as
in "C" (cmymodule.c), and partially in python (mymodule.py).
I'd like to have functions defined in both files in the same namespace.
Let's assume, that the functions are defined as follows:
cmymodule.c:
open, read, write, close
mymodule.py:
info, encrypt 

If I import both extensions into the user program, the functions should be
called as cmy.open(), cmy.read(),... but my.info(), my.encrypt().
If I include the "import cmy" into mymodule.py, then syntax will be even
worse: my.cmy.open() and so on.
Due to performace reasons I don't want to add the python "wrappers" 
in mymodule.py for C functions.

How can I locate both C and python functions in the same namespace?
Please Cc the answer to my e-mail (given below).
-- 
                        TIA
                        Wojciech Zabolotny
                        wzab at ise.pw.edu.pl
                        http://www.ise.pw.edu.pl/~wzab

http://www.freedos.org  Free DOS for free people!





More information about the Python-list mailing list