We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A simple function that splits a list into chunks
def chunks(lst, amount): for index in range(0, len(lst), amount): yield lst[index:index + amount]
will raise ImplicitEnumerateViolation.
ImplicitEnumerateViolation
Documentation suggests using enumerate(lst) instead of range(0, len(list)) but there is no step
enumerate(lst)
range(0, len(list))
step
ImplicitEnumerateViolation should not raise if step > 0 in range arguments.
step > 0
The text was updated successfully, but these errors were encountered:
@AlwxSin fix is welcome!
Sorry, something went wrong.
@sobolevn yeah. I'll try to fix it in a week or two if no one else wouldn't take it.
do not raise ImplicitEnumerateViolation if range called with step
d3516ee
closes wemake-services#1742
fff4dc0
do not raise ImplicitEnumerateViolation if range called with step (#1792
579a7fa
) closes #1742
AlwxSin
Successfully merging a pull request may close this issue.
Bug report
What's wrong
A simple function that splits a list into chunks
will raise
ImplicitEnumerateViolation
.Documentation suggests using
enumerate(lst)
instead ofrange(0, len(list))
but there is nostep
How it should be
ImplicitEnumerateViolation
should not raise ifstep > 0
in range arguments.The text was updated successfully, but these errors were encountered: