tl;dr: Code objects should receive the __future__ imports information applied to it.
Today the __future__ imports information is available only to the importer/compiler. No import occur really occur nor code is generated for it. This by itself already violates some of the __future__ documented semantics, but more important, the information is not forwarded to the Code object.
Having no clue of what __future__ flags are imported/activated and what are not, a Code cannot change its behaviors. This makes harder the possiblity of func intDiv() to change its operation in presence __future__.division (#37).
I explored the possibility of this flag to just change the transpiled code. It could fix code like print 1 / 2, but would not work for non-literal integers like a = 1; b = 2; print a / b or more complex ones.
tl;dr: Code objects should receive the
__future__imports information applied to it.Today the
__future__imports information is available only to the importer/compiler. No import occur really occur nor code is generated for it. This by itself already violates some of the__future__documented semantics, but more important, the information is not forwarded to the Code object.Having no clue of what
__future__flags are imported/activated and what are not, a Code cannot change its behaviors. This makes harder the possiblity offunc intDiv()to change its operation in presence__future__.division(#37).I explored the possibility of this flag to just change the transpiled code. It could fix code like
print 1 / 2, but would not work for non-literal integers likea = 1; b = 2; print a / bor more complex ones.