From: Dethe E. <de...@ma...> - 2002-08-28 17:25:17
|
[snipped a bunch of to and fro about default arguments] > You almost had me convinced. But after looking at the existing > directive code, I saw a problem. Directives that have options, like > "image" or "contents", use the options dictionary returned by > "docutils.utils.extract_extension_options" to update another > dictionary, either "option_presets" or "pending.details". In the case > of "image", the "option_presets" parameter contains an "alt" entry, a > filename to be used as the last-resort default for the "alt" option. > Setting default option values for unspecified options means that the > dict.update code would have to become very nasty. *That's* where the > lack of defaults pays off: a ``presets.update(options)`` operation > doesn't clobber legitimate presets with bogus defaults. But in this case, aren't the presets the defaults? Wouldn't making the presets act specifically as defaults make the code simpler rather than more complicated? Or am I just not getting it? Sorry to be so blockheaded on such a relatively trivial matter. > But at least it's an established standard that many people are > familiar with. And directives *are* commands; they're commands to the > parser from inside the document. Again, they're *not* XML elements. No, they're XML Processing Instructions <0.5 wink> --Dethe |