[C++-sig] Strange boost python error message (and solution)
François Duranleau
duranlef at iro.umontreal.ca
Sun May 21 16:47:42 CEST 2006
On Sat, 20 May 2006, Ralf W. Grosse-Kunstleve wrote:
> --- 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.
No, I didn't, and I actually didn't think about the library issue.
> 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.
I agree. I was just wondering if we could simply remove the warning for
one situation, but then again, I forgot about the library thing. So, I
stand on your side.
--
François Duranleau
LIGUM, Université de Montréal
"Voyager, c'est essayer de revenir avec quelques préjugés en moins."
- Jean-Daniel Lafond
More information about the Cplusplus-sig
mailing list