
Let’s say I type
a = [1, 2]
in a .py file in vim and when I type “a.” and hit TAB, I would like to get suggestion menu that is related to lists.
Edit 1 in response to Robin’s comment:
I think it’s possible in vim, because there is a plugin that checks if a given python code is a valid code (I don’t know what the plugin is called). Take a look:

Recent versions of vim come with an omnicompletion script called pythoncomplete.
Open up a python file, and type
to check what the current completion function is. If you get back
then no completionfunction is currently set. You can set pythoncomplete to be the completion function by typing
and you can set this to be the default for python files using (in your vimrc)
Now when you’re in vim, you can use omnicomplete using Ctrl+X Ctrl+O and you should get a popup menu as shown below:
You can also bind this to the tab key in insert mode with (in your vimrc):
To find out more about interacting with the dropdown menu that appears, try