Hi,

Robert Bradshaw wrote:
>> inline functions in pxd files is something I think comes in *really*
>> handy, it is part of what the "include" statement is currently used  
>> for and inline functions are much nicer than include statements.
> 
> +1 to inline functions. I've wanted these too.

Absolutely, +1.


> I'm generally -1 on adding new syntax, but what I had wasn't very  
> clear either. Would it be enough to accept a locals decorator?

I think that's a very clean compromise. You can

a) specify the signature in .pxd files as you would in .pyx files, just
without a function body.

b) write importable inline functions in .pxd files as a function with body,
just as you would in a .pyx file.

c) specify local variable types for a .py implemented function in a .pxd
file by adding a decorator to a function signature, but without providing a
function body.

So, whenever a function signature in a .pxd file has a body at all, it must
be a complete inline function.

I actually don't think that users would intuitively expect the current way
of defining local variables in .pxd files to work.

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

Reply via email to