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

Skip to content

For-else configuration not supported  #1442

Open
@faze-geek

Description

@faze-geek

Came across this while testing basic loops in lpython.

from ltypes import i32

def f():
    i: i32
    for i in range(0,5,1):
        print(i)
    else:
        print(100)

f()

(lp) C:\Users\kunni\lpython>python try.py
0
1
2
3
4
100  # Should be printed because there is no break statement in loop

(lp) C:\Users\kunni\lpython>src\bin\lpython try.py
   Creating library try.lib and object try.exp
0
1
2
3
4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions