[qmtest] RFE concerning 'Extension' class
Stefan Seefeld
seefeld at sympatico.ca
Mon Jan 19 05:45:17 UTC 2004
Zack Weinberg wrote:
> I would like to see complete worked examples of this before I could
> decide whether it was good or not.
Attached is a patch that implements my suggestion: The
Extension.Type now maps the 'Field' instances to class variables.
The way this is done right now changes the order of the arguments
in the _argument_list variable, so I adjusted the xmldb.api.test.derived
test accordingly. (I run 'python setup.py check --serial' to test my
changes and the other 'serial' tests pass).
It's certainly possible to preserve the old argument order, but since
I didn't want to use the _mro_ list (which would imply a lot of duplicate
work, as the merge is done for all classes in the inheritance hierarchy
anyways) I didn't spend any time figuring out how to get the ordering
right.
Having to modify the above 'derived' test, I added a 'b' argument,
just to illustrate the new syntax my patch makes possible. (The Field
constructors should be modified to make all arguments optional, so any
'new style' argument declarations don't need to repeat the name in the
Field.)
Regards,
Stefan
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: metaclass_patch
URL: <http://sourcerytools.com/pipermail/qmtest/attachments/20040119/9f6b12d7/attachment.ksh>
More information about the qmtest
mailing list