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

Indexable class : 'dict_keys' object is not subscriptable #4

Open
jtoghrul opened this issue Mar 1, 2018 · 1 comment
Open

Indexable class : 'dict_keys' object is not subscriptable #4

jtoghrul opened this issue Mar 1, 2018 · 1 comment

Comments

@jtoghrul
Copy link

jtoghrul commented Mar 1, 2018

When I try to run the project on Python 3, I got : 'dict_keys' object is not subscriptable.

Actually, after some research I have found out that in the following methods list should be added to dictionary keys call.

def __repr__(self):
        return ' '.join(list(self.words_count.keys())[:10])

and

def words_generator(self, stop_words):
        for word in list(self.words_count.keys()):
            if word not in stop_words or len(word) > 5:
                yield word
@trein
Copy link
Owner

trein commented Mar 1, 2018

Thanks for the callout, @jtoghrul! The implementation targeted Python > 2.7. It is great to see that it might also work with Python > 3 after a few minor changes.

Would you be interested in adjusting the implementation so that it becomes compatible with both Python 2 and 3? If you submit a pull request I can review and merge it right away.

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