-
Notifications
You must be signed in to change notification settings - Fork 372
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
from __future__ import
doesn't work together with Hy core function imports
#1367
Comments
Is there any |
What @woodrush mentioned is not a problem of only
|
Yes, but what I'm saying is that |
I reviewed the various |
Turning on all future imports for Python 2 sounds like a good idea. I'm pretty sure this would only affect Hy modules, so it's not like we're forcing anything on the Python side. It will also help with the inevitable migration to Python 3. Banning The real fix would be to get rid of autoimports altogether. #434 / #791. I've been pondering ways to do this. Some kind of |
Not any documented ones that I can find. If Python 3 or PyPy add other |
Aw shoot, the Python 3 documentation shows that there is in fact a |
This closes hylang#1367, closes hylang#1540
This closes hylang#1367 and closes hylang#1540
This closes hylang#1367 and closes hylang#1540
This closes hylang#1367 and closes hylang#1540
This closes hylang#1367 and closes hylang#1540
This closes hylang#1367 and closes hylang#1540
While this works,
This doesn't work:
The former compiles to the Python code (using hy2py)
While the latter compiles to
yielding the error
So this is because
name
is used in the Hy core, and Hy addsfrom hy.core.language import name
at the beginning of the file, precedingfrom __future__ import print_function
.It also happens with other
__future__
module imports such asfrom __future__ import braces
. It also happens with this context, where it is clear thatname
doesn't refer tohy.core.language.name
:which compiles to
The text was updated successfully, but these errors were encountered: