[Numpy-discussion] Questions on error handling/refcounting in some ufunc object loops.

Charles R Harris charlesr.harris at gmail.com
Fri Nov 14 02:12:13 EST 2008


On Thu, Nov 13, 2008 at 11:50 PM, Robert Kern <robert.kern at gmail.com> wrote:

> On Fri, Nov 14, 2008 at 00:39, Charles R Harris
> <charlesr.harris at gmail.com> wrote:
> > BTW, David, would you mind if I moved the rest of the function
> definitions
> > into math_c99? I would like to separate the loops from the functions. It
> > might also be nice to have a template somewhere to combine all the code
> > pieces. Having includes scattered here and there through the code is a
> bit
> > obscure.
>
> Ah, the T-word.  :-)
>
> Have you taken a look at Tempita?
>
>  http://pythonpaste.org/tempita/
>
> It's a small, single-file implementation, and its syntax is Djangoish
> but it doesn't have some of Django's limitations that make Django
> templates awkward for code generation. In particular, you can use
> pretty much arbitrary Python in the template and don't have to
> register a new tag just to call an arbitrary function. If you want to
> use Tempita to redo our code generation, I withdraw my old objections.
>

I'm actually pretty happy with the current system now that it has nested
loops and continuation lines. It's small and does no more than it needs to.
Capitalization is the only additional feature that catches my attention now
days, but it doesn't move me enough to do anything about it.

Anyway, I was thinking more along the lines of the text api lists we have.
Something like:

[_umathmodule.c]
math_c99.c.src : generate
umathmodule.c.src : generate
ufuncobject.c
_umath_generated.c
_ufunc_api.c


Something like that, anyway. It would be easier than grepping through the
source or putting a list in some obscure setup.py file. Yes, scons and setup
can be made to do these things, I just think it would be nice to separate
the data from the code. Although I suppose such a file is actually an
example of domain specific code.

Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20081114/46abf1f5/attachment.html>


More information about the NumPy-Discussion mailing list