[issue39096] Description of "Format Specification Mini-Language" not accurate for Decimal
New submission from Michael Amrhein <michael@adrhinum.de>: The description of the "Format Specification Mini-Language" states for float and Decimal regarding presentation type 'f': "The default precision is 6." Regarding presentation type None it reads: "Similar to 'g', except that fixed-point notation, when used, has at least one digit past the decimal point." While both statements are accurate for float, they don't hold for Decimal. In order to preserve the information about the decimal exponent, in both cases Decimal formatting displays as many fractional digits as dictated by it's exponent. ---------- assignee: docs@python components: Documentation messages: 358667 nosy: docs@python, mamrhein priority: normal severity: normal status: open title: Description of "Format Specification Mini-Language" not accurate for Decimal type: behavior versions: Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue39096> _______________________________________
Michael Amrhein <michael@adrhinum.de> added the comment: For a discussion of the different behaviour of float and Decimal see https://bugs.python.org/issue39077. ---------- _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue39096> _______________________________________
Change by Eric V. Smith <eric@trueblade.com>: ---------- nosy: +eric.smith, mark.dickinson _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue39096> _______________________________________
Change by Terry J. Reedy <tjreedy@udel.edu>: ---------- title: Description of "Format Specification Mini-Language" not accurate for Decimal -> "Format Specification Mini-Language" doc mistake for Decimal _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue39096> _______________________________________
Change by Mark Dickinson <dickinsm@gmail.com>: ---------- keywords: +patch pull_requests: +22419 stage: -> patch review pull_request: https://github.com/python/cpython/pull/23537 _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue39096> _______________________________________
Mark Dickinson <dickinsm@gmail.com> added the comment: New changeset c642374b3ef72f6f300616f07aea2a3f9ed83e51 by Mark Dickinson in branch 'master': bpo-39096: Improve description of 'e', 'f' and 'g' presentation types (#23537) https://github.com/python/cpython/commit/c642374b3ef72f6f300616f07aea2a3f9ed... ---------- _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue39096> _______________________________________
Change by miss-islington <mariatta.wijaya+miss-islington@gmail.com>: ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +22430 pull_request: https://github.com/python/cpython/pull/23550 _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue39096> _______________________________________
Change by miss-islington <mariatta.wijaya+miss-islington@gmail.com>: ---------- pull_requests: +22431 pull_request: https://github.com/python/cpython/pull/23551 _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue39096> _______________________________________
Mark Dickinson <dickinsm@gmail.com> added the comment: New changeset cf47b3969e21f66655fcb414ff9bfdd503069c2d by Miss Islington (bot) in branch '3.9': bpo-39096: Improve description of 'e', 'f' and 'g' presentation types (GH-23537) (GH-23550) https://github.com/python/cpython/commit/cf47b3969e21f66655fcb414ff9bfdd5030... ---------- _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue39096> _______________________________________
Mark Dickinson <dickinsm@gmail.com> added the comment: New changeset c3009a5818112b5fb8867d786ce33e0e9489f4e0 by Miss Islington (bot) in branch '3.8': bpo-39096: Improve description of 'e', 'f' and 'g' presentation types (GH-23537) (GH-23551) https://github.com/python/cpython/commit/c3009a5818112b5fb8867d786ce33e0e948... ---------- _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue39096> _______________________________________
Eric V. Smith <eric@trueblade.com> added the comment: These changes are a big improvement. Thanks, Mark. Should this issue be closed, or are you thinking of more changes? Personally I think we should leave it as it is now, and open another issue if people find fault with the new docs. ---------- _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue39096> _______________________________________
Mark Dickinson <dickinsm@gmail.com> added the comment: The 'default precision' issue is addressed; the issues that Michael reported about the `None` presentation type are still valid, I think. ---------- _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue39096> _______________________________________
Change by Mark Dickinson <dickinsm@gmail.com>: ---------- pull_requests: +22455 pull_request: https://github.com/python/cpython/pull/23575 _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue39096> _______________________________________
Mark Dickinson <dickinsm@gmail.com> added the comment:
Should this issue be closed, or are you thinking of more changes?
I've made one more round of changes in GH-23575. Once that's gone in, I think we can close this issue. I don't think we're ever going to be able to make this table perfectly accurate; at best, we can achieve a series of successive approximations to the truth. (Which is pretty much what I aim for when teaching.) ---------- _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue39096> _______________________________________
Change by miss-islington <mariatta.wijaya+miss-islington@gmail.com>: ---------- pull_requests: +22690 pull_request: https://github.com/python/cpython/pull/23831 _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue39096> _______________________________________
Julien Palard <julien+python@palard.fr> added the comment: New changeset 886b2e5c7a2caf87070728dba8f18c3d65e51071 by Mark Dickinson in branch 'master': bpo-39096: Format specification documentation fixes for numeric types (GH-23575) https://github.com/python/cpython/commit/886b2e5c7a2caf87070728dba8f18c3d65e... ---------- nosy: +mdk _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue39096> _______________________________________
Change by Julien Palard <julien+python@palard.fr>: ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue39096> _______________________________________
Change by miss-islington <mariatta.wijaya+miss-islington@gmail.com>: ---------- pull_requests: +22691 pull_request: https://github.com/python/cpython/pull/23832 _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue39096> _______________________________________
miss-islington <mariatta.wijaya+miss-islington@gmail.com> added the comment: New changeset 12032cdec5ae1e56d4e4b8206fb2e9cccc5a9f58 by Miss Islington (bot) in branch '3.8': bpo-39096: Format specification documentation fixes for numeric types (GH-23575) https://github.com/python/cpython/commit/12032cdec5ae1e56d4e4b8206fb2e9cccc5... ---------- _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue39096> _______________________________________
miss-islington <mariatta.wijaya+miss-islington@gmail.com> added the comment: New changeset b812e236df506603e592086269e088b00d021460 by Miss Islington (bot) in branch '3.9': bpo-39096: Format specification documentation fixes for numeric types (GH-23575) https://github.com/python/cpython/commit/b812e236df506603e592086269e088b00d0... ---------- _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue39096> _______________________________________
participants (6)
-
Eric V. Smith -
Julien Palard -
Mark Dickinson -
Michael Amrhein -
miss-islington -
Terry J. Reedy