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

Question on wordcount.py --> word_count method #6

Open
fonsecapaulo opened this issue Jun 13, 2018 · 3 comments
Open

Question on wordcount.py --> word_count method #6

fonsecapaulo opened this issue Jun 13, 2018 · 3 comments

Comments

@fonsecapaulo
Copy link
Contributor

Hi,

Small question of a Python newbie.

File: wordcount.py
Method:

def word_count(self):
        """Returns a file's word count"""

        wc_file = self.open_file(self.filename)
        self = len(wc_file.split())
        return ("Words:", len(wc_file.split()))

Line 31: self = len(wc_file.split())

Why are you assigning this int to self? is this a bug?

Thanks
Paulo

@veekaybee
Copy link
Owner

Yup, it's a bug. Thanks for pointing it out. Feel free to open a pull request :)

@fonsecapaulo
Copy link
Contributor Author

Done, my first pull request :)

veekaybee added a commit that referenced this issue Jul 19, 2018
Solution for Issue #6 Congrats!
@fonsecapaulo
Copy link
Contributor Author

Hi Vicki,
Thanks for accepting the pull request, just one more thing, maybe it good to update the blog post http://veekaybee.github.io/2017/09/26/python-packaging/ with this correction, actually this was where i found the bug in the first place.

Thanks
Paulo

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

2 participants