Against PEP 240

Alex Martelli aleaxit at yahoo.com
Wed May 30 09:08:52 CEST 2001


"Robin Becker" <robin at jessikat.fsnet.co.uk> wrote in message
news:S3eV6vAYJDF7Ewtj at jessikat.fsnet.co.uk...
    ...
> >What about just reminding extension writers to
> >use PyFloat_AsDouble and emphatically _NOT_ the
> >PyFloat_AS_DOUBLE macro?  What am I missing?
> >
> speed; some matrix algorithms are say order n if I have an extra layer
> of order n caused by additional input checks some will get demented and
> cry out particularly if as in some rather strange economic models the
> algorithm is the inner loop with 5 or 6 loops around it.

The Python loop overhead will drown the miniscule savings
obtained by using the macro -- and using the macro will
likely crash Python (rather than give a clean diagnostics)
if ever a literal that's not FP is used.  Such extensions, if
they exist, look very broken to me -- and yet all one needs
to do, to keep them klugging along, is to make one pass of
a script over the Python sources invoking the very fragile
extensions to decorate the literals.


Alex






More information about the Python-list mailing list