Comment 1 for bug 420364

Revision history for this message
James Henstridge (jamesh) wrote :

So my suggestion here was to do something like:

    class Coalesce(NamedFunc):
        ...
        @property
        def variable_factory(self):
            return self.args[0].variable_factory

The Comparable.__eq__() method tries to get self.variable_factory and cast the "other" value to that variable type, so the above would propagate the type info from the function arguments to the function return.

The same could be done for some other common functions (e.g. set Count.variable_factory to IntVariable).