Re: [C++-sig] Exposing a C-style array data member to Python via Boost.Python

2013-07-29 Thread Ashish Sadanandan
Holger Brandsmeier gmx.de> writes: > > Ashish, > > if you really need it to be a `list` in python, then there is no way > around it, you have to copy it. If you just need it to behave like a > list, then that is possible. Just export your struct to python and > implement methods such as __get__

Re: [C++-sig] Exposing a C-style array data member to Python via Boost.Python

2013-07-27 Thread Holger Brandsmeier
Ashish, if you really need it to be a `list` in python, then there is no way around it, you have to copy it. If you just need it to behave like a list, then that is possible. Just export your struct to python and implement methods such as __get__(), __set__(), __len()__, __eq__(), ... You may al

Re: [C++-sig] Exposing a C-style array data member to Python via Boost.Python

2013-07-26 Thread Ashish Sadanandan
Ashish Sadanandan gmail.com> writes: > > I have a struct that contains a C-style array data member. I'd like to have > this struct exposed to Python, and this data member be accessible as a tuple > in Python. > > struct S > { > char arr[10]; > }; > > > So the question is, how can I expose t