org.sonar.l10n.py.rules.python.BackticksUsage.html Maven / Gradle / Ivy
This rule raises an issue when backticks are used instead of repr
.
Why is this an issue?
In Python 2, backticks are a deprecated alias for repr()
. The syntax was removed in Python 3. To make the transition to Python 3
easier, they should not be used anymore.
Noncompliant code example
return `num` # Noncompliant
Compliant solution
return repr(num)
© 2015 - 2024 Weber Informatics LLC | Privacy Policy