Skip to content

Parser: Lpython does not differentiate between keyword and positional arguments in print #1513

Open
@faze-geek

Description

@faze-geek

Came across this in #1512 .

def main():
    print(sep = "++","c", 3, "d", 4, [4, 5, 6])

main()

(lp) C:\Users\kunni\lpython>python try.py
  File "C:\Users\kunni\lpython\try.py", line 2
    print(sep = "++","c", 3, "d", 4, [4, 5, 6])
                                              ^
SyntaxError: positional argument follows keyword argument

(lp) C:\Users\kunni\lpython>src\bin\lpython try.py
c++3++d++4++[4, 5, 6]     # Expected result if sep keyword is mentioned at the end

Metadata

Metadata

Assignees

No one assigned

    Labels

    ParserIssues or improvements related to parser

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions