Greg Ewing <[EMAIL PROTECTED]> writes:

> 
> Stefan Behnel wrote:
> > 
> > Robert Bradshaw wrote:
> 
> > > - Having an except [uncommon value]? by default on all implemented  
> > > functions.
> > 
> > I first thought about that as a door opener for performance problems, but I
> > actually think most functions forward exceptions anyway, so this won't 
> > change
> > much in that regard.
> 
> I'm not sure I like this idea. Most functions from external
> C libraries will not be raising exceptions, so if you don't
> want performance penalties and code bloat when calling those,
> you would have to make a distinction between Cython-implemented
> functions and extern ones.
> 

In pex, I added an "except exits" clause, eg

   cdef int foo() except exits:

For an external C function, it means the
exception flag isn't checked. For cdef functions, it makes the function
die if it ever raises an exception (I wanted to make sure there was no way
for execution to continue on an error).

> > Why? Do you mean "dependency tree" in terms of files depending on each 
> > other?
> > Greg's .dep files would handle that...
> 
> The problem is that if you're using timestamps to tell when
> things need to be recompiled, then *any* change to the .pyx
> file will trigger recompilation of everything that imports
> from it, whether the change affects the external interface
> or not.

The way I did this in Pex, is to lie with timestamps. When the .pxd file
is about to be generated, the old one is read in, and the APIs are compared.
If they are the same, the new is still written (I use it for some magic
comments), but the timestamp is backdated.




_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to