fork download
  1. import inspect
  2.  
  3.  
  4. def f(a, b):
  5. frame = inspect.currentframe()
  6. print(frame.f_locals, type(frame.f_locals))
  7. return a + b
  8.  
  9.  
  10. print(f(1, 2))
Success #stdin #stdout 0.02s 30672KB
stdin
Standard input is empty
stdout
{'frame': <frame object at 0x2b321a635828>, 'b': 2, 'a': 1} <class 'dict'>
3