[Numpy-discussion] Numpy and C++ integration...
Tue Feb 5 04:57:45 CST 2008
> This is what SWIG must be doing internally -- right ?!
Yes, it is with an additional typemap that checks the type of the data.
I don't think that it is a good idea for numpy to add such
multi-dispatching, it is not its job. There are a lot of ways to do it, and
besides it would be very cumbersome to have something specific to Numpy
(that is only for Numpy's types), because when ctypes will be used with
something else than Numpy, it would be a nightmare.
The only thing you have to do to have your own dispatcher is to wrap the C
functions in a Python function that will call the good function. It is very
straightforward, so you might think that this solution could be integarted
into Numpy but :
- for such simple code, it is not very useful, a wiki entry can do better
- if you have a double dispatch to do, you would have to implement it
yourself, so you would have to check the code (or the wiki entry) and you
would send a mail to include a double dispatcher to Numpy
- etc for a triple dispatcher, four
French PhD student
Website : http://matthieu-brucher.developpez.com/
Blogs : http://matt.eifelle.com and http://blog.developpez.com/?blog=92
LinkedIn : http://www.linkedin.com/in/matthieubrucher
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Numpy-discussion