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
- Fixed incorrect suggestion for shallow copy in unnecessary-comprehension
81
+
82
+
Example of the suggestion:
83
+
#pylint: disable=missing-module-docstring
84
+
a = [1, 2, 3]
85
+
b = [x for x in a]
86
+
b[0] = 0
87
+
print(a) # [1, 2, 3]
88
+
89
+
After changing b = [x for x in a] to b = a based on the suggestion, the script now prints [0, 2, 3]. The correct suggestion should be use list(a) to preserve the original behavior.
0 commit comments