[Python-3000] Substantial rewrite of PEP 3101
Eric V. Smith
eric+python-dev at trueblade.com
Tue Jun 5 17:16:14 CEST 2007
> Other kinds of customization require replacing a much larger chunk of
> code. Changing the "underscores" and "check-unused" behavior requires
> overriding 'vformat', which means replacing the entire template string
> parser. I figured that there would be a lot of people who might want
> these features, but didn't want to rewrite all of vformat.
Actually you only have to replace get_positional or get_named, I think.
And I don't see how the "check-unused" behavior can be written in the
base class, in the presence of get_positional and get_named. If the
list of identifiers isn't known to the base class (as in your example of
NamespaceFormatter), then how can the base class know if they're all used?
>> I've started a sample implementation to test this API. For starters,
>> I'm writing it in pure Python, but my intention is to use the code in
>> the pep3101 sandbox once I have some tests written and we're happy
>> with the API.
I think we'll know more when I've made some more progress on this.
More information about the Python-3000