You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In line 62 of the Chess env, the nested quotation mark will incur the module import exception as below:
File "/usr/local/lib/python3.11/dist-packages/textarena/envs/Chess/env.py", line 62
if self.show_valid: message+=f"\nValid moves: {', '.join([f'[{move.uci()}]' for move in self.state.game_state["board"].legal_moves])}"# show the valid moves
^^^^^
SyntaxError: f-string: unmatched '['
Ready to merge. This is a real import-time SyntaxError on Python 3.10/3.11 (the repo's requires-python is >=3.10); same-quote nesting inside an f-string only became legal in 3.12 (PEP 701), so every Chess variant currently fails to import on supported versions. Swapping the inner quotes to 'board' is the minimal correct fix, and the lookalike on the line just above is inside a # comment so it's correctly left untouched. Good catch.
Verified. Without this, textarena/envs/Chess/env.py raises SyntaxError: f-string: unmatched '[' on import under Python 3.11 — the show_valid line nests double-quoted game_state["board"] inside a double-quoted f-string, so Chess-v0 can't be instantiated at all on 3.11. De-nesting to 'board' fixes it: the module imports and Chess-v0 resets/observes/steps cleanly with the valid-moves line rendering.
LGTM, recommend merge.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In line 62 of the Chess env, the nested quotation mark will incur the module import exception as below:
This merge request fix this issue.