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

For float.__format__, don't add a trailing ".0" if we're using no type code and we have an exponent #50022

Closed
ericvsmith opened this issue Apr 16, 2009 · 5 comments
Assignees
Labels
easy interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error

Comments

@ericvsmith
Copy link
Member

BPO 5772
Nosy @mdickinson, @ericvsmith

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = 'https://github.com/ericvsmith'
closed_at = <Date 2009-04-22.14:49:48.078>
created_at = <Date 2009-04-16.10:57:20.292>
labels = ['interpreter-core', 'easy', 'type-bug']
title = 'For float.__format__, don\'t add a trailing ".0" if we\'re using no type code and we have an exponent'
updated_at = <Date 2009-04-22.14:49:48.076>
user = 'https://github.com/ericvsmith'

bugs.python.org fields:

activity = <Date 2009-04-22.14:49:48.076>
actor = 'eric.smith'
assignee = 'eric.smith'
closed = True
closed_date = <Date 2009-04-22.14:49:48.078>
closer = 'eric.smith'
components = ['Interpreter Core']
creation = <Date 2009-04-16.10:57:20.292>
creator = 'eric.smith'
dependencies = []
files = []
hgrepos = []
issue_num = 5772
keywords = ['easy']
message_count = 5.0
messages = ['86021', '86022', '86030', '86042', '86299']
nosy_count = 2.0
nosy_names = ['mark.dickinson', 'eric.smith']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = None
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue5772'
versions = ['Python 3.1', 'Python 2.7']

@ericvsmith
Copy link
Member Author

The point of the empty type code is to make sure a number looks like a
float (so as to avoid formatting 2.0 as "2"). But if we have an
exponent, the result already looks like a float, so there's no need to
modify the number further.

@ericvsmith ericvsmith self-assigned this Apr 16, 2009
@ericvsmith ericvsmith added interpreter-core (Objects, Python, Grammar, and Parser dirs) easy type-bug An unexpected behavior, bug, or error labels Apr 16, 2009
@ericvsmith
Copy link
Member Author

For a more detailed discussion, scroll to the bottom of
http://mail.python.org/pipermail/python-dev/2009-April/088417.html

@mdickinson
Copy link
Member

Just for the public record, I think that getting rid of the '.0' is the
right thing to do here.

@ericvsmith
Copy link
Member Author

Fixed in py3k (which will become 3.1) in r71665.

@ericvsmith
Copy link
Member Author

Fixed in trunk as part of r71796. Closing the issue.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
easy interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

2 participants