This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: pdb can't convert dict_values to list
Type: behavior Stage: resolved
Components: Versions: Python 3.9
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: apetryla, christian.heimes
Priority: normal Keywords:

Created on 2021-12-16 15:36 by apetryla, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (2)
msg408714 - (view) Author: Aidas Petryla (apetryla) Date: 2021-12-16 15:36
Reproducing:

Running pdb shell (for example "python -m pdb <some_file.py>"

Input:
x = {'a': 1}
list(x.values())

Output:
*** Error in argument: '(x.values())'
msg408722 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2021-12-16 16:27
list is a pdb command.

(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.

You have to use "p list(x.values())" if you want to print the output of the list function.

(Pdb) x = {'a': 1}
(Pdb) p list(x.values())
[1]
History
Date User Action Args
2022-04-11 14:59:53adminsetgithub: 90260
2021-12-16 16:27:30christian.heimessetstatus: open -> closed

nosy: + christian.heimes
messages: + msg408722

resolution: not a bug
stage: resolved
2021-12-16 15:36:42apetrylacreate