[Python-bugs-list] Exec statement inconsistency (PR#175)

Tim Peters tim_one@email.msn.com
Thu, 13 Jan 2000 01:24:05 -0500


[
    exec "x=x+1"
 vs
    exec compile("x=x+1", "", "exec")
]

> *That* one's a bug -- the exec statement is supposed to
> sync back the locals fron the dict to their fast form,
> but the code to do that is only present when the argument
> is a string.  I'm fixing this as we speak.

Guido, please take another look at Vadim's original report too.  I believe I
was too hasty in dismissing it.  exec'ing f.func_code (as he did) really
isn't the same as calling or exec'ing f() (as I did), so if the above is a
bug (no argument from me), I expect Vadim's original case should also be
considered broken.  Or, if it's not, why it's not is excruciatingly subtle.