Re: [Numpy-discussion] mixing -fno-exceptions with swig c++ wrappers to python

2009-09-06 Thread David Cournapeau
Rohit Garg wrote: > Hi, > > I am using swig to expose a c++ class to Python. I am wondering if it > is safe to use the -fno-exceptions option while compiling the > wrappers. I am also using the typemaps present in the numpy.i file > that comes with numpy. > > It will mostly depend on the code y

Re: [Numpy-discussion] problem with numpy.distutils and Cython

2009-09-06 Thread Nicolas Pinto
Thanks Lisandro, it worked perfectly! On Sun, Aug 23, 2009 at 6:30 PM, Lisandro Dalcin wrote: > The monkeypatching below in your setup.py could work. This way, you > just have to use numpy.distutils, but you will not be able to pass > many options to Cython (like C++ code generation?) > > from n

Re: [Numpy-discussion] object dtype questions

2009-09-06 Thread Sturla Molden
Alan G Isaac skrev: > http://article.gmane.org/gmane.comp.python.general/630847 > Yes, but here you still have to look up the name 'f' from locals in each iteration. map is written in C, once it has as PyObject* to the callable it does not need to look up the name anymore. The dictionary look

Re: [Numpy-discussion] object dtype questions

2009-09-06 Thread Alan G Isaac
On 9/6/2009 8:33 AM, Sturla Molden wrote: > map( cls.myMethod, a ) > > is similar to: > > [aa.myMethod() for aa in a] http://article.gmane.org/gmane.comp.python.general/630847 fwiw, Alan Isaac ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.or

Re: [Numpy-discussion] object dtype questions

2009-09-06 Thread Sturla Molden
Mark Wendell skrev: > for i in range(5): > for j in range(5): > a[i,j].myMethod(var3,var4) > print a[i,j].attribute1 > > Again, is there a quicker way than above to call myMethod or access attribute1 One option is to look up the name of the method unbound, and then use bui

Re: [Numpy-discussion] object dtype questions

2009-09-06 Thread Ernest Adrogué
5/09/09 @ 11:22 (-0600), thus spake Mark Wendell: > For example: > > Say that C is a simple python class with a couple attributes and methods. > > a = np.empty( (5,5), dtype=object) > for i in range(5): > for j in range(5): > a[i,j] = C(var1,var2) > > First question: is there a q