Skip to content

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

@jtoghrul

Description

@jtoghrul

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions