Skip to content
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

Update Table row not valid in for loop when using 'break' #1098

Open
Time-Coder opened this issue Jan 5, 2024 · 0 comments
Open

Update Table row not valid in for loop when using 'break' #1098

Time-Coder opened this issue Jan 5, 2024 · 0 comments

Comments

@Time-Coder
Copy link

Such that table is a instance of tables.Table
This code works fine:

for row in table:
    row["col"] = value
    row.update()

This code will not have any effect on current table:

for row in table:
    row["col"] = value
    row.update()
    break # because of this line

You can test by:

for row in table:
    row["col"] = value
    row.update()
    print(row["col"])
    break

for row in table:
    print(row["col"])
    break

It will print different result.

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

No branches or pull requests

1 participant