GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||
GeezerVison is showing github.com — gh-124960: Fixed `barry_as_FLUFL` future flag does not work in new REPL by Wulian233 · Pull Request #124999 · python/cpython Conversation
|
|
You can close this, I have a proper fix. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
ce801c7 to
904c202
Compare
Co-authored-by: Nice Zombies <[email protected]>
There was an error while loading. Please reload this page.
After my testing, your patch solved this bug. I added a co-author, but I need ask your opinion so that we can open one less PR edit: tests fail. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Co-authored-by: Nice Zombies <[email protected]>
There was an error while loading. Please reload this page.
| with contextlib.redirect_stdout(f): | ||
| result = console.runsource("from __future__ import barry_as_FLUFL\n") | ||
| result = console.runsource("""print("black" <> 'blue')\n""") |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This is required because the parser can't deal with the future import changing the flags inside a run. This is true now:
❯ ./python.exe -c "from __future__ import barry_as_FLUFL; 1<>0" File "<string>", line 1 from __future__ import barry_as_FLUFL; 1<>0 ^^ SyntaxError: invalid syntax
but was also true in the old parser:
❯ python3.9 -Xoldparser -c "from __future__ import barry_as_FLUFL; 1<>0" File "<string>", line 1 from __future__ import barry_as_FLUFL; 1<>0 ^ SyntaxError: invalid syntax
The consequence of that with PyREPL is that you cannot paste multiline blocks with that future and make them run, because PyREPL executes everything save for the last line in one go.
PyREPL isn't doing anything wrong here, it's just exposing the bug that was always there. Therefore, I'm not sure we should be working around this pasting thing for this one future. Other futures work fine, as you can see in the test added above.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks @Wulian233 for the PR, and @ambv for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Sorry, @Wulian233 and @ambv, I could not cleanly backport this to |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
GH-125475 is a backport of this pull request to the 3.13 branch. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…new REPL (python#124999) Co-authored-by: Nice Zombies <[email protected]> Co-authored-by: Łukasz Langa <[email protected]> (cherry picked from commit 6a08a75)
… new REPL (#124999) (#125475) gh-124960: Fixed `barry_as_FLUFL` future flag does not work in new REPL (#124999) Co-authored-by: Wulian <[email protected]> Co-authored-by: Nice Zombies <[email protected]> Co-authored-by: Łukasz Langa <[email protected]> (cherry picked from commit 6a08a75)
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.