Thanks to visit codestin.com
Credit goes to github.com

Skip to content

'/' as a parameter of a function gives a syntax error #11736

Open
@xiaxinmeng

Description

@xiaxinmeng

If a python program takes / as the parameter of a function, micropython reports a SyntaxError. See the following case. This test case can work normally on CPython.

MicroPython_exampe.py

def run_in_thread(func, /, *args, **kwargs):
    pass

The expected behavior:

CPython 3.9.0: work normally

The actual output:

Traceback (most recent call last):
  File "/home/xxm/Desktop/MicroPython_exampe.py", line 55
SyntaxError: invalid syntax

Test Environment:

Unix port,
MicroPython v1.20.0-162-gd080d427e on 2023-06-08; linux [GCC 7.5.0] version
Ubuntu 18.04
CPython 3.9.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions