<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'>
This is using sip 4.10<br><br>
// Example module that produces erroneous output<br>
%Module example<br>
%Import mapped_types.sip // A separately compiled module with some mapped types<br>
%Import some_module.sip // This is before the %Includes<br>
%Include file.sip // A wrapped class that uses a wrapped class in some_module under the 'myns' namespace<br>
%Include ...<br>
...<br>
<br><br>If I change the order of the directives to the following:<br><br>// "Correct" example that produces functional output but requires reording
of the Imports<br>
%Module example<br>
%Import mapped_types.sip<br>
%Include file.sip <br>
%Include ...<br>
...<br>
%Import some_module.sip // This is now after the %Include(s)<br>
...<br>
<br><br>The output changes with respect to the namespace definitions in the sipClassTypeDef struct defnitions<br><br>The first produces something like this is the<br>// sip_examplemyns.cpp<br>sipClassTypeDef sipTypeDef__example_myns = {<br> {<br> -1,<br> 0,<br> 0,<br> SIP_TYPE_NAMESPACE,<br> sipNameNr_myns,<br> {0}<br> },<br> {<br> -1,<br> {2, 0, 0},<br> 0, 0,<br> 0, 0,<br> 0, 0,<br> {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},<br> },<br> 0,<br><br>
While the second one with the reordering of the %Import produces:<br>// sip_examplemyns.cpp<br>
...<br>
sipClassTypeDef sipTypeDef__example_myns = {<br>
{<br>
-1,<br>
0,<br>
0,<br>
SIP_TYPE_NAMESPACE,<br>
sipNameNr_myns,<br>
{0}<br>
},<br>
{<br>
sipNameNr_myns, // Difference!<br>
{0, 0, 1}, // Difference!<br>
0, 0,<br>
0, 0,<br>
0, 0,<br>
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},<br>
},<br>
<br>When I load the module in python for the first example above, the namespace 'class' isn't there:<br>e.g.<br>>>> import example<br>>>> example.myns # doesn't exist<br><br>Whereas the second version with the %Import some_module after the the %Includes gives me<br>>>> import example<br>>>> examp.myns # exists<br><br>Is this some sort of bug in sip that's been fixed in a newer version of SIP? I tried to create a full example that shows this problem but I was hoping that this information is enough to help explain what was going on.<br><br>Thanks!<br>-Nate<br> </body>
</html>