textedit
textedit copied to clipboard
Question on wordcount.py --> word_count method
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
Yup, it's a bug. Thanks for pointing it out. Feel free to open a pull request :)
Done, my first pull request :)
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