inducer / inducer/pudb

Breakpoints on lines with generator expressions

Open
#142 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
3.2k
Forks
245
Avg merge
13m
Merged PRs (30d)
5

Description

Say I have

``` py
if all(i == j for i, j in zip(range(10), range(10))):
print("yes")
```

and put a breakpoint on the first line. If I then `c`ontinue to the breakpoint and press `n`, it steps inside the generator expression. A similar thing happens with

``` py
if (lambda: True)():
print("yes")
```

but not for something like

``` py
if test():
print("yes")
```

The first one is an issue because of https://github.com/inducer/pudb/issues/141, but in general, this behavior seems counterintuitive. I would expect `n` to step over the line and `s` to step into it, which is what happens when you reach the line via normal means.

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the generator-expression and lambda examples in a debugging session, comparing `n` with `s` after continuing to the breakpoint. Trace the debugger's stepping decision for those expressions; done means `n` steps over the current line while `s` enters it, without changing the existing behavior for a normal function call.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.