Open Anselmoo opened 1 year ago
Thanks for posting this - we'll add it to our backlog.
Oh hang on @Anselmoo - I do get suggested a conversion to /=
as long as Sourcery can identify the type of the variable.
Have you got a code snippet where we suggest +=
but not /=
?
@Hellebore thx for giving me feedback. I had the issue once in a project, but unfortunately, don't find it yet.
However, I create the following four examples:
I hope it helps and that I don't miss anything.
https://gist.github.com/Anselmoo/f4763afb588cf0fda96255cba099c876
def cross_check() -> None:
"""Cross check with /= operator"""
i: float = 1.0
j: float = 1.0
for _ in range(10):
i = i / 2
j /= 2
print(i == j)
Checklist
Description
Sourcery
suggests-=
and+=
, however not/=
.Code Before
Code After