> > I don't see the problem. Typically, C extension modules don't have > > Python code that runs in their globals, so messing with a C > > extension's globals from the outside has no bad effect on Python code. > > It happens, though -- for code whose performance is not important, > e.g. initialization and "resetting" kind of stuff, a PyRun_String can be > SO much more concise and handier than meticulous expansion of > basically the same things into tens of lines of C code... since > "messing from the outside" happens after initialization, and the use > cases I can easily find are all specifically DURING initialization, it may > be that this problem is too rare to worry about, but, I'm not so sure. I think this use case won't have a problem. The C code has access to the real dict, so PyRun_String() never knows that it's poking into a module's globals. Also this is done during module initialization. --Guido van Rossum (home page: http://www.python.org/~guido/)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4