Skip to content
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

refactor: use constuctor call or comprehensions instead of loops #13159

Merged
merged 3 commits into from
Jul 17, 2022

Conversation

anilbey
Copy link
Contributor

@anilbey anilbey commented Jul 16, 2022

Description

Small refactors to simplify the codebase.

  • use constructor call to avoid loops
  • use comprehension in simple cases

@github-actions

This comment has been minimized.

mypy/stubgenc.py Outdated
output = []
for line in sorted(set(imports)):
output.append(line)
output = list(sorted(set(imports)))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorted() already returns a list

Suggested change
output = list(sorted(set(imports)))
output = sorted(set(imports))

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
@github-actions
Copy link
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@hauntsaninja hauntsaninja merged commit 8428af7 into python:master Jul 17, 2022
@hauntsaninja
Copy link
Collaborator

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants