This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Python Decimal supports '#' format, C Decimal does not.
Type: behavior Stage:
Components: Library (Lib) Versions: Python 3.11, Python 3.10
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: const, eric.smith, mark.dickinson
Priority: normal Keywords:

Created on 2022-03-02 23:39 by const, last changed 2022-04-11 14:59 by admin.

Messages (1)
msg414390 - (view) Author: Constantine Evans (const) Date: 2022-03-02 23:39
Decimal as implemented in _pydecimal supports the '#' alternate form in format strings, though this does not appear to be documented: as with floats, it causes a decimal point to be included regardless of value.  Decimal as implemented in cdecimal, as it uses libmpdec, does not.

This is a rather minor discrepancy; I hadn't actually intended to have # in my format string at all, but it had ended up there and was causing errors for half of the users of my library.  # also could be useful for decimals, as it can be for floats.

Like #45739, it's unclear to me whether this is a discrepancy that should be corrected by implementing # for cdecimal, removing # support for _pydecimal, or just documenting the inconsistency.
History
Date User Action Args
2022-04-11 14:59:56adminsetgithub: 91060
2022-03-03 00:03:06eric.smithsetnosy: + mark.dickinson
2022-03-03 00:02:34eric.smithsetnosy: + eric.smith
2022-03-02 23:39:52constcreate