On Thu, Sep 25, 2008 at 6:31 AM, Neal Becker <ndbecker2@gmail.com> wrote:
Robert Dailey wrote:

> On Wed, Sep 24, 2008 at 7:08 PM, Neal Becker <ndbecker2@gmail.com> wrote:
>
>> Robert Dailey wrote:
>>
>> <snip>
>>
>> How about:
>> scope().attr("something") = whatever;
>
>
> Where would this code go? What does scope() do?

You could put it here:
BOOST_PYTHON_MODULE ... {

 scope().attr ("something") = 42;

I can't do it where I define the module because I'm passing a pointer to an object to python. This needs to be available as the script is executed, and this pointer value is only known to a certain class (It isn't globally accessible, so it couldn't possibly be set where the python module is defined).

I know it needs to be done the way I originally posted, but I need to know why it is throwing an exception.

Thanks for the help.