bpo-39096: Improve description of 'e', 'f' and 'g' presentation types by mdickinson · Pull Request #23537 · python/cpython (original) (raw)

The table of presentation types in the "Format specification mini-language" section of the library documentation tries to cover both Decimal and float, but is inaccurate in a number of ways for Decimal.

This PR fixes one particular part of that inaccuracy - the description of the default precision - and makes some other cleanups and consistency fixes along the way. In more detail:

I'm aiming for an incremental improvement here rather than a complete, perfectly-accurate description.

A wider issue is whether we should be attempting to document the rules for Decimal at all in this table, or whether we should simply document these as the rules for float, and move the description for Decimal elsewhere. But I think that ship has sailed already.

@ericvsmith : Any interest in reviewing?

https://bugs.python.org/issue39096