Simplify String Length Comparison
Sourcery refactoring id:
Changes an indirect comparison of a string's length to
0 into a direct
comparison of the string to the empty string.
if len(s) == 0: ... if len(r) > 0: ...
if s == "": ... if r != "": ...
This refactoring avoids an unnecessary calculation and keeps the logic in the domain of string types. It tends to unlock further improvements to string comparisons.