Skip to content

Remove Empty Nested Block

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: remove-empty-nested-block

Section titled “Sourcery refactoring id: remove-empty-nested-block”

Remove nested block which has no effect

for i in range(3):
pass

An if or for which is empty and has no effect should not be present in the code. It clutters things up and makes it harder to see what the code is really doing.