Update array2d.pyi

This commit is contained in:
blueloveTH 2024-02-15 02:13:30 +08:00
parent e5097f734f
commit d1df2c5497

View File

@ -45,7 +45,7 @@ class array2d(Generic[T]):
raise IndexError(f'({col}, {row}) is not a valid index for {self!r}') raise IndexError(f'({col}, {row}) is not a valid index for {self!r}')
self.data[row * self.n_cols + col] = value self.data[row * self.n_cols + col] = value
def __iter__(self) -> list[list['T']]: def __iter__(self):
for row in range(self.n_rows): for row in range(self.n_rows):
yield [self[col, row] for col in range(self.n_cols)] yield [self[col, row] for col in range(self.n_cols)]