py_better_exchook icon indicating copy to clipboard operation
py_better_exchook copied to clipboard

Show variables in f-strings

Open Zettelkasten opened this issue 3 years ago • 1 comments

It would be helpful to also show the values for variables inside of f-strings.

For example, I just got this error here:

  File "...gather.py", line 29, in <module>
    line: out_file.write(f"{in_lines[index]}\n")
    locals:
      out_file = <local> <_io.TextIOWrapper name='...out.gz' encoding='UTF-8'>
      out_file.write = <local> <built-in method write of _io.TextIOWrapper object at 0x7faf53b75050>

And I would love betterexchook to also print in_lines, index, etc.

Zettelkasten avatar Oct 17 '22 13:10 Zettelkasten

Yep, I know, I also would like to have that. :)

PRs are welcome.

The problem is, the Python code parsing currently is very simple, and this might increase the complexity quite a bit. Or maybe it's possible to implement this in a away that does not add much complexity? I haven't really thought about it yet.

albertz avatar Oct 17 '22 13:10 albertz