Allow modifying global variables from the variables panel
@judej is already working on this.
Since Mar 5, 2025.
Assessment
This issue has not been assessed yet.
Description
Environment data
- debugpy version: 1.8.13
- OS and version: Windows 11
- Python version (& distribution if applicable, e.g. Anaconda): 3.12.7
- Using VS Code or Visual Studio: VS Code 1.93.1
Actual behavior
https://github.com/user-attachments/assets/9ec3ca67-de5c-4ab7-a35b-905840013559
Expected behavior
To either prohibit editing global variable in that case as it's not editable or actually edit it.
Steps to reproduce:
- Set breakpoint at
b = 35in the snippet below and run it. - Attach to Python using debugger.
- Change
cvalue inVariablessection to1000. - Step Over (F10), global variable is moved to locals and global variable value is reset.
What I've also noticed that if on step 3 I run globals()['c'] in Debug Console, it prints 0 and Variables are reset as we would be on the step 4.
c = 0
def main():
a = 25
import debugpy
debugpy.listen(5678)
debugpy.wait_for_client()
b = 35
print(a + b + c)
if __name__ == "__main__":
main()
- Dominant language
- Python
- Stars
- 2.5k
- Forks
- 202
- Avg merge
- 5d 1h
- Merged PRs (30d)
- 1
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/debugpy
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
All issues in microsoft/debugpy
Similar issues
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
canonical/paas-charm#368 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
tech debt
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
StevenBlack/hosts#3256 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
qualcomm/qai-appbuilder#275 ·