Hi,<br><br>I have a C++ class that I&#39;m exposing to Python via the Boost.Python library. This specific class is only created from C++. In other words, it doesn&#39;t serve the user very much good to construct an instance of this class from Python. A typical use case for obtaining an instance of this class from python is as follows:<br>
<br><span style="font-family: courier new,monospace;">import myCustomModule</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">fooInstance = myCustomModule.GetFooInstance()</span><br>
<br>However, I want to prevent the user from being able to do this:<br><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">import myCustomModule</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">fooInstance = myCustomModule.Foo()</span><br><br>Let&#39;s assume the class in question with private construction is Foo. The latter code snippet would be an example of the user directly constructing an instance of Foo(). Is there a way to prevent this through the BOOST_PYTHON_MODULE() definition? I&#39;m not even really sure if this can be done natively through Python. Thanks.<br>