On Jun 12, 8:11 am, "Martin v. Loewis" <mar...@v.loewis.de> wrote:

> > 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.

 what's so bad about that?  (this is a genuine, non-hostile, non-
rhetorical, non-sarcastic question).

 (if the answer is "because you can't catch a segfault as a python
exception", then the question is repeated)

 l.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to