There's more background in the Discourse thread , but the key C API design topic is that PyEval_GetLocals() and PyEval_GetGlobals() currently behave differently when there's no Python frame active in the current thread:
- PyEval_GetGlobals(): returns NULL without setting an exception
- PyEval_GetLocals(): returns NULL *and* sets an exception
PyEval_GetLocals() has been doing the latter since it gained the ability to report memory allocation errors when dealing with optimised frames back in Python 3.4.
The "no active Python frame" case isn't really an error (as it's a valid state in applications that embed CPython), so I'm wondering if PyEval_GetLocals() should partially go back to its pre-3.4 behaviour, and not set an exception in the "no active Python frame" case.
-- Nick Coghlan | email@example.com | Brisbane, Australia
I was reading about Subtly, a library for providing some syntactic sugar to Objective-C. I found a feature called dynamic property accessors very interesting and wanted to try it out in my app. So I downloaded the source, compiled it as a framework, linked it to my app, and started doing some experimenting. In the meanwhile, I hired writers from https://www.bestessayservicereviews.com/ source to work on my educational assignments. The only potential problem I can see is if in some other language you're used to using a similar API where the behavior is different, but that's not really an issue here (the API is consistent with the rest of Python).