Python variables obscur ipdb commands
See original GitHub issueThis PR: #https://github.com/ipython/ipython/pull/9449 introduced annoying problem: I couldn’t step through the following code (execute line 3):
n = 1
next = 1
print('end')
Because n/next commands weren’t working:
$ ipdb test.py
> /tmp/test.py(1)<module>()
----> 1 n = 1
2 next = 1
3 print('end')
ipdb> next
> /tmp/test.py(2)<module>()
1 n = 1
----> 2 next = 1
3 print('end')
ipdb> next
> /tmp/test.py(3)<module>()
1 n = 1
2 next = 1
----> 3 print('end')
ipdb> next
1
ipdb> n
1
ipdb> !n
1
ipdb> !next
1
I discovered that in this case I can use standard pdb or I can get it to work in ipdb by using !!n
(it still has a bug that @tcztzy tried to solve in https://github.com/ipython/ipython/pull/10035) but what do you think about changing this behavior: all ipdb builtin commands should work as they meant to and if we want to see python variables we use i.e.: !n
instead of n
. Variables’ names that are not ipdb commands could still be displayed by just writing their name.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:13
- Comments:16 (9 by maintainers)
Top Results From Across the Web
ipdb commands obscured by variables - python
I installed python3-ipdb on my linux machine and it worked there also. next was always treated as a command and !next showed the...
Read more >Python Ipdb Cheatsheet - Chuan Wang's Website
With a function name, set a break at the first executable line of that function. Without argument, list all breaks. Each breakpoint is...
Read more >What Python debugger do you use?
All IDEs have debuggers, ie stepping through code and looking at variable values. So just say: I use my IDEs debugger and you've...
Read more >Python Scripting - The LLDB Debugger - LLVM
The breakpoint commands will use the global path Python variable that we got from our DFS ... It automatically gives the function an...
Read more >Python Debug Cheatsheet - Peter Xie - Medium
ipdb is an enhanced version of pdb (built-in). It supports all pdb commands and is simply easier to use like tab for auto-complete....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
#10050 reverts it. As the voting is currently 11-1 for reverting, I haven’t made it configurable at present - every config option adds complexity and potential bugs, so I’m reluctant to add them without a certain level of support.
We could also look at providing options to plug in externally developed debuggers - I don’t think our debugger is particularly great, and there are projects like pudb out there which have spent much more time than us on debugger UI.
Late to the party, but I wanted to say that I strongly support the reversion. Over and over we’ve encountered that customizations that try to be overly smart, even though well-intentioned, typically cause more confusion than they are worth. Over the years we’ve backed off on a number of those (made them optional when it’s easy to do in a simple way), and I think this falls in that category.
Thanks!