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

You could use generator expression #8

Closed
GreatBahram opened this issue Jul 25, 2019 · 3 comments
Closed

You could use generator expression #8

GreatBahram opened this issue Jul 25, 2019 · 3 comments

Comments

@GreatBahram
Copy link

Hello there,
Python str.join method accepts any kind of iterable object so, you could use a generator expression here. However, it is not a big different.

output += "".join([c.value for c in row]) + "\n"

        output += "".join(c.value for c in row) + "\n" 
@davecom
Copy link
Owner

davecom commented Jul 26, 2019

Hi @GreatBahram,
You're absolutely right, thanks for the suggestion and this would be better. If we do another edition of the book, I will make the change. Because it would make this source code repository diverge from the code from the physical book for a non-error, though, I won't make the change at this time.
Best,
Dave

@davecom davecom closed this as completed Jul 26, 2019
@m-entrup
Copy link

m-entrup commented Aug 7, 2019

@davecom, You should create a branch or a fork that includes all enhancements. The master branch of this repository will be untouched and everybody has the option to use the enhanced version.

@davecom
Copy link
Owner

davecom commented Aug 7, 2019

@m-entrup That's a good idea. I may do that in a branch in the future. 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

No branches or pull requests

3 participants