[Cython] CF and finally clause

Vitja Makarov vitja.makarov at gmail.com
Tue May 24 21:33:02 CEST 2011


Hi!

When I create control flow graph I have to visit finally clause twice.
This is required because of different outputs should be generated for
success and exception case:

try:
    a = might_raise()
finally:
    pass # 'a' might be uninitialized here
print(a)  # and definitely defined here

So after tracking both cases I have to merge states back because same
code is generated for each.

Maybe it's a good idea to split success/exception case by copying it
at PostParse transform?

-- 
vitja.


More information about the cython-devel mailing list