The slice2py generator converts a long constant into a string when the value exceeds integer, where it should become a long.
For instance, creating a test.ice file
and importing it into PythonCode:module test { const long TestLongConst1 = 0x7fffffff; // ((1<<31) - 1) const long TestLongConst2 = 0x80000000; // (1<<31) };
producesCode:import test print test.TestLongConst1, type(test.TestLongConst1) print test.TestLongConst2, type(test.TestLongConst2)
Code:2147483647 <type 'int'> 2147483648 <type 'str'>

Reply With Quote