This information is certainly retrievable - but not by standard consoles.
$ python -m friendly_traceback
Friendly Console version 0.0.28a. [Python version: 3.7.3]
>>> d = {"a": 1, "b": 2}
>>> for key, value in d:
... print(key, value)
...
Python exception:
ValueError: not enough values to unpack (expected 2, got 1)
A ValueError indicates that a function or an operation
received an argument of the right type, but an inappropriate value.
Execution stopped on line 1 of file '<friendly-console:2>'.
-->1: for key, value in d:
d: {'a': 1, 'b': 2}