> I have to convert std::pair to python tuple in different modules
>independently.
> And these modules may be used concurrently, importing the second module
> will report an warning like "std::pair has been already registered".
A simple and clean approach is to have another basic module that defines the
std::pair conversions,
and import that from the two modules you have already.
I never import extensions directly, but wrap each in a (possibly trivial)
Python
module; this has
many advantages unrelated to your original question. Then you can simply write:
module1.py
import basic # e.g. with std::pair converters
from module1_ext import *
similar for module2.py.
Ralf
_______________________________________________
Cplusplus-sig mailing list
Cplusplus-sig@python.org
http://mail.python.org/mailman/listinfo/cplusplus-sig