Remove-Zero-From-Range
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 rule id: remove-zero-from-range
Section titled “Sourcery rule id: remove-zero-from-range”Description
Section titled “Description”Replace range(0, x) with range(x)
Before
Section titled “Before”for i in range(0, len(x)): do_t()for i in range(len(x)): do_t()Explanation
Section titled “Explanation”The default starting value for a call to range() is 0, so it is unnecessary to
explicitly define it. This refactoring removes such zeros, slightly shortening
the code.