Typehint (key hint) for python class with __getitem__


I have class in python with map of values, which can be use for calling get item on that class. In Pycharm i want typehint fot list of keys in this map. Is there any possibility to do that? What do i want:

class MyOwnClass:

    map = { 'first' : 1, 'second' : 2}

    def __getitem__(item):

        return self.map[item]



m = MyOwnClass()

m[' ']                 

    ^---------- At this place i want to press CTRL+SPACE and i want to get list of available keys.


Is there any solution for this? Or i must create some plugin for this.


Thank you so much

Please sign in to leave a comment.