Following the canonical advice of this post, I am trying to cast my dict_keys
object to a list. It works in the python 3.6.5 interpreter just fine. However, when I do it in pdb
, it does not work. E.g.
>>> import pdb; pdb.set_trace()
--Return--
<function save_history at 0x100369e18>
> <stdin>(1)<module>()->None
(Pdb) newdict = dict()
(Pdb) newdict["pig"] = "pink"
(Pdb) newdict["finch"] = "yellow"
(Pdb) newdict.keys()
dict_keys(['pig', 'finch'])
(Pdb) list(newdict.keys())
*** Error in argument: '(newdict.keys())'
How do I get this to work in pdb
?