Re: PyArg_ParseTupleAndKeywords in Python3.1

2009-12-19 Thread Joachim Dahl
My mistake seems to be that I declared char a, b; instead of int a, b; Thank you for sorting this out. Joachim -- http://mail.python.org/mailman/listinfo/python-list

Re: PyArg_ParseTupleAndKeywords in Python3.1

2009-12-17 Thread Joachim Dahl
In the Ubuntu 9.10 version of Python 3.1 (using your patch), there's a related bug: foo(b='b') will set the value of a in the extension module to zero, thus clearing whatever default value it may have had. In other words, the optional character arguments that are skipped seem to be nulled by

Re: PyArg_ParseTupleAndKeywords in Python3.1

2009-12-01 Thread Joachim Dahl
thanks - the patch fixed my problem. Joachim On Dec 1, 5:51 am, casevh cas...@gmail.com wrote: On Nov 30, 2:18 pm, Joachim Dahl dahl.joac...@gmail.com wrote: I think that C encoding is what I need, however I run into an odd problem. If I use the following C code static PyObject

PyArg_ParseTupleAndKeywords in Python3.1

2009-11-30 Thread Joachim Dahl
I am updating an extension module from Python2.6 to Python3. I used to pass character codes to the extension module, for example, I would write: foo('X') with the corresponding C extension routine defined as follows: static PyObject* foo(PyObject *self, PyObject *args, PyObject *kwrds) { char

Re: PyArg_ParseTupleAndKeywords in Python3.1

2009-11-30 Thread Joachim Dahl
)) return NULL; ... The question remains the same: why can't I pass a single character argument to this function under Python3.1? Thanks. Joachim On Nov 30, 9:52 pm, Joachim Dahl dahl.joac...@gmail.com wrote: I am updating an extension module from Python2.6 to Python3. I used to pass

Re: PyArg_ParseTupleAndKeywords in Python3.1

2009-11-30 Thread Joachim Dahl
)) return NULL; ... then the following works: foo('a') foo('a','b') foo(a='a',b='b') but the following fails: foo(b='b') RuntimeError: impossiblebad format char: 'CC' Is this error-message expected? On Nov 30, 10:19 pm, casevh cas...@gmail.com wrote: On Nov 30, 1:04 pm, Joachim Dahl dahl.joac

FILE object in Python3.0 extension modules

2009-05-29 Thread Joachim Dahl
In Python2.x, I used PyFile_Check(obj) to check if a parameter was a file object. Now, in Python3.0 the same object (obtained as open('file.bin','wb')) is an io.BufferedWriter object. How do I perform type checking for such an object in the extension module, and how do I extract a FILE * object

developing python extensions with CDT and Pydev in Eclipse

2008-11-04 Thread Joachim Dahl
Has anyone been able to use both Pydev and CDT to debug extension modules? The question was asked about a year ago on this list, and I am hoping that someone has figured it out in meantime. Joachim -- http://mail.python.org/mailman/listinfo/python-list

Re: developing python extensions with CDT and Pydev in Eclipse

2008-11-04 Thread Joachim Dahl
Fabio Zadrozny wrote: Has anyone been able to use both Pydev and CDT to debug extension modules? The question was asked about a year ago on this list, and I am hoping that someone has figured it out in meantime. Previous answers on that:

Re: Python Linear Programming on Ubuntu

2008-09-17 Thread Joachim Dahl
CVXOPT supports ILP via GLPK or MOSEK. Documentation is in the doc- strings for cvxopt.glkp.ilp and cvxopt.mosek.ilp. The ILP interfaces are not mentioned otherwise in the documentation, as the main focus of CVXOPT is convex solvers. For additional questions on CVXOPT please use the discussion

distutils question

2005-09-07 Thread Joachim Dahl
I am trying to make a customized install script for an extension module using the distutils.ccompiler class. I want to embed an existing makefile for the C libraries into the Python setup script, but I am not sure what's the right way to do it... E.g., say I want to compile a project as: gcc