Got me thinking, is it perhaps doable to have a 'safe' ctype that is
guaranteed to be in the stdlib? Perhaps crippling it in a sense that it
only allows a known set of functions to be called?

In some sense, a C module wrapping a selected number of functions
(like the win32 extensions) is exactly that.

Notice that it's not (only) the functions itself, but also the parameters. It's absolutely easy to crash Python by calling a function through ctypes that expects a pointer, and you pass an integer. The machine code will dereference the pointer (trusting that it actually is one), and crash.

Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to