Re: [C++-sig] [Py++] Don't transform char* to c_char_p

2009-12-23 Thread Nikolaus Rath
Roman Yakovenko writes: > On Wed, Dec 23, 2009 at 9:21 PM, Nikolaus Rath wrote: >> It would be great if there was a way to tell Py++ that it should not >> represent the C char * type to the ctypes c_char_p, because the later is >> supposed to be used only for \0 terminated strings. A general char

Re: [C++-sig] [Py++] Don't transform char* to c_char_p

2009-12-23 Thread Roman Yakovenko
On Wed, Dec 23, 2009 at 9:21 PM, Nikolaus Rath wrote: > Hi Roman, Good evening. > I know you are busy, so I have already monkeypatched pyplusplus locally > for my purposes. But maybe you are interested to add this feature add > some point in the future: > > It would be great if there was a way t

[C++-sig] [Py++] Don't transform char* to c_char_p

2009-12-23 Thread Nikolaus Rath
Hi Roman, I know you are busy, so I have already monkeypatched pyplusplus locally for my purposes. But maybe you are interested to add this feature add some point in the future: It would be great if there was a way to tell Py++ that it should not represent the C char * type to the ctypes c_char_p

Re: [C++-sig] Trying to implement subscriptable type in c++.

2009-12-23 Thread Michele De Stefano
I'm not sure if this can help. http://code.google.com/p/mds-utils If you try to use Boost Python and the mds_utils::python::support_random_access< Derived > class, contained into container_operators.hpp of the mds-utils library (http://code.google.com/p/mds-utils), may be you can easily define a su

Re: [C++-sig] Trying to implement subscriptable type in c++.

2009-12-23 Thread Gustavo Carneiro
In Python C API you cannot define a __getitem__ method; instead define a tp_as_mapping slot. See: http://docs.python.org/c-api/typeobj.html#tp_as_mapping 2009/12/23 Anita A > Hi all, > > I am trying to implement a subscriptable type in c++ (equivalent to python > dict), but I get a 'type is u