> > My bigger worry about this interface is that the flags accepted should > > be carefully checked to be from the small set related to future > > statements. It would be harmful if the user could set flags like > > CO_OPTIMIZED, CO_GENERATOR, or CO_VARARGS this way! > > Wrong set of flags! > > There are two complementary sets of flags here: > > (1) The PyCF_* ones, defined in Include/pythonrun.h > (2) The CO_* ones defined in Include/compile.h > > The proposed fourth argument to compile() should be a combination of > the former set. > > I only use the latter to tell whether a __future__ statement was used > in the text compiled (which is a bit horrible, but no better way > springs to mind). > > There might be value in checking the flags passed to compile() anyway, > but I can't see it being dangerous. Ah, good. Makes sense. (I think I may have been confused by your original patch, which AFAICR *did* manipulate the co_flags field of the code object, which contains the CO_* flags. --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