Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include __future__ information on Code, allowing division future to be implemented #123

Open
alanjds opened this issue Nov 23, 2018 · 0 comments

Comments

@alanjds
Copy link

alanjds commented Nov 23, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant