[C++-sig] Strange boost python error message (and solution)

Ralf W. Grosse-Kunstleve rwgk at yahoo.com
Sun May 21 07:44:10 CEST 2006


--- Fran�ois Duranleau <duranlef at iro.umontreal.ca> wrote:
>        if (slot == f) // already registered with the same function, do
>                       // nothing?
>        {
>            return;
>        }

Did you actually try this out? -- We would have to establish that the address
comparison across shared library boundaries works reliably on all platforms.

Why do you find it difficult to avoid the warning or assertion?

My solution to the problem is to explicitly import the module with the desired 
converter when I need it. Python's import logic automatically avoids multiple
execution of the init function, and therefore multiple registration. To me this
seems a little safer/organized/obvious/maintainable than a "let's see what
happens" approach.

I believe simply removing the assert(slot != 0) is the best approach; this way
the informative warning wll shows up under all circumstances.


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



More information about the Cplusplus-sig mailing list