Hi, Andrew Straw wrote: > OK, so there'd be part of the Cython compiler that checked if the name > of the current method was "__getbuffer__" and if the class was an > extension ctypedef, upon which it would insert some check before the > method returned? I don't know the internals of Cython enough to know > whether that would be a gratuitous hack or reasonable behavior...
:) well, Cython generates the C code, so it actually sees the pointer that this special method returns. It's trivial to put some additional sanity check code in the final cleanup code that gets generated for that method. > It does seem like the idea of a "training wheels" mode for Cython could > be pretty useful -- a few of the other threads are mentioning various > ideas, and it would probably make development of Cython code easier if > there was a safe(r) but slower mode and a as fast as possible mode. Maybe you could start a Wiki page on this topic? http://wiki.cython.org/enhancements/safetymode Stefan _______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
