According to the docs:
inspect.currentframe()
Return the frame object for the caller’s stack frame.
CPython implementation detail: This function relies on Python stack frame support in the interpreter, which isn’t guaranteed to exist in all implementations of Python. If running in an implementation without Python stack frame support this function returns None.
How is it that only this function is marked as "implementation-dependent"? If this function doesn't work, wouldn't similar functions, such as inspect.trace
, inspect.stack
, etc. also be unavailable?
Also, what does "stack frame support" mean, and why would it ever be absent?
inspect.currentframe
isn't supported, butinspect.trace
andinspect.stack
work fine? (That's what the docs imply.) – Decarlo