title: Why does SuperTab output self when I press <tab>?
body: <h2>The Setup</h2>
  
  <p>In my <code>.vimrc</code> I have the following lines:</p>
  
  <pre><code>" .vimrc
  let g:virtualenv_directory="/Users/Kit/Development/virtualenv"
  </code></pre>
  
  <p>Then in <code>~/.vim/ftplugin/python/virtualenv.vim</code> I have these:</p>
  
  <pre><code>py &lt;&lt; EOF
  import os.path
  import sys
  import vim
  if 'VIRTUAL_ENV' in os.environ:
      project_base_dir = os.environ['VIRTUAL_ENV']
      sys.path.insert(0, project_base_dir)
      activate_this = os.path.join(project_base_dir, 'bin/activate_this.py')
      execfile(activate_this, dict(__file__=activate_this))
      print "virtualenv in os.environ!"
  EOF
  VirtualEnvActivate my-virtualenv-python-2.7
  </code></pre>
  
  <p>In <code>~/.vim/ftplugin/python/virtualenv.vim</code> I have these SuperTab settings:</p>
  
  <pre><code>setlocal omnifunc=pythoncomplete#Complete
  setlocal completeopt=menuone,longest,preview
  let g:SuperTabDefaultCompletionType="&lt;c-x&gt;&lt;c-]&gt;"
  </code></pre>
  
  <p>In my working directory, where I always work from, I executed the following bash command to generate a <code>TAGS</code> file for all my <code>.py</code> files</p>
  
  <pre><code>find . -name '*.py' -type f -print0 | xargs -0 etags -l python
  </code></pre>
  
  <h2>The problem</h2>
  
  <p>For example, I have a <code>main.py</code> which has an object <code>app</code> inside it, such that the following script works fine:</p>
  
  <pre><code>import main
  new_app = main.app() # works totally fine Python-wise
  </code></pre>
  
  <p>If, for example, I write some new code and try to use SuperTab omnicompletion:</p>
  
  <pre><code>import main
  new_new_app = main.&lt;Tab&gt;
  </code></pre>
  
  <p>This is what I get:</p>
  
  <pre><code>new_new_app = mainself.
  </code></pre>
  
  <p>And if I press <kbd>Tab</kbd> several times:</p>
  
  <pre><code>new_new_app = mainselfselfselfself.
  </code></pre>
  
  <h2>What works for me</h2>
  
  <p>If, however, I do the following:</p>
  
  <pre><code>new_new_app = main.a&lt;Tab&gt;
  </code></pre>
  
  <p>I get a whole list of <code>a..</code> objects that include those that don't belong to module <code>main</code>.</p>
  
  <h2>What I want</h2>
  
  <p>If I set the following in <code>.vimrc</code>:</p>
  
  <pre><code>let g:SuperTabDefaultCompletionType="context"
  </code></pre>
  
  <p>Then, I use a module from the standard Python library:</p>
  
  <pre><code>import sys
  sys.&lt;Tab&gt; # This will still result in sysselfselfself.
  sys.p&lt;Tab&gt; # This will result in the correct list of `sys` members beginning with `p`
  </code></pre>
  
  <p>But the <code>"context"</code> setting won't work on my own modules:</p>
  
  <pre><code>new_new_app = main.a&lt;Tab&gt;
  # Will say at the bottom: Omni completion (^O^N^P) Pattern not found
  </code></pre>
  
  <h1>The Question</h1>
  
  <p>How should I set up omnicompletion and SuperTab so that it behaves for my own modules as for the standard library modules? As well as eliminate the <code>selfselfself.</code> annoyance?</p>