Python functions to convert between native Python values and their INCO string representations.
All INCO values have a machine-readable string representation such as "abc" or 123.45:f. The exact syntax for this representation is defined under <value> in the Syntax Definitions.
Returns the string representation of the Python value value. If more than one value is given, returns a string containing the string representations of all values, separated by ", ".
Accepted values are integers, long integers, floating point numbers, and strings. Long integers outside of the range [-2147483648, 4294967295] raise an OverflowError. Floating point values are interpreted as double INCO values by default. To interpret them as float values instead, insert the incostringrep.tfloat type marker in front of them in the argument list. This will cause all subsequent floating point arguments to be interpreted as floats, until an incostringrep.tdouble type marker appears in the argument list, which switches the default type back to double.
import incostringrep
incostringrep.tostringrep('I say: "Hello World!"')
#--> "I say: \"Hello World\""
incostringrep.tostringrep(2.5)
#--> 2.5:d
incostringrep.tostringrep(incostringrep.tfloat, 2.5)
#--> 2.5:f
incostringrep.tostringrep(1.5, incostringrep.tfloat, 1.5, 3, 'ABC', 2.75, incostringrep.tdouble, 2.0)
#--> 1.5:d, 1.5:f, 3:l, "ABC", 2.75:f, 2:d
Evaluates the given string representation and returns the result as an integer, long integer, floating point, or string value. If the string is not a valid INCO string representation, None is returned.
These predefined objects of a private class serve as special markers for the incostringrep.tostringrep() function.
1.8.8