Skip to content

Instantly share code, notes, and snippets.

@GeroZayas
Created March 23, 2026 08:33
Show Gist options
  • Select an option

  • Save GeroZayas/5dd62ab52beeb3a4d033c7ce9ef897ad to your computer and use it in GitHub Desktop.

Select an option

Save GeroZayas/5dd62ab52beeb3a4d033c7ce9ef897ad to your computer and use it in GitHub Desktop.
Use traceback to see who call a line
import traceback
def objetivo():
stack = traceback.extract_stack()
caller = stack[-2] # quien llamó a esta función
print(f"{caller.filename}:{caller.lineno} -> {caller.name}")
def a():
objetivo()
a()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment