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

unnecessary array comprehension #45

Closed
tomato42 opened this issue May 9, 2018 · 0 comments
Closed

unnecessary array comprehension #45

tomato42 opened this issue May 9, 2018 · 0 comments

Comments

@tomato42
Copy link

tomato42 commented May 9, 2018

https://github.com/ansasaki/smap/blob/608f590b98a1ad2e12c078974eafeef8f4aa58fa/src/smap/symver.py#L148-L149

the array does not need to be built, join() works with generators too

this could be simplified to

 content = "\n".join(str(i) for i in self.releases) 
ansasaki added a commit that referenced this issue May 18, 2018
Avoid the construction of the message if the purpose is just to be sent
as a warning.

Try to use format instead of join when possible.

Try to use generator instead of array comprehension.

Fixes #44, #45, #49, #50
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

No branches or pull requests

1 participant