Title: Support multi-line statements in pdb · Issue #103124 · python/cpython · GitHub
Open Graph Title: Support multi-line statements in pdb · Issue #103124 · python/cpython
X Title: Support multi-line statements in pdb · Issue #103124 · python/cpython
Description: Feature or enhancement Support multi-line statements in pdb just like in normal Python interactive shells Pitch Currently, we have this: (Pdb) def f(): *** IndentationError: expected an indented block after function definition on line 1 ...
Open Graph Description: Feature or enhancement Support multi-line statements in pdb just like in normal Python interactive shells Pitch Currently, we have this: (Pdb) def f(): *** IndentationError: expected an indented bl...
X Description: Feature or enhancement Support multi-line statements in pdb just like in normal Python interactive shells Pitch Currently, we have this: (Pdb) def f(): *** IndentationError: expected an indented bl...
Opengraph URL: https://github.com/python/cpython/issues/103124
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Support multi-line statements in pdb","articleBody":"# Feature or enhancement\r\n\r\nSupport multi-line statements in pdb just like in normal Python interactive shells\r\n\r\n# Pitch\r\n\r\nCurrently, we have this:\r\n```\r\n(Pdb) def f():\r\n*** IndentationError: expected an indented block after function definition on line 1\r\n(Pdb) \r\n```\r\n\r\nWe can have this:\r\n\r\n```\r\n(Pdb) def f():\r\n... pass\r\n... \r\n(Pdb) \r\n```\r\n\r\nThe fundamental logic is handled by `codeop.compile_command`, we just need to port it in.\r\n\r\nIt's kind of a breaking change, as the behavior for the once failed single-line check only code could potentially work. For example, we have this in the error case check:\r\n\r\n```\r\n(Pdb) print(\r\n*** SyntaxError: '(' was never closed\"\r\n```\r\n\r\nAnd it won't be failing anymore as we can close it in the next line. But in general, I believe this feature has more benifits than problems.\r\n\r\nI'll make the PR draft for now and wait for some more discussion on the matter.\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-103125\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/gaogaotiantian","@type":"Person","name":"gaogaotiantian"},"datePublished":"2023-03-30T06:39:30.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/103124/cpython/issues/103124"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:7bf2fddb-ef20-7f77-429e-af4a3554c614 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 82C4:201472:CA8ECD:11CE272:696A21AC |
| html-safe-nonce | 0057fa81fb1d2208e706a3d84b699a9c48193d483cb84013b20c16b0abab5b23 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MkM0OjIwMTQ3MjpDQThFQ0Q6MTFDRTI3Mjo2OTZBMjFBQyIsInZpc2l0b3JfaWQiOiI3Mjg5MjEyNzg5MDgxMTIxMTk2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | c3f415536672b9a4f8aad5e33cb69fa8e6e759662937b123ff4a1cb2ce7d270d |
| hovercard-subject-tag | issue:1647007418 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/103124/issue_layout |
| twitter:image | https://opengraph.githubassets.com/663a16c29398809b9d398050f4871ad8274ddbd4ee08ed14de3c2510893dce36/python/cpython/issues/103124 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/663a16c29398809b9d398050f4871ad8274ddbd4ee08ed14de3c2510893dce36/python/cpython/issues/103124 |
| og:image:alt | Feature or enhancement Support multi-line statements in pdb just like in normal Python interactive shells Pitch Currently, we have this: (Pdb) def f(): *** IndentationError: expected an indented bl... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | gaogaotiantian |
| hostname | github.com |
| expected-hostname | github.com |
| None | 014f3d193f36b7d393f88ca22d06fbacd370800b40a547c1ea67291e02dc8ea3 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | d515f6f09fa57a93bf90355cb894eb84ca4f458f |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width