Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Support multi-line statements in pdb #103124

Copy link
Copy link
@gaogaotiantian

Description

@gaogaotiantian
Issue body actions

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
(Pdb) 

We can have this:

(Pdb) def f():
...     pass
...   
(Pdb) 

The fundamental logic is handled by codeop.compile_command, we just need to port it in.

It'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:

(Pdb) print(
*** SyntaxError: '(' was never closed"

And 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.

I'll make the PR draft for now and wait for some more discussion on the matter.

Linked PRs

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancementA feature request or enhancement
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.