Skip to content

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.

Replaces cases of a variable being multiplied by itself with squaring that variable

def square(variable: int):
return variable * variable
def square(variable: int):
return variable**2

This identity can make the code slightly shorter and easier to read.