[SciPy-dev] Is Python being Dylanized?

Pearu Peterson pearu at cens.ioc.ee
Sat Feb 16 13:16:02 CST 2002


On Sat, 16 Feb 2002, Prabhu Ramachandran wrote:

>   (1) Define a language that is a subset of Python with a well defined
>   set of supported features.  Lets call this High Performance Python
>   or HPP (hpp) for short.
> 
>     (a) A few special details like type information should be
>     supported and allowed for in hpp.
>     
>     (b) These details can also be passed in via some special data
>     attribute or method.  Something like so:
> 
> class Foo:
>     def __init__(self):
>         self.x = 1.0
>         self.y = 2.0
>         self.name = "Foo"
>         ...
> 
>     def func(self):
>         return self.x*self.y 
> 
> classdata = {'x': 'FloatType', 'y': 'FloatType', 'name': 'FloatType'}
> classmember = {'__init__': {'args': None}, 
>                'func': {'args': None, 'return': 'FloatType'}}
> 
> f = Foo()
> fa = weave.accelerate(Foo, classdata, classmember)

This HPP interface looks very similar to what I thought awhile ago but
from a different perspective. Namely, I was thinking of representing the
signatures of C/Fortran functions using similar class definition setup in
order to get rid of pyf-files (that may look scary for few non-Fortran
persons). Then let f2py to scan Fortran sources and generate these class
definitions instead of pyf-files. In the second step, to use the
instances of these classes to construct C/API extension modules for the
wrapper functions.
Well, it was just a thought and I never got a change to implement it.

So, if someone will pick up this idea of High Performance Python and
implement it in the similar form as above (or may be even in some better
form), then s/he will certainly get patches from me ;-)

Thanks,	
	Pearu




More information about the Scipy-dev mailing list