-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
bpo-28415: Note 0 conversion different between Python and C #885
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
Conversation
@grapherd, thanks for your PR! By analyzing the history of the files in this pull request, we identified @birkenfeld, @serhiy-storchaka and @benjaminp to be potential reviewers. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think instead of a .. note::
, it's better to follow the style of the table in https://docs.python.org/3/library/stdtypes.html#printf-style-string-formatting since we may find more exceptions in future. And I think the examples are not needed.
Too much words for minor difference. |
@zhangyangyu @serhiy-storchaka After reference the description from cpp - printf, simplify the note about it. |
Actually I prefer the previous wording:
It's more direct to me and the current wording gives a feeling that the precision won't take effects at all. :-( |
See comment on https://bugs.python.org/issue28415 for minimal and terse alternatives. Build error will disappear with either suggestion. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See link to issue in comment
Just adding the two notes will suffice. I don't think readers are helped at all by changing "exactly" to "nearly" over such a minor distinction. The word "nearly" creates an unnecessary sense of risk and uncertainty in the minds of readers. Also, I think this is so unimportant that it shouldn't be backported. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The proposed addition is not proper English. I give a different version on the issue. I also think 'exactly' should just be removed when not exactly true, but will not push for that.
Doc/c-api/bytes.rst
Outdated
@@ -72,28 +72,28 @@ called with a non-bytes parameter. | |||
| :attr:`%c` | int | A single byte, | | |||
| | | represented as a C int. | | |||
+-------------------+---------------+--------------------------------+ | |||
| :attr:`%d` | int | Exactly equivalent to | | |||
| :attr:`%d` | int | Nearly equivalent to | | |||
| | | ``printf("%d")``. | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a reference to the note, like (1).
I would prefer to remove Nearly/Exactly. I don't think that the subtle difference is major enough to justify a "Nearly".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So we agree dropping 'exactly' when not exactly true.
Doc/c-api/unicode.rst
Outdated
@@ -451,43 +451,43 @@ APIs: | |||
| :attr:`%c` | int | A single character, | | |||
| | | represented as a C int. | | |||
+-------------------+---------------------+--------------------------------+ | |||
| :attr:`%d` | int | Exactly equivalent to | | |||
| :attr:`%d` | int | Nearly equivalent to | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto
@terryjreedy, @Haypo, @zhangyangyu, could you help for review the latest addressed? |
Replacing the original 'Exactly' with a note marker looks good to me. I cannot apply patch to test generated html for correct formatting, but assuming you have, I approve net result. |
I put down the unicode footnote under the original note block |
Thanks @lulouie ! This style looks good and is actually what I mean at first. |
No description provided.