Skip to content

aiorepl: SyntaxError: invalid syntax on line 29 #688

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

Closed
inovatorius opened this issue Jun 19, 2023 · 3 comments · Fixed by #689
Closed

aiorepl: SyntaxError: invalid syntax on line 29 #688

inovatorius opened this issue Jun 19, 2023 · 3 comments · Fixed by #689

Comments

@inovatorius
Copy link

Hello!

I used the example found here:
https://github.com/micropython/micropython-lib/tree/master/micropython/aiorepl

Traceback (most recent call last):
File "main.py", line 2, in <module>
File "aiorepl/aiorepl.py", line 29
SyntaxError: invalid syntax
MicroPython v1.20.0-238-g2a4b356ac-dirty on 2023-06-18; ESP module (1M) with ESP8285
@jimmo
Copy link
Member

jimmo commented Jun 20, 2023

ESP module (1M) with ESP8285

The 1M (and smaller) builds for ESP826x don't enable f-strings.

I probably shouldn't have used f-strings in aiorepl and just used str.format which is supported on all boards. Raised #689 to fix (you can apply the same fix to the copy of aiorepl.py on your board).

@inovatorius
Copy link
Author

Thank you @jimmo!

Are there any benefits enabling and using f-strings in comparison to str.format?

@jimmo
Copy link
Member

jimmo commented Jun 22, 2023

Are there any benefits enabling and using f-strings in comparison to str.format?

@inovatorius I much prefer using f-strings over str.format because it's easier to read/write. But it takes extra code size to support this in the MicroPython firmware, so we don't included it on boards that have smaller flash (like the 1MiB ESP8266). The 2MiB+ ESP8266 firmware does include it.

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

Successfully merging a pull request may close this issue.

2 participants