[Python-checkins] r42501 - python/trunk/Include/code.h
Neal Norwitz
nnorwitz at gmail.com
Sun Feb 19 21:40:06 CET 2006
On 2/19/06, Tim Peters <tim.peters at gmail.com> wrote:
>
> > -/* XXX Temporary hack. Until generators are a permanent part of the
> > - language, we need a way for a code object to record that generators
> > - were *possible* when it was compiled. This is so code dynamically
> > - compiled *by* a code object knows whether to allow yield stmts. In
> > - effect, this passes on the "from __future__ import generators" state
> > - in effect when the code block was compiled. */
> > +
> > #define CO_GENERATOR_ALLOWED 0x1000 /* no longer used in an essential way */
> > #define CO_FUTURE_DIVISION 0x2000
>
> Umm, looks like you removed the comment but left the hack. If you're
> not going to remove CO_GENERATOR_ALLOWED too, it would be better to
> leave the comment, so that CO_GENERATOR_ALLOWED isn't a total mystery.
Hmm, this is only used in Include/pythonrun.h and Python/bltinmodule.c
in PyCF_MASK_OBSOLETE. Would it be ok to remove CO_GENERATOR_ALLOWED
from the mask and disallow the flag? I'm a little hesitant, though
the flag hasn't been necessary since 2.2. It was only necessary in
2.1 IIRC.
Should I just restore the comment and not worry about this until 3.0?
The comment was a bit misleading until I re-read it, so if I restore
it I will update it (and add when it should be removed).
n
More information about the Python-checkins
mailing list