Use complete() for the type? It is high time that we pull some helper methods into vim-scripts/pythonx. Feel free to copy & paste from another place for now if you do not want to do that.