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
fn main():
for i in range(4):
for j in range(4):
print(i,j)
else:
continue
This pattern is typical if you try to exit nested loop in python:
fn main():
for i in range(4):
for j in range(4):
print(i,j)
if (i == 2) and (j==2):
break
else:
continue
break
Steps to reproduce
Include relevant code snippet or link to code that did not work as expected.
If applicable, add screenshots to help explain the problem.
If using the Playground, name the pre-existing notebook that failed and the steps that led to failure.
Include anything else that might help us debug the issue.
System information
- What OS did you do install Mojo on ? Ubuntu 23
- Provide version information for Mojo by pasting the output of `mojo -v` mojo 0.3.0 (f64f9601)
- Provide Modular CLI version by pasting the output of `modular -v` modular 0.1.4 (6b54d308)
The text was updated successfully, but these errors were encountered:
@lispsil Thanks for filing! From a glance, it seems like the behaviour of for ... else is not implemented correctly, causing the else block to always get executed.
Bug description
Minimum example:
This pattern is typical if you try to exit nested loop in python:
Steps to reproduce
System information
The text was updated successfully, but these errors were encountered: