Square Identity
Documentation Index
Fetch the complete documentation index at: https://docs.sourcery.ai/llms.txt
Use this file to discover all available pages before exploring further.
Sourcery refactoring id: square-identity
Section titled “Sourcery refactoring id: square-identity”Description:
Section titled “Description:”Replaces cases of a variable being multiplied by itself with squaring that variable
Before:
Section titled “Before:”def square(variable: int): return variable * variableAfter:
Section titled “After:”def square(variable: int): return variable**2Explanation:
Section titled “Explanation:”This identity can make the code slightly shorter and easier to read.