Closed luke396 closed 1 year ago
row = ['_'] * 3 weird_board = [] for _ in range(3): weird_board.append(row) weird_board[1][2] = 'X' weird_board # [['_', '_', 'X'], ['_', '_', 'X'], ['_', '_', 'X']]
board = [] for _ in range(3): row = ['_'] * 3 board.append(row) board[1][2] = 'X' board # [['_', '_', '_'], ['_', '_', 'X'], ['_', '_', '_']]
For these two snippets, Sourcery gives the same quick fix, but the it changes the result.
row = ['_'] * 3 weird_board = [row for _ in range(3)] weird_board[1][2] = 'X' weird_board # [['_', '_', 'X'], ['_', '_', 'X'], ['_', '_', 'X']]
row = ['_'] * 3 board = [row for _ in range(3)] board[1][2] = 'X' board # [['_', '_', 'X'], ['_', '_', 'X'], ['_', '_', 'X']]
IDE Version: VSCode 1.74.2
Sourcery Version: Sourcery extension v1.0.2
Operating system and Version: Windows 11 WSL 2
Now fixed - will be in the next release.
Released with 1.0.4
Checklist
Description
Code snippet that reproduces issue
For these two snippets, Sourcery gives the same quick fix, but the it changes the result.
Debug Information
IDE Version: VSCode 1.74.2
Sourcery Version: Sourcery extension v1.0.2
Operating system and Version: Windows 11 WSL 2