Mercurial > cpython-lru_cache-weakref
diff Include/pythonrun.h @ 19157:b7658e665d2e legacy-trunk
Refactor future feature handling
Replace individual slots in PyFutureFeatures with a single bitmask
with one field per feature. The flags for this bitmask are the same
as the flags used in the co_flags slot of a code object.
XXX This means we waste several bits, because they are used
for co_flags but have no meaning for future statements. Don't
think this is an issue.
Remove the NESTED_SCOPES_DEFAULT define and others. Not sure what
they were for anyway.
Remove all the PyCF_xxx flags, but define PyCF_MASK in terms of the
CO_xxx flags that are relevant for this release.
Change definition of PyCompilerFlags so that cf_flags matches
co_flags.
| author | Jeremy Hylton <jeremy@alum.mit.edu> |
|---|---|
| date | Fri, 10 Aug 2001 21:38:04 +0000 |
| parents | f20727cc3d0f |
| children | 5b6a6d7d44ae |
line wrap: on
line diff
--- a/Include/pythonrun.h Fri Aug 10 21:31:12 2001 +0000 +++ b/Include/pythonrun.h Fri Aug 10 21:38:04 2001 +0000 @@ -7,14 +7,9 @@ extern "C" { #endif -/* These flags are named after the __future__ statements that introduced - them. May not remain true for later additions, so fiddle this comment - accordingly then. */ -#define PyCF_NESTED_SCOPES (0x00000001UL) -#define PyCF_GENERATORS (0x00000002UL) -#define PyCF_DIVISION (0x00000004UL) +#define PyCF_MASK (CO_GENERATOR_ALLOWED | CO_FUTURE_DIVISION) typedef struct { - unsigned long cf_flags; /* bitmask of PyCF_xxx flags */ + int cf_flags; /* bitmask of CO_xxx flags relevant to future */ } PyCompilerFlags; DL_IMPORT(void) Py_SetProgramName(char *);
