Message358581
Mark, to answer your question regarding the two implementations of Decimals:
No, in the cases I stated above there are no differences in their behaviour.
In order to dig a bit deeper, I wrote a little test:
d = cdec.Decimal("1234567890.1234")
p = pydec.Decimal("1234567890.1234")
for fill in ('', ' ', '_'):
for align in ('', '<', '>', '^', '='):
for sign in ('', '-', '+', ' '):
for zeropad in ('', '0'):
for min_width in ('', '25'):
for thousands_sep in ('', ','):
for precision in ('', '.3', '.5'):
for ftype in ('', 'e', 'f', 'g'):
fmt = f"{fill}{align}{sign}{zeropad}{min_width}{thousands_sep}{precision}{ftype}"
try:
df = format(d, fmt)
except ValueError:
df = "<ValueError>"
try:
pf = format(p, fmt)
except ValueError:
pf = "<ValueError>"
if df != pf:
print(fmt, df, pf)
It did not reveal any differences. The two implementations are equivalent regarding the tested combinations. |
|
Date |
User |
Action |
Args |
2019-12-17 21:22:45 | mamrhein | set | recipients:
+ mamrhein, rhettinger, facundobatista, mark.dickinson, eric.smith, skrah |
2019-12-17 21:22:45 | mamrhein | set | messageid: <1576617765.93.0.117727945326.issue39077@roundup.psfhosted.org> |
2019-12-17 21:22:45 | mamrhein | link | issue39077 messages |
2019-12-17 21:22:45 | mamrhein | create | |
|