Skip to content
Advertisement

How to use list() when in an ipdb session?

In a Python 3.5.2 script where I have, e.g.,

JavaScript

The interpreter hits these lines and drops me into an ipdb session. Understandably, ipdb has limited functionality compared to an iPython interpreter session (e.g., no magic commands). However, I’m surprised to find that some Python built-ins don’t work, namely list().

JavaScript

I’m guessing there is a name collision between the built-in function list() and one of the ipdb commands. Any way around this?

Advertisement

Answer

JavaScript

! overrides all pdb commands.

Source: https://github.com/gotcha/ipdb/issues/106:

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement