[SciPy-dev] Modernizing code

David M. Cooke cookedm at physics.mcmaster.ca
Tue Oct 11 21:23:34 CDT 2005

Robert Kern <rkern at ucsd.edu> writes:

> For both scipy_core and the full scipy, I would like to make these two
> changes:
>  * Make all classes new-style classes
>  * Change malloc/free/etc. to their PyMem equivalents
> The former is, I think, uncontroversial. The latter *may* have an effect
> on performance, so I'm curious if it has already been considered.

I doubt it. PyMem_Malloc, for instance, is a simple wrapper around
calling PyMem_MALLOC, which (when PYMALLOC_DEBUG is not defined) is
just a macro calling malloc. The PyMem_New, etc. macros would also
clean things up.

> If there's no objection, then I'll get started on cleaning things up as
> soon as I can.

I'd add:

  * use void * instead of char * for non-string pointers.

This would allow getting rid of a lot of (char *) casts. I can help
with that (and the others).

|David M. Cooke                      http://arbutus.physics.mcmaster.ca/dmc/
|cookedm at physics.mcmaster.ca

More information about the Scipy-dev mailing list