[C++-sig] [Py++] C++ containers and Python sequences

2010-02-02 Thread peoro
Hello, let me start by thanking everybody who's behind Boost.Python and Py++, these projects are really awesome. I read that Py++ (and/or Boost.Python) has a native support for some C++ containers, and that others can be added using indexing suites [ http://www.language-binding.net/pyplusplus/docu

[C++-sig] [Py++] Indexing suite 2: missing methods

2010-02-13 Thread peoro
Hello, I noticed that some Py++ traits for standard containers are missing a few methods that I think would be needed. For example `set_traits' (container traits for `std::set') is missing `method_len' that, in my opinion, should be provided. Is this a feature or a bug? And in the former case, how

Re: [C++-sig] [Py++] Indexing suite 2: missing methods

2010-02-14 Thread peoro
On Sat, Feb 13, 2010 at 8:05 PM, Roman Yakovenko wrote: > On Sat, Feb 13, 2010 at 5:41 PM, peoro wrote: >> Hello, >> I noticed that some Py++ traits for standard containers are missing a >> few methods that I think would be needed. >> For example `set_traits' (con

Re: [C++-sig] [Py++] Indexing suite 2: missing methods

2010-02-15 Thread peoro
On Sun, Feb 14, 2010 at 8:39 PM, Roman Yakovenko wrote: > On Sun, Feb 14, 2010 at 6:22 PM, peoro wrote: >> On Sat, Feb 13, 2010 at 8:05 PM, Roman Yakovenko >> wrote: >>> Did you try len( x )? >>> >> >> Yes, I tried and it isn't working. >

[C++-sig] [Py++] boost::shared_ptr casting

2010-03-20 Thread peoro
Hello, I'm having some issues with shared_ptr's in a Python environment: it looks like once a shared_ptr enters Python, it cannot be upcasted nor downcasted. Here's a brief C++ source code to explain better the issue: #include class Base { }; class Derived : public Base { }; boost::shared_pt

Re: [C++-sig] [Py++] boost::shared_ptr casting

2010-03-20 Thread peoro
x27;s, but from Python I see them at the "derivation level" they were when I passed them to python the first time (look at the summarized output in my previous message)... On Sat, Mar 20, 2010 at 10:06 PM, Jim Bosch wrote: > On Sat, 2010-03-20 at 21:31 +0100, peoro wrote: >>

Re: [C++-sig] [Py++] boost::shared_ptr casting

2010-03-21 Thread peoro
w it looks like this doesn't depend on py++: py++ always generates the same boost::python code no matter of destructor's virtuality. ...What if I cannot add a virtual function to the class Base? On Sun, Mar 21, 2010 at 6:11 AM, Roman Yakovenko wrote: > On Sun, Mar 21, 2010 at 4

Re: [C++-sig] [Py++] boost::shared_ptr casting

2010-03-21 Thread peoro
ck: prior to pass a shared_ptr to Python for the first time, I just pass it to Python casted to its most-derived class. On Sun, Mar 21, 2010 at 10:28 PM, Nat Goodspeed wrote: > peoro wrote: > >> Ok, it does work as expected if class Base has got at least one virtual >> member: