This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: There is no mention of breakpoint() in the pdb documentation
Type: enhancement Stage: resolved
Components: Documentation Versions: Python 3.8, Python 3.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: Mariatta, barry, cheryl.sabella, docs@python, jcrmatos, miss-islington, xtreak
Priority: normal Keywords: patch, patch, patch, patch

Created on 2019-01-26 23:09 by jcrmatos, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 11691 merged jcrmatos, 2019-01-28 18:34
PR 11691 merged jcrmatos, 2019-01-28 18:34
PR 11691 merged jcrmatos, 2019-01-28 18:34
PR 11691 merged jcrmatos, 2019-01-28 18:34
PR 11702 merged miss-islington, 2019-01-30 17:23
PR 11702 merged miss-islington, 2019-01-30 17:24
PR 11702 merged miss-islington, 2019-01-30 17:24
Messages (23)
msg334406 - (view) Author: (jcrmatos) * Date: 2019-01-26 23:09
In the Pdb documentation, found at
https://docs.python.org/3.7/library/pdb.html?highlight=pdb#module-pdb
there is no mention of breakpoint().

In my opinion, this text

import pdb; pdb.set_trace()

should be replaced with

import pdb; pdb.set_trace()
New in version 3.7: breakpoint() replaces the previous line.

Thanks,

JM
msg334421 - (view) Author: Karthikeyan Singaravelan (xtreak) * (Python committer) Date: 2019-01-27 12:13
> New in version 3.7: breakpoint() replaces the previous line.

replaces sounds little more like removed or deprecated to me. How about the below under pdb.set_trace() doc and example using it in the beginning?

New in version 3.7: breakpoint() is a convenience function that internally calls pdb.set_trace()

Thanks
msg334422 - (view) Author: (jcrmatos) * Date: 2019-01-27 12:19
Hello,

What about like this
import pdb; pdb.set_trace()
New in version 3.7: breakpoint() is preferable to using the previous line.

Thanks,

JM
msg334423 - (view) Author: Karthikeyan Singaravelan (xtreak) * (Python committer) Date: 2019-01-27 12:26
I didn't want the doc to sound like breakpoint() is encouraged since it's optional and a shortcut. Hence my personal preference to just add a note with link to breakpoint() that it does the same thing. I will wait for someone else to rephrase it better since I am not a native speaker myself.

Thanks
msg334425 - (view) Author: Cheryl Sabella (cheryl.sabella) * (Python committer) Date: 2019-01-27 13:51
I agree with Karthikeyan.  If it's added to the pdb doc page, I think the existing text should stay as it is, but a 'New in 3.7' added after it.

Something like:

The typical usage to break into the debugger from a running program is to insert

import pdb; pdb.set_trace()

at the location you want to break into the debugger. You can then step through the code following this statement, and continue running without the debugger using the continue command.

New in version 3.7: The built-in :func:`breakpoint()`, when called with defaults, can be used instead of ``import pdb; pdb.set_trace()``.
msg334426 - (view) Author: (jcrmatos) * Date: 2019-01-27 13:58
Hello,

In my first message I said exactly that (the replacement used the previous text, if you check it).

I'm ok with the wording from Cheryl. How about you Karthikeyan?

Thanks,

JM
msg334427 - (view) Author: Karthikeyan Singaravelan (xtreak) * (Python committer) Date: 2019-01-27 14:32
I am ok with Cheryl's idea too.
msg334434 - (view) Author: Cheryl Sabella (cheryl.sabella) * (Python committer) Date: 2019-01-27 19:42
@jcrmatos, would you like to create a Github pull request with the change?
msg334435 - (view) Author: (jcrmatos) * Date: 2019-01-27 19:43
Hello,

I'm sorry, I have no idea how to do it.

JM
msg334438 - (view) Author: Cheryl Sabella (cheryl.sabella) * (Python committer) Date: 2019-01-27 22:19
@jcrmatos,

No problem.  :-)  If you are interested in learning how, we can guide you.  However, if you'd rather not, then that's OK too and we'll make the patch.  Just let us know which you'd prefer.

If you need help deciding, take a look at the devguide on how to get started.  
https://devguide.python.org/

Thanks!
msg334440 - (view) Author: (jcrmatos) * Date: 2019-01-28 03:34
Hello,

Yes, I'm interested in learning, thanks.
I use Windows not Linux. Is that a problem?
I will read the guide and let you know if I have any questions. Thanks again.

JM
msg334441 - (view) Author: (jcrmatos) * Date: 2019-01-28 04:12
Hello,

I'm using Github web interface.
I did these steps:
- Forked cpython and changed the pdb.rst file.
- Created a branch called "fix-issue-35835".
- Made the commit with description "Add reference to Python 3.7 new function breakpoint()".
- Made the pull request with title "bpo-35835: Add reference to Python 3.7 new function breakpoint()".
- Made the merge commit.

Now I have an option to delete the fix-issue-35835 branch.
Should I do it? I read some Git tutorials and I think I can, but can you confirm?

After that, how should I procede to create the patch?

Thanks,

JM
msg334442 - (view) Author: (jcrmatos) * Date: 2019-01-28 04:40
Hello,

On the previous message I forgot to mention that the pull request was made in my fork, not the cpython repo.
Should I made a PR in the cpython repo at this point?

Thanks,

JM
msg334443 - (view) Author: Karthikeyan Singaravelan (xtreak) * (Python committer) Date: 2019-01-28 04:44
@jcrmatos yes, you should be making a PR to CPython repo's master branch since GitHub PRs are accepted. I hope also need to sign the CLA for your contribution to get merged though it's a documentation fix.

Thanks
msg334444 - (view) Author: (jcrmatos) * Date: 2019-01-28 04:47
Hello,

Yes, I signed the CLA and now I have to wait at least 1 business day.
So I will wait for that confirmation before making the PR to the CPython repo.

Thanks,

JM
msg334465 - (view) Author: Cheryl Sabella (cheryl.sabella) * (Python committer) Date: 2019-01-28 13:36
@jcrmatos - Sounds like you're on the right track.  :-)

Based on the steps you've outlined, I just had one question.  Were you able to rebuild the docs locally in order to see how your changes looked?  Here's the direct link to building the docs:
https://devguide.python.org/documenting/#building-doc

In section 7.5.1, it mentions Windows, so you should be able to follow that.  Although, I've had to use `./make html` in Powershell, so if `make html` doesn't work, then try that.
msg334469 - (view) Author: (jcrmatos) * Date: 2019-01-28 14:14
Hello,

I didn't do anything locally. I did the change and preview it on GitHub's web interface.

Has I said, I did a PR to my own fork and now I think I have to do a PR to the cpython master. Is that correct?
The PR to my own fork was required, or the commit was enough?

Now I have an option to delete the fix-issue-35835 branch.
Should I do it? I read some Git tutorials and I think I can, but can you confirm?


Thanks in advance,

JM
msg334473 - (view) Author: Cheryl Sabella (cheryl.sabella) * (Python committer) Date: 2019-01-28 15:22
As Karthikeyan said, you do need to open a PR against the CPython master.  I'm not a Git expert, but this page (section 3.3) discusses the steps to open that PR:
https://devguide.python.org/pullrequest/

Those are the steps I follow and it's a good write-up so there's not much I can add to it.  I don't think the PR on your own fork was required.  It doesn't usually ask to delete the branch until the PR against CPython master has been merged (which is the last step in section 3.3), but since you merged against your own fork, that's probably why it's asking now.  Do you still get an option to create a PR against CPython master using your branch as per this part of section 3.3?

> Finally go on https://github.com/<your-username>/cpython: you will see a box with the branch you just pushed and a green button that allows you to create a pull request against the official CPython repository.
msg334487 - (view) Author: (jcrmatos) * Date: 2019-01-28 18:51
I deleted the fork and started again.
This time I didn't PR to my own fork but to cpython master.
It is now waiting for review, "skip news" labeling and CLA (I'm still waiting on my request).
msg334576 - (view) Author: miss-islington (miss-islington) Date: 2019-01-30 17:23
New changeset cf991e653ac550a9f011631447c61ce583404a57 by Miss Islington (bot) (João Matos) in branch 'master':
bpo-35835: Add reference to Python 3.7 new breakpoint() function in pdb documentation. (GH-11691)
https://github.com/python/cpython/commit/cf991e653ac550a9f011631447c61ce583404a57
msg334577 - (view) Author: Mariatta (Mariatta) * (Python committer) Date: 2019-01-30 17:25
Thanks!
msg334578 - (view) Author: (jcrmatos) * Date: 2019-01-30 17:28
Thank you all for the help.
msg334583 - (view) Author: miss-islington (miss-islington) Date: 2019-01-30 17:41
New changeset 7516f265a8517e4fdc7d6e63d72ae1b57fda26ee by Miss Islington (bot) in branch '3.7':
bpo-35835: Add reference to Python 3.7 new breakpoint() function in pdb documentation. (GH-11691)
https://github.com/python/cpython/commit/7516f265a8517e4fdc7d6e63d72ae1b57fda26ee
History
Date User Action Args
2022-04-11 14:59:10adminsetgithub: 80016
2019-01-30 17:41:55miss-islingtonsetmessages: + msg334583
2019-01-30 17:28:12jcrmatossetmessages: + msg334578
2019-01-30 17:25:49Mariattasetstatus: open -> closed


keywords: patch, patch, patch, patch
nosy: + Mariatta
messages: + msg334577
resolution: fixed
stage: patch review -> resolved
2019-01-30 17:24:11miss-islingtonsetpull_requests: + pull_request11557
2019-01-30 17:24:04miss-islingtonsetpull_requests: + pull_request11556
2019-01-30 17:23:56miss-islingtonsetpull_requests: + pull_request11555
2019-01-30 17:23:43miss-islingtonsetnosy: + miss-islington
messages: + msg334576
2019-01-28 18:51:52jcrmatossetmessages: + msg334487
2019-01-28 18:34:45jcrmatossetkeywords: + patch
stage: needs patch -> patch review
pull_requests: + pull_request11535
2019-01-28 18:34:37jcrmatossetkeywords: + patch
stage: needs patch -> needs patch
pull_requests: + pull_request11534
2019-01-28 18:34:28jcrmatossetkeywords: + patch
stage: needs patch -> needs patch
pull_requests: + pull_request11533
2019-01-28 18:34:19jcrmatossetkeywords: + patch
stage: needs patch -> needs patch
pull_requests: + pull_request11532
2019-01-28 15:22:50cheryl.sabellasetmessages: + msg334473
2019-01-28 14:14:45jcrmatossetmessages: + msg334469
2019-01-28 13:36:10cheryl.sabellasetmessages: + msg334465
2019-01-28 04:47:43jcrmatossetmessages: + msg334444
2019-01-28 04:44:38xtreaksetmessages: + msg334443
2019-01-28 04:40:12jcrmatossetmessages: + msg334442
2019-01-28 04:12:05jcrmatossetmessages: + msg334441
2019-01-28 03:34:44jcrmatossetmessages: + msg334440
2019-01-27 22:19:37cheryl.sabellasetmessages: + msg334438
2019-01-27 19:43:22jcrmatossetmessages: + msg334435
2019-01-27 19:42:15barrysetnosy: + barry
2019-01-27 19:42:00cheryl.sabellasetmessages: + msg334434
2019-01-27 14:32:48xtreaksetmessages: + msg334427
2019-01-27 13:58:02jcrmatossetmessages: + msg334426
2019-01-27 13:51:25cheryl.sabellasetnosy: + cheryl.sabella
messages: + msg334425
2019-01-27 12:26:29xtreaksetmessages: + msg334423
2019-01-27 12:19:01jcrmatossetmessages: + msg334422
2019-01-27 12:13:47xtreaksetnosy: + xtreak
messages: + msg334421
2019-01-27 11:23:59SilentGhostsetassignee: docs@python

nosy: + docs@python
components: + Documentation
stage: needs patch
2019-01-26 23:09:09jcrmatoscreate