(Using Ice 3.3.1 on Linux)
Consider this Slice definition:
In a Python client it's not possible to call printFloat() with an integer argument or use an integer value for the data member of the Value structure:Code:module Demo { struct Value { float v; }; interface Printer { void printFloat(float f); void printValue(Value v); }; };
Such a strict type validation is very unusual and inconvenient for Python. IMHO, IcePy should implicitly convert integers to floats in these cases.Code:>>> printer.printFloat(42) ValueError: invalid value for argument 1 in operation `printFloat' >>> v = Demo.Value(42) >>> printer.printValue(v) ValueError: invalid value for ::Demo::Value member `v'

Reply With Quote
