[Python-checkins] r61123 - in python/trunk: Lib/decimal.py Lib/test/test_decimal.py Misc/NEWS
Eric Smith
eric+python-dev at trueblade.com
Fri Feb 29 17:04:35 CET 2008
Nick Coghlan wrote:
> Mark Dickinson wrote:
>> Raymond Hettinger <python <at> rcn.com> writes:
>>
>>> Wow, the decimal module has grown to 5500 lines.
>>>
>>> Raymond
>>>
>> It would be really great if the code for parsing the
>> format specifier and padding and aligning the
>> formatted value could be put elsewhere in the
>> std. lib.; it's really not decimal specific, and
>> it could be potentially useful to other modules.
>>
>> Any suggestions for places to move it to?
>
> As the parsing functions are specifically for numeric formatting
> support, the numbers module seems like a reasonable option to me.
The int, long, and str formatters use the same parsing routine, then
they each check that what they got was valid for their type. I went
back and forth on this, but it ended up being less code if they shared
the parsing routing.
So, this doesn't apply exclusively to numbers, although I agree that
will be the most common usage.
Eric.
More information about the Python-checkins
mailing list