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-29526 Add reference to help('FORMATTING') in format() builtin #166

Merged
merged 1 commit into from
May 29, 2017

Conversation

aktech
Copy link
Contributor

@aktech aktech commented Feb 19, 2017

>>> import pprint
>>> pprint.pprint(format.__doc__)
('Return value.__format__(format_spec)\n' 
 '\n'
 'format_spec defaults to the empty string.\n'
 '\n'
 "See help('FORMATTING') for description.")

@the-knights-who-say-ni
Copy link

Hello, and thanks for your contribution!

I'm a bot set up to make sure that the project can legally accept your contribution by verifying you have signed the PSF contributor agreement (CLA).

Unfortunately our records indicate you have not signed the CLA. For legal reasons we need you to sign this before we can look at your contribution. Please follow these steps to rectify the issue:

  1. Sign the PSF contributor agreement
  2. Wait at least one US business day and then check "Your Details" on bugs.python.org to see if your account has been marked as having signed the CLA (the delay is due to a person having to manually check your signed CLA)
  3. Reply here saying you have completed the above steps

Thanks again to your contribution and we look forward to looking at it!

@serhiy-storchaka serhiy-storchaka added the type-feature A feature request or enhancement label Feb 19, 2017
@@ -77,7 +77,9 @@ PyDoc_STRVAR(builtin_format__doc__,
"\n"
"Return value.__format__(format_spec)\n"
"\n"
"format_spec defaults to the empty string");
"format_spec defaults to the empty string.\n"
Copy link
Member

Choose a reason for hiding this comment

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

Python/clinic/bltinmodule.c.h is generated file. Changes should be made in Python/bltinmodule.c. Run make clinic for regenerating Python/clinic/bltinmodule.c.h.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, I see. Thanks, fixing now.

@aktech
Copy link
Contributor Author

aktech commented Mar 28, 2017

ping @serhiy-storchaka

@@ -578,12 +578,13 @@ format as builtin_format

Return value.__format__(format_spec)

format_spec defaults to the empty string
format_spec defaults to the empty string.
See help('FORMATTING') for description.
Copy link
Member

Choose a reason for hiding this comment

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

The initial section of help('FORMATTNG') describes replacement fields and everything but format specs. This could confuse a beginner. So I suggest as an alternative:
See the Format Specification Mini-Language section of help('FORMATTING').

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree with @terryjreedy that the pointer to the other docs isn't quite right. My suggestion would be to replace the second added sentence with:

See the Format Specification Mini-Language section of help('FORMATTING') for details.

Copy link
Contributor

@ncoghlan ncoghlan left a comment

Choose a reason for hiding this comment

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

Hi @aktech, sorry for the long delay on the review here. Would you mind taking a look at the suggested amendments to the precise wording?

@@ -578,12 +578,13 @@ format as builtin_format

Return value.__format__(format_spec)

format_spec defaults to the empty string
format_spec defaults to the empty string.
See help('FORMATTING') for description.
Copy link
Contributor

Choose a reason for hiding this comment

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

I agree with @terryjreedy that the pointer to the other docs isn't quite right. My suggestion would be to replace the second added sentence with:

See the Format Specification Mini-Language section of help('FORMATTING') for details.

@ncoghlan
Copy link
Contributor

Added the sprint label, as this PR was submitted at the PyCon Pune 2017 core development sprint.

@codecov
Copy link

codecov bot commented May 28, 2017

Codecov Report

Merging #166 into master will increase coverage by <.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #166      +/-   ##
==========================================
+ Coverage   83.41%   83.41%   +<.01%     
==========================================
  Files        1367     1367              
  Lines      345516   345516              
==========================================
+ Hits       288203   288211       +8     
+ Misses      57313    57305       -8
Impacted Files Coverage Δ
Lib/threading.py 82.69% <0%> (-0.18%) ⬇️
Lib/zipfile.py 88.68% <0%> (-0.16%) ⬇️
Lib/test/test_ssl.py 88% <0%> (-0.13%) ⬇️
Lib/pydoc.py 62% <0%> (+0.06%) ⬆️
Lib/test/test_random.py 98.64% <0%> (+0.19%) ⬆️
Lib/nntplib.py 81.57% <0%> (+0.35%) ⬆️
Lib/heapq.py 98.85% <0%> (+3.81%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1cf93a7...1824378. Read the comment docs.

@aktech
Copy link
Contributor Author

aktech commented May 28, 2017

@ncoghlan I have made the changes, please have a look.

@ncoghlan ncoghlan merged commit 2e6bb44 into python:master May 29, 2017
@ncoghlan
Copy link
Contributor

Merged, thanks!

@miss-islington
Copy link
Contributor

🐍🍒⛏🤖 Thanks @aktech for the PR, and @ncoghlan for merging it 🌮🎉.I'm working now to backport this PR to: 3.6.

@miss-islington
Copy link
Contributor

Sorry, @aktech and @ncoghlan, I could not cleanly backport this to 3.6 due to a conflict.
Please backport using cherry_picker on command line.

@bedevere-bot
Copy link

GH-3491 is a backport of this pull request to the 3.6 branch.

serhiy-storchaka pushed a commit to serhiy-storchaka/cpython that referenced this pull request Sep 11, 2017
serhiy-storchaka pushed a commit to serhiy-storchaka/cpython that referenced this pull request Sep 11, 2017
serhiy-storchaka added a commit that referenced this pull request Sep 11, 2017
serhiy-storchaka added a commit that referenced this pull request Sep 11, 2017
akruis pushed a commit to akruis/cpython that referenced this pull request Aug 1, 2018
The C-API functions PyEval_EvalFrameEx() and PyEval_EvalFrame() were
broken, because Stackless does not use them and didn't test them. This
commit adds test code and makes the functions compatible with C-Python.
It is now save to call them from extension modules, i.e. modules created
by Cython.
akruis pushed a commit to akruis/cpython that referenced this pull request Aug 16, 2018
Support using PyEval_EvalFrameEx() without a main tasklet. And fix a
potential reference counting problem.
akruis pushed a commit to akruis/cpython that referenced this pull request Aug 16, 2018
The C-API functions PyEval_EvalFrameEx() and PyEval_EvalFrame() were
broken, because Stackless does not use them and didn't test them. This
commit adds test code and makes the functions compatible with C-Python.
It is now save to call them from extension modules, i.e. modules created
by Cython.
(cherry picked from commit d377c06)
akruis pushed a commit to akruis/cpython that referenced this pull request Aug 16, 2018
Support using PyEval_EvalFrameEx() without a main tasklet. And fix a
potential reference counting problem.

(cherry picked from commit 187184b)
akruis pushed a commit to akruis/cpython that referenced this pull request Sep 11, 2018
The C-API functions PyEval_EvalFrameEx() and PyEval_EvalFrame() were
broken, because Stackless does not use them and didn't test them. This
commit adds test code and makes the functions compatible with C-Python.
It is now save to call them from extension modules, i.e. modules created
by Cython.
(cherry picked from commit d377c06)
akruis pushed a commit to akruis/cpython that referenced this pull request Sep 11, 2018
Support using PyEval_EvalFrameEx() without a main tasklet. And fix a
potential reference counting problem.

(cherry picked from commit 187184b)
@aktech aktech deleted the format-doc branch July 18, 2020 00:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sprint type-feature A feature request or enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants