Skip to content

Remove unnecessary list() calls before/after sorted() #9078

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

chrisyeh96
Copy link

@chrisyeh96 chrisyeh96 commented May 21, 2025

Python's built-in sorted() function always returns a list. Therefore, there is no need to call list(sorted(...)) or sorted(list(...)). Simply calling sorted(...) is sufficient.

Copy link

pytorch-bot bot commented May 21, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/vision/9078

Note: Links to docs will display an error until the docs builds have been completed.

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@chrisyeh96 chrisyeh96 changed the title Remove unnecessary list() calls after sorted() Remove unnecessary list() calls before/after sorted() May 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants