8000 Removed unnecessary call to reversed in for loop by RScrusoe · Pull Request #125690 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

Removed unnecessary call to reversed in for loop #125690

New issue

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

Closed
wants to merge 3 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update Lib/random.py to follow the lint conventions
Co-authored-by: Pieter Eendebak <pieter.eendebak@gmail.com>
  • Loading branch information
RScrusoe and eendebakpt authored Oct 18, 2024
commit de175f798c5961a44b2627162bac3e3cd9c0a20b
2 changes: 1 addition & 1 deletion Lib/random.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ def shuffle(self, x):

randbelow = self._randbelow
# Iterate over the list x in reverse order
for i in range(len(x)-1,0,-1):
for i in range(len(x) - 1, 0, -1):
# pick an element in x[:i+1] with which to exchange x[i]
j = randbelow(i + 1)
x[i], x[j] = x[j], x[i]
Expand Down
Loading
0