Use breakpoint() to print out filename, line number, and module
Install with pip:
pip install printbreakpoint
Update the PYTHONBREAKPOINT environment variable (available starting in Python 3.7):
Now when you add a breakpoint() to your code, it will show the output from pb.
pb | some_file.py:3 in some_function
Any data you pass to the breakpoint() will be added to the output.
Change the environment variable back to the default when you’re ready to continue using pdb.
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.