bpo-21161: pdb: default: handle list comprehensions - #15194
Conversation
00fac9a to
ff84fb3
Compare
|
Congrats for the work here :) |
I do not think it is necessary really - the test proves that the namespace is handled properly/differently already. |
| def test_list_comprehensions(self): | ||
| script = """ | ||
| def f(): | ||
| mylocal = "init_mylocal" # noqa: F841 |
There was a problem hiding this comment.
What does the comment mean?
There was a problem hiding this comment.
Local variable name is assigned to but never used (F841)
| commands = """ | ||
| continue | ||
|
|
||
| p "mylocal:" + mylocal |
There was a problem hiding this comment.
Do you need this line in the test?
| if line[:1] == '!': line = line[1:] | ||
| locals = self.curframe_locals | ||
| globals = self.curframe.f_globals | ||
| ns = self.curframe.f_globals.copy() |
There was a problem hiding this comment.
What it the code that is being debugged changes globals()? This would mean any changes to self.curframe.f_globals by the calling code is dropped, is it not?

Fixes https://bugs.python.org/issue21161.
TODO:
https://bugs.python.org/issue21161