Rule EC66 does not apply to the Python language #198
Labels
🏗️ refactoring
refactoring for best practices
🗃️ rule
rule improvment or rule development or bug
python
💉 bug
Something isn't working
Rule EC66 does not apply to the Python language.
Explanation
Variable substitution is not possible in pure string literals as opposed to formatted string literals (aka.
f-strings
), unlike in PHP.Therefore, we can use single and double quotes string literals interchangeably without worrying for any useless CPU cycles.
Disassembling the two examples given in the HTML description of rule EC66 give exactly the same bytecode.
Compliant bytecode
Non compliant bytecode
It also seems that Python parser treats single and double quotes string literals the same way, see here (they only check if the last quote char matches the first one).
The text was updated successfully, but these errors were encountered: