text_combined: jeremy hylton bzuitoalummitedu im sure understand problem exactly one pass converting concrete syntax ast mark functions generators part pass later pass remove unreachable code jeremy sat may 3 2008 1251 thomas lee wrote next problem cropped implementation ast code optimizer related branch elimination elimination code return within functiondef node would ideally like blow away nodes constant false test expression eg def foo false stuff functions cause problems code behave expected however eliminated branch contains yield expression function actually generator function even yield expression never reached def foo false yield 5 addition following also treated generator even though wed like able get rid code following return statement def foo return yield 5 blowing away yield results normal function instead generator want need preserve generator semantics upon revisiting actually made reconsider use const node earlier problem relating arbitrary constants may better annotations could mark functiondef nodes generators ast level force compiler produce code generator eliminate branches anyway alternative think injecting yield node somewhere unreachable ensuring doesnt get optimized away seems pretty hacky comparison ideas cheers tom _______________________________________________ pythondev mailing list zvlllneumpythonorg httpmailpythonorgmailmanlistinfopythondev unsubscribe httpmailpythonorgmailmanoptionspythondevjeremy40alummitedu _______________________________________________ pythondev mailing list zvlllneumpythonorg httpmailpythonorgmailmanlistinfopythondev unsubscribe httpmailpythonorgmailmanoptionspythondevpythondev40tangomucom fri 08 aug 2008 091605 0400 pythondev ast optimization branch elimination generator functions