Jump to content

  • Log In with Google      Sign In   
  • Create Account

Boost.Python - Ignoring return types of member functions?


Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
2 replies to this topic

#1 TheComet   Crossbones+   -  Reputation: 2399

Like
1Likes
Like

Posted 30 June 2014 - 07:47 AM

I have two unrelated questions.

 

1) Consider the following C++ class and its wrapping code using Boost.Python:

struct Foo
{
    InternalThing* bar(std::string name);
};

BOOST_PYTHON_MODULE(test)
{
    using namespace boost::python;
    class_<Foo>("Foo")
        .def("bar", &Foo::bar)
    ;
}

InternalThing is a class that is not wrapped and has no reason to be exposed, consequently generating a compile error because Boost.Python can't find it.

 

How can I tell Boost.Python to ignore the return type and just assume it to be void?

 

 

2) When I tested the compiled shared object in Python (using PyCharm), I noticed that PyCharm's autocomplete doesn't know about any of the available classes/methods. Is there a way to expose that kind of information to PyCharm, perhaps through a .py stub file?


"Windows 10 doesn't only include spyware, it is designed as spyware" -- Gaius Publius, The Big Picture RT Interview

"[...] we will access, disclose and preserve personal data, including your content (such as the content of your emails, other private communications or files in private folders), when we have a good faith belief that doing so is necessary" -- Windows 10 Privacy Statement


Sponsor:

#2 Eck   Crossbones+   -  Reputation: 6595

Like
0Likes
Like

Posted 30 June 2014 - 09:54 AM

I'm not sure if you can or not, I'll let someone who knows more about Boost.Python speak to that. But one thing you could do is create a bar_Python function that IS a void return type which calls your bar function. You probably already thought of that, but just in case you didn't. :)

 

- Eck


EckTech Games - Games and Unity Assets I'm working on
Still Flying - My GameDev journal
The Shilwulf Dynasty - Campaign notes for my Rogue Trader RPG

#3 TheComet   Crossbones+   -  Reputation: 2399

Like
0Likes
Like

Posted 30 June 2014 - 01:47 PM


But one thing you could do is create a bar_Python function that IS a void return type which calls your bar function. You probably already thought of that, but just in case you didn't. smile.png

Thanks for your input.

 

I was thinking about doing that as a last resort, hoping that there is a more elegant solution.


"Windows 10 doesn't only include spyware, it is designed as spyware" -- Gaius Publius, The Big Picture RT Interview

"[...] we will access, disclose and preserve personal data, including your content (such as the content of your emails, other private communications or files in private folders), when we have a good faith belief that doing so is necessary" -- Windows 10 Privacy Statement





Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.




PARTNERS