Hi Greg, Greg Ewing wrote: > Stefan Behnel wrote: >>> * There are two new builtin functions, typecheck() and >>> issubtype(), for checking the types of arguments more safely >>> (since isinstance and issubclass can be fooled). >> >> Could you elaborate on the actual problem here? > > It's possible for an object to lie about its class > to isinstance() via its __class__ attribute. This is > not acceptable when you need to ensure that the object > has a particular C layout.
Wouldn't special casing a type test for builtins and extension classes be better here than adding new functions? I mean, we already had that with getattr3(), where the right thing to do would have been to fix builtin functions. >> Could you imagine using our doctest based test runner as well? > > To do what, exactly? To share a common test suite. Currently, you have a test suite that is mostly based on comparing the C source, while our test suite is mostly based on building the module and running a doctest against it. The sources generated by Pyrex and Cython look very different, so your approach is not portable, but our test suite can easily be used for both and the tests that are supported by both compilers must obviously yield the same results. So if you added doctests to your test modules (as we do for ours), you could still validate the resulting source code for Pyrex, but we could both join forces and benefit from a growing test suite. This would allow us to see if a bug that gets fixed in one compiler must also be fixed in the other, and it would also make it easier to keep the feature set of both compilers somewhat aligned. Stefan _______________________________________________ Cython-dev mailing list Cython-dev@codespeak.net http://codespeak.net/mailman/listinfo/cython-dev