[Python-ideas] Yield-from: Mysterious doctest failures

Greg Ewing greg.ewing at canterbury.ac.nz
Sat Feb 21 04:59:29 CET 2009


I'm getting this from tests/test_generators.py. As far as
I can see, the SyntaxError messages are identical. Does
anyone know what doctest is complaining about here?

**********************************************************************
File 
"/Local/Projects/D/Python-YieldFrom/Python-2.6.1/Lib/test/test_generators.py", 
line ?, in test.test_generators.__test__.coroutine
Failed example:
     def f(): x = yield = y
Expected:
     Traceback (most recent call last):
       ...
     SyntaxError: assignment to yield expression not possible (<doctest 
test.test_generators.__test__.coroutine[23]>, line 1)
Got:
     Traceback (most recent call last):
       File "/Local/Projects/D/Python-YieldFrom/Python-2.6.1/Lib/doctest.py", 
line 1231, in __run
         compileflags, 1) in test.globs
       File "<doctest test.test_generators.__test__.coroutine[22]>", line 1
      SyntaxError: assignment to yield expression not possible (<doctest 
test.test_generators.__test__.coroutine[22]>, line 1)
ast: yield_expr: an = 0x10d9ed8
**********************************************************************

-- 
Greg



More information about the Python-ideas mailing list