[issue23460] Decimals do not obey ':g' exponential notation formatting rules

2019-09-11 Thread Julien Palard


Change by Julien Palard :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23460] Decimals do not obey ':g' exponential notation formatting rules

2019-09-11 Thread Julien Palard


Julien Palard  added the comment:


New changeset 629f1f87e9b0bfd9f1dc3d02f966decde5c65201 by Julien Palard (Miss 
Islington (bot)) in branch '3.8':
bpo-23460: Fix documentation for decimal string :g formatting (GH-11850) 
(GH-15954)
https://github.com/python/cpython/commit/629f1f87e9b0bfd9f1dc3d02f966decde5c65201


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23460] Decimals do not obey ':g' exponential notation formatting rules

2019-09-11 Thread miss-islington


Change by miss-islington :


--
pull_requests: +15589
pull_request: https://github.com/python/cpython/pull/15954

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23460] Decimals do not obey ':g' exponential notation formatting rules

2019-09-11 Thread Julien Palard


Julien Palard  added the comment:


New changeset 1660a61a105bcd62e2dfa77885959a8992e9f14e by Julien Palard 
(Brennan D Baraban) in branch 'master':
bpo-23460: Fix documentation for decimal string :g formatting (GH-11850)
https://github.com/python/cpython/commit/1660a61a105bcd62e2dfa77885959a8992e9f14e


--
nosy: +mdk

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23460] Decimals do not obey ':g' exponential notation formatting rules

2019-03-03 Thread Brennan D Baraban


Brennan D Baraban <3...@holbertonschool.com> added the comment:

Hi Stefan. Is there an update you would like me to make on this PR? Otherwise, 
pinging for review.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23460] Decimals do not obey ':g' exponential notation formatting rules

2019-02-24 Thread Stefan Krah


Stefan Krah  added the comment:

On the other hand, the docs say "insignificant trailing zeros are removed from 
the significand", so technically it *is* correct, because trailing zeros are 
significant in decimal.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23460] Decimals do not obey ':g' exponential notation formatting rules

2019-02-24 Thread Stefan Krah


Stefan Krah  added the comment:

I just noticed that there are other differences, for example the "removal of 
trailing zeros" passage does not apply to Decimal:

>>> format(Decimal("1.00e-6"), "g")
'0.0100'

Perhaps it would be easier to have separate docs for float and decimal after 
all, or a long footnote for decimal.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23460] Decimals do not obey ':g' exponential notation formatting rules

2019-02-13 Thread Brennan D Baraban


Brennan D Baraban <3...@holbertonschool.com> added the comment:

I submitted a PR just now. I only pushed the change to `string.rst`, as per 
Stefan Krah's suggestion.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23460] Decimals do not obey ':g' exponential notation formatting rules

2019-02-13 Thread Brennan D Baraban


Change by Brennan D Baraban <3...@holbertonschool.com>:


--
pull_requests: +11881
stage: needs patch -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23460] Decimals do not obey ':g' exponential notation formatting rules

2019-02-11 Thread Brennan D Baraban


Brennan D Baraban <3...@holbertonschool.com> added the comment:

Well, Tuomas, I defer submission of a PR to you, as its your original patch.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23460] Decimals do not obey ':g' exponential notation formatting rules

2019-02-11 Thread Stefan Krah


Stefan Krah  added the comment:

Yes, these days PRs are the only way to get anything done. Before
GitHub it would have been possible to just commit the small diff
directly to master.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23460] Decimals do not obey ':g' exponential notation formatting rules

2019-02-11 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

> If contributions are accepted as GitHub pull requests
these days, I can do it myself too.

GitHub pull requests are accepted. Please see https://devguide.python.org/ .

Thanks

--
nosy: +xtreak

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23460] Decimals do not obey ':g' exponential notation formatting rules

2019-02-11 Thread Stefan Krah


Stefan Krah  added the comment:

The patch LGTM, but I'm not sure if we need to document __format__().
Personally I probably wouldn't.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23460] Decimals do not obey ':g' exponential notation formatting rules

2019-02-11 Thread Tuomas Suutari


Tuomas Suutari  added the comment:

> What is the status of this issue? I can submit a PR based on Tuomas Suutari's 
> patch.

Don't know more about the status, but nobody seemed to care to take my
patch forward. If contributions are accepted as GitHub pull requests
these days, I can do it myself too.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23460] Decimals do not obey ':g' exponential notation formatting rules

2019-02-10 Thread Brennan D Baraban


Brennan D Baraban <3...@holbertonschool.com> added the comment:

What is the status of this issue? I can submit a PR based on Tuomas Suutari's 
patch.

--
nosy: +bdbaraban

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23460] Decimals do not obey ':g' exponential notation formatting rules

2018-10-24 Thread Sergey Fedoseev


Change by Sergey Fedoseev :


--
nosy: +sir-sigurd

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23460] Decimals do not obey ':g' exponential notation formatting rules

2018-09-02 Thread Lorenz Mende


Lorenz Mende  added the comment:

I want to bring this issue up again.
As the others correctly stated, either the documentation or the implementation 
of Decimal 'g' formatting is incorrect.

For floats the implementation suits the docu:
>>> '{:g}'.format(0.1)
'1e-05'
For decimals:
>>> '{:g}'.format(decimal.Decimal('0.1'))
'0.1'

As there is a deviation between documentation and implementation, I advise to 
modify one of both.

--
nosy: +LorenzMende

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23460] Decimals do not obey ':g' exponential notation formatting rules

2015-03-07 Thread Tuomas Suutari

Tuomas Suutari added the comment:

Here's a patch that fixes the description for 'g' to explain what happens for 
`Decimal` and also documents the Decimal.__format__ in the documentation of the 
decimal module.

--
keywords: +patch
nosy: +Tuomas Suutari
Added file: http://bugs.python.org/file38370/issue23460.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23460
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23460] Decimals do not obey ':g' exponential notation formatting rules

2015-03-02 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
keywords: +easy
stage:  - needs patch
type:  - enhancement
versions: +Python 2.7, Python 3.5

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23460
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23460] Decimals do not obey ':g' exponential notation formatting rules

2015-03-02 Thread Mark Dickinson

Mark Dickinson added the comment:

I don't think we should close: the documentation as written explicitly says 
that the rules apply to both Decimal and float: The available presentation 
types for floating point and decimal values are   But the details listed 
for 'g' are incorrect.  We could either fix the description for 'g' to explain 
what happens for `Decimal`, or state up front that the table only applies 
directly to the `float` type, and that `Decimal` is similar but not identical.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23460
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23460] Decimals do not obey ':g' exponential notation formatting rules

2015-03-01 Thread Ezio Melotti

Ezio Melotti added the comment:

Should we add a note to the format docs, or just close this?

--
nosy: +ezio.melotti, mark.dickinson

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23460
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23460] Decimals do not obey ':g' exponential notation formatting rules

2015-02-14 Thread Stefan Krah

Stefan Krah added the comment:

For Decimal the cutoff point is -6 instead of -4 (following the
decimal specification instead of the C standard).

--
assignee:  - docs@python
components: +Documentation -Library (Lib)
nosy: +docs@python, skrah
type: behavior - 

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23460
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23460] Decimals do not obey ':g' exponential notation formatting rules

2015-02-13 Thread Ian Kelly

New submission from Ian Kelly:

 '{:g}'.format(D('0.01'))
'0.01'

Formatted with '{:e}', the exponent would be -6, so per the formatting rules 
described under the 'g' specifier at 
https://docs.python.org/3/library/string.html#format-specification-mini-language
 the above should be formatted using exponential notation.

--
components: Library (Lib)
messages: 235904
nosy: ikelly
priority: normal
severity: normal
status: open
title: Decimals do not obey ':g' exponential notation formatting rules
type: behavior
versions: Python 3.4

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23460
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com