[Cython] Feature request: generate signature information for use by "inspect"

2012-06-28 Thread Dieter Maurer
Python's "inspect" module is a great help to get valuable information about a package. Many higher level tools (e.g. the "help" builtin and "pydoc") are based on it. I have just recognized a deficiency of "cython" generated modules with respect to "inspect" support: "inspect" cannot determin

Re: [Cython] Feature request: generate signature information for use by "inspect"

2012-06-28 Thread Stefan Behnel
Dieter Maurer, 28.06.2012 09:04: > Python's "inspect" module is a great help to get valuable information > about a package. Many higher level tools (e.g. the "help" builtin > and "pydoc") are based on it. > > I have just recognized a deficiency of "cython" generated > modules with respect to "insp

Re: [Cython] Feature request: generate signature information for use by "inspect"

2012-06-28 Thread Dieter Maurer
Stefan Behnel wrote at 2012-6-28 09:25 +0200: >Dieter Maurer, 28.06.2012 09:04: >> ... >> In this case, I suggest to enhance the >> function's docstring by signature information. >> >> I now transform manually my docstrings >> >> def (): >>""" >> >> >>

[Cython] Automatic C++ conversions

2012-06-28 Thread Robert Bradshaw
I've been looking how painful it is to constantly convert between Python objects and string in C++. Yes, it's easy to write a utility, but this should be as natural (if not more so, as the length is explicit) than bytes <-> char*. Several other of the libcpp classes (vector, map) have natural Pytho

Re: [Cython] Automatic C++ conversions

2012-06-28 Thread Stefan Behnel
Robert Bradshaw, 28.06.2012 10:59: > I've been looking how painful it is to constantly convert between > Python objects and string in C++. You mean std::string (as I think it's called)? Can't we just special case that in the same way that we special case char* and friends? Basically just one type

Re: [Cython] Automatic C++ conversions

2012-06-28 Thread Robert Bradshaw
On Thu, Jun 28, 2012 at 2:54 AM, Stefan Behnel wrote: > Robert Bradshaw, 28.06.2012 10:59: >> I've been looking how painful it is to constantly convert between >> Python objects and string in C++. > > You mean std::string (as I think it's called)? Can't we just special case > that in the same way

Re: [Cython] Automatic C++ conversions

2012-06-28 Thread Stefan Behnel
Robert Bradshaw, 28.06.2012 12:07: > On Thu, Jun 28, 2012 at 2:54 AM, Stefan Behnel wrote: >> Robert Bradshaw, 28.06.2012 10:59: >>> I've been looking how painful it is to constantly convert between >>> Python objects and string in C++. >> >> You mean std::string (as I think it's called)? Can't we

Re: [Cython] [cython-users] C++: how to handle failures of 'new'?

2012-06-28 Thread Stefan Behnel
[moving this to cython-devel as it's getting technical] Robert Bradshaw, 28.06.2012 21:46: > On Thu, Jun 28, 2012 at 11:38 AM, Stefan Behnel wrote: >> currently, when I write "new CppClass()" in Cython, it generates a straight >> call to the "new" operator. It doesn't do any error handling. And th