by ottoflux · 4y ago · 0 comments
like: completion_string: str = '0' + str(self.completion) if self.completion < 10 else str(self.completion)
basically it would keep your bar from shifting when percentage goes from single digit to double digit.
Also why do you annotate every variable, even if the type can be deduced automatically? That’s going to be a real PITA if you want to refactor the code e.g to support floats instead of ints any time in the future (in this case it’s probably just a hypothetical problem)