PYTHON_OBJECT_FACTORY

A helper class which simplifies the construction of lightweight Python primitives such as numbers and strings. This class also handles "automatic" conversion of standard Eiffel primitive values into Python-compatible primitives. It is used extensively to transform arrays of Eiffel primitives into useful Python tuples for passing as argument lists to Python functions.

class interface PYTHON_OBJECT_FACTORY
feature(s) from PYTHON_OBJECT_FACTORY
   new_python_string (value: STRING): PYTHON_STRING
   new_python_integer (value: INTEGER): PYTHON_INTEGER
   new_python_float (value: DOUBLE): PYTHON_FLOAT
   new_python_tuple (value: ARRAY[ANY]): PYTHON_TUPLE
   None_python_object: PYTHON_OBJECT
      -- a representation of the Python "None" object--for comparisons
   python_equivalent (object: ANY): PYTHON_OBJECT
      -- a heinous hack, this does type checking to convert an object 
      -- into its python equivalent.  Evil, but it simplifies conversion
      -- of manifest arrays tremendously
      -- STRINGs become PYTHON_STRINGs
      -- INTEGERs become PYTHON_INTEGERs
      -- REALs or DOUBLEs become PYTHON_FLOATs
      -- ARRAYs become PYTHON_TUPLEs (default to this for method 
      -- argument lists)
      ensure
         Result /= Void
end of PYTHON_OBJECT_FACTORY