durusmail: quixote-users: Question about Form._names
Question about Form._names
2003-11-23
Question about Form._names
Greg Ward
2003-11-23
Just noticed a code/doc discrepancy in quixote.form2.Form.  The class
docstring says:

      _names : { name:string : Widget|FormComponent }
        names used in the form

...which implies that _add_component could be used to add an instance of
FormComponent *or* of Widget to the '_names' dict.  (BTW, wouldn't a
better name for that dict be '_components'?)

But the implementation of _add_component() says otherwise:

    def add_component(self, klass, name, *args, **kwargs):
        [...]
        if not issubclass(klass, FormComponent):
            raise TypeError, 'FormComponent subclass required (got %r)' % klass

So who's right?

        Greg
--
Greg Ward                          http://www.gerg.ca/
The NSA.  We care: we listen to our customers.

reply