Thank you, Renato<br><br>However this is still not clear how to wrap a pointer to double using that indexing_suites. For types like vector&lt;double&gt; it is pretty much clear, but what do i need to do in order to wrap just a simple poiner to double?<br>
<br>Also i have related question - how can i wrap an overloaded indexing operator - []? For numerical operators there are some signatures like .def(self+self) ,etc, but for operator [] i&#39;ve never seen any such usage signatures? Is there any way to do this?<br>
<br><br><div class="gmail_quote">2009/7/6 Renato Araujo <span dir="ltr">&lt;<a href="mailto:renatox@gmail.com">renatox@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
take a look at:<br>
<a href="http://www.boost.org/doc/libs/1_39_0/libs/python/doc/v2/indexing.html" target="_blank">http://www.boost.org/doc/libs/1_39_0/libs/python/doc/v2/indexing.html</a><br>
<br>
BR<br>
<div><div></div><div class="h5"><br>
<br>
On Mon, Jul 6, 2009 at 8:07 PM, Alexey Akimov&lt;<a href="mailto:alexey.akimov85@gmail.com">alexey.akimov85@gmail.com</a>&gt; wrote:<br>
&gt; I have some class X that contains a variable which is a pointer to some<br>
&gt; other class OtherClass (for simplicity we may imagine it can be some<br>
&gt; standard c++ type - int, double, etc.):<br>
&gt;<br>
&gt; class X{<br>
&gt;<br>
&gt; public:<br>
&gt;      OtherClass* variable;<br>
&gt;<br>
&gt; };<br>
&gt;<br>
&gt; my question is: how can I expose it to python such that user may access to<br>
&gt; variable using [] operator?<br>
&gt; like:<br>
&gt;<br>
&gt;&gt;&gt;&gt; import module<br>
&gt;&gt;&gt;&gt; module.X[i] = i<br>
&gt;<br>
&gt; I&#39;ve found several examples on this topic:<br>
&gt; <a href="http://mail.python.org/pipermail/cplusplus-sig/2005-January/008189.html" target="_blank">http://mail.python.org/pipermail/cplusplus-sig/2005-January/008189.html</a><br>
&gt; <a href="http://osdir.com/ml/python.c++/2003-01/msg00042.html" target="_blank">http://osdir.com/ml/python.c++/2003-01/msg00042.html</a><br>
&gt;<br>
&gt; but still can not make this trick.<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
</div></div>&gt; _______________________________________________<br>
&gt; Cplusplus-sig mailing list<br>
&gt; <a href="mailto:Cplusplus-sig@python.org">Cplusplus-sig@python.org</a><br>
&gt; <a href="http://mail.python.org/mailman/listinfo/cplusplus-sig" target="_blank">http://mail.python.org/mailman/listinfo/cplusplus-sig</a><br>
&gt;<br>
<font color="#888888"><br>
<br>
<br>
--<br>
Renato Araujo Oliveira Filho<br>
_______________________________________________<br>
Cplusplus-sig mailing list<br>
<a href="mailto:Cplusplus-sig@python.org">Cplusplus-sig@python.org</a><br>
<a href="http://mail.python.org/mailman/listinfo/cplusplus-sig" target="_blank">http://mail.python.org/mailman/listinfo/cplusplus-sig</a><br>
</font></blockquote></div><br>