Does inspect.getstack work on other Python implementations?

Ed Kellett e+python-list at kellett.im
Sun Jun 17 05:26:05 EDT 2018


On 2018-06-17 10:19, Steven D'Aprano wrote:
> Anyone here use IronPython, Jython or PyPy?
> 
> Does inspect.getstack always work? Is it considered an implementation
> detail for CPython or something promised to work on any compliant
> Python interpreter?
> 
> I see that it doesn't even exist on Jython 2.5, does anyone know 
> whether it exists in later versions?

Well, inspect.currentframe says:

> 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.

and presumably if stack frame support isn't guaranteed to exist for one
inspect function it's similarly un-guaranteed in others.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://mail.python.org/pipermail/python-list/attachments/20180617/5de9e973/attachment.sig>


More information about the Python-list mailing list