list
- это встроенная команда в оболочке отладки:
(Pdb) help list
l(ist) [first [,last] | .]
List source code for the current file. Without arguments,
list 11 lines around the current line or continue the previous
listing. With . as argument, list 11 lines around the current
line. With one argument, list 11 lines starting at that line.
With two arguments, list the given range; if the second
argument is less than the first, it is a count.
The current line in the current frame is indicated by "->".
If an exception is being debugged, the line where the
exception was originally raised or propagated is indicated by
">>", if it differs from the current line.
Так, когда вы печатаете
(Pdb) list(zip(first, other))
он пытается интерпретировать это как команду, переданную pdb. Вместо этого вы хотите выполнить (или p
rint) выражение в python:
(Pdb) list(zip(first, other))
*** Error in argument: '(zip(first, other))'
(Pdb) !list(zip(first, other))
[('p', 'k'), ('a', 'a'), ('l', 'l'), ('e', 'e')]
(Pdb) p list(zip(first, other))
[('p', 'k'), ('a', 'a'), ('l', 'l'), ('e', 'e')]