I have a class with two integer attributes, _xp
and level
. I have a while
loop which compares these two to make sure they're both positive:
while self.level > 0 and self._xp < 0:
self.level -= 1
self._xp += self.get_xp_quota()
My PyCharm claims this can be simplified:
Can it really? I want to make sure before reporting a bug to PyCharm.
I also found a similar question but in that case the two variables were the same, mine has two different attributes.