Closed
Description
Bug report
Bug description:
% ./python.exe -c 'from __future__ import barry_as_FLUFL; print(1 <> 2)'
File "<string>", line 1
from __future__ import barry_as_FLUFL; print(1 <> 2)
^^
SyntaxError: invalid syntax
But with Barry as the FLUFL, <>
is the correct way to test for inequality.
The future works only if you pass the right flag to compile()
(as test_flufl.py does), but there's no way to do that in a file.
Obviously this future is a joke so this doesn't matter greatly, but I think it indicates that future imports that affect the parser aren't handled properly. That's something we should fix in case we get other futures in the ... future that also affect the parser. The joke future is also useful as a way to demonstrate how future statements work in general without having to rely on a specific future that will go away in a few releases.
CPython versions tested on:
3.12, CPython main branch
Operating systems tested on:
No response