Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-45708: Support underscore separators when formatting Decimal objects #29438

Closed

Conversation

mdickinson
Copy link
Member

@mdickinson mdickinson commented Nov 6, 2021

This PR extends formatting for Decimal objects to support underscores as thousands separators (as described in PEP 515). Previously, Decimal only supported commas as thousands separators, while int and float support both commas and underscores.

https://bugs.python.org/issue45708

Copy link
Member

@sobolevn sobolevn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! 👍

I looks almost identical to what I did 🙂

@mdickinson mdickinson added the type-feature A feature request or enhancement label Nov 6, 2021
@tiran
Copy link
Member

tiran commented Nov 6, 2021

This will break tests for vendors that de-bundle mpdecimal and use the upstream version. Fedora/CentOS/RHEL are not affected but Debian/Ubuntu use standaline libmpdecimal.

@mdickinson
Copy link
Member Author

This will break tests [...]

Darn. Thanks, @tiran - my instincts were telling me that we shouldn't modify libmpdec directly, but I failed to figure out why it was a problem.

Closing here; let's continue discussion on the issue.

@mdickinson mdickinson closed this Nov 7, 2021
@mdickinson mdickinson reopened this Nov 7, 2021
@mdickinson mdickinson marked this pull request as draft November 7, 2021 09:24
@mdickinson
Copy link
Member Author

mdickinson commented Nov 7, 2021

Re-opening as a proof-of-concept draft PR to show one possible way that we could take this forward without touching libmpdec.

@github-actions
Copy link

github-actions bot commented Dec 8, 2021

This PR is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale Stale PR or inactive for long period of time. label Dec 8, 2021
@mdickinson
Copy link
Member Author

Closing. This has served its purpose as a POC. I'm not likely to have time to turn it into a production-quality PR any time soon.

@mdickinson mdickinson closed this Apr 12, 2022
@mdickinson mdickinson deleted the support-underscore-in-decimal-format branch April 12, 2022 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting merge stale Stale PR or inactive for long period of time. type-feature A feature request or enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants