• Tim Peters's avatar
    Ugly. A pile of new xxxFlags() functions, to communicate to the parser · fe2127d3
    Tim Peters yazdı
    that 'yield' is a keyword.  This doesn't help test_generators at all!  I
    don't know why not.  These things do work now (and didn't before this
    patch):
    
    1. "from __future__ import generators" now works in a native shell.
    
    2. Similarly "python -i xxx.py" now has generators enabled in the
       shell if xxx.py had them enabled.
    
    3. This program (which was my doctest proxy) works fine:
    
    from __future__ import generators
    
    source = """\
    def f():
        yield 1
    """
    
    exec compile(source, "", "single") in globals()
    print type(f())
    fe2127d3
doctest.py 36.3 KB