checking if a key is in a dict is done with 'key in dict' not 'hasattr(dict, key)'

This commit is contained in:
Thomas Refis 2013-04-13 14:26:21 +02:00
parent 71e1b71a03
commit dad08df71b

View File

@ -75,8 +75,9 @@ class OmniCompleter( Completer ):
"')" ] "')" ]
items = vim.eval( ''.join( omnifunc_call ) ) items = vim.eval( ''.join( omnifunc_call ) )
if hasattr( items, 'words' ):
items = items.words if 'words' in items:
items = items['words']
if not hasattr( items, '__iter__' ): if not hasattr( items, '__iter__' ):
raise TypeError( OMNIFUNC_NOT_LIST ) raise TypeError( OMNIFUNC_NOT_LIST )