1. from gtk2form.py:
# [:-1] is a *terrible* hack: formless sticks a Submit # button in the return value of getArgs when the # binding doesn't specify any other Buttons. It # *shouldn't* do this: it's lying about what arguments # the function will accept. It should rely on the user # interface-generater (like freeform and gtk2form) to # handle the case where no buttons are specified. That # way I can know whether or not a button should really # produce an argument to the method. deferred.callback(m(*values[:-1]))
that says it all.
2. The way Typed.coerce and coerceWithBinding work are really stupid. For one, they're both optional: all code that wants to talk the interface has to say:
if hasattr(o, 'coerceWithBinding'): o.coerceWithBinding(val, configurable) elif hasattr(o, 'coerce'): o.coerce(val)
It should just be required on the interface. Implementors can implement with pass quite easily.
For two, coerceWithBinding is a terrible name when the binding isn't what's being passed, but the configurable.
And for three, there's really no reason to have both methods -- if a coercion doesn't require the configurable to do anything, it can just ignore the argument.
Solution: There should just be coerce(val, configurable) on the interface, always required.
2 doesn't bother me as much as 1 does: it's a real problem that I can't think any way to get around for a complete implementation of a formless UI.
DP, do you agree with these changes? I can make patches for nevow and all usages of them in Quotient, too.