All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.sonar.l10n.py.rules.python.BackticksUsage.html Maven / Gradle / Ivy

There is a newer version: 4.23.0.17664
Show newest version

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