Repository: spyder-ide/spyder

Issue:
'NoneType' is not iterable in introspection/fallback_plugin.py
## Description
- _What steps will reproduce the problem?_
  1.
  2.
  3.
- _What is the expected output? What do you see instead?_

```
Traceback (most recent call last):
  File "/usr/local/anaconda/lib/python2.7/site-packages/spyderlib/utils/introspection/plugin_manager.py", line 342, in _introspection_complete
Traceback (most recent call last):
threads  File "/usr/local/anaconda/lib/python2.7/site-packages/spyderlib/utils/introspection/plugin_manager.py", line 342, in _introspection_complete
    result = self.plugins['fallback'].get_definition(info)
  File "/usr/local/anaconda/lib/python2.7/site-packages/spyderlib/utils/introspection/fallback_plugin.py", line 72, in get_definition
    if '.' in token:
TypeError: argument of type 'NoneType' is not iterable
    result = self.plugins['fallback'].get_definition(info)
  File "/usr/local/anaconda/lib/python2.7/site-packages/spyderlib/utils/introspection/fallback_plugin.py", line 72, in get_definition
    if '.' in token:
TypeError: argument of type 'NoneType' is not iterable
```
- _Please provide any additional information below_
  I was casually editing a python script, the error happened right after a copy-paste.
  I just noticed that spyder is not up to date, maybe it has already been corrected.
## Version and main components
- Spyder Version:  2.3.3
- Python Version:  2.7.9
- Qt Version    :  4.8.5, PyQt4 (API v2) 4.10.4 on Linux
## Optional dependencies

pyflakes >=0.5.0:  0.8.1 (OK)
pep8 >=0.6      :  1.5.7 (OK)
IPython >=1.0   :  3.0.0 (OK)
zmq >=2.1.11    :  14.5.0 (OK)
pygments >=1.6  :  2.0.2 (OK)
pandas >=0.13.1 :  0.14.1 (OK)
sphinx >=0.6.6  :  1.2.3 (OK)
psutil >=0.3    :  2.1.1 (OK)
jedi >=0.8.1    :  0.8.1-final0 (OK)
rope >=0.9.2    :  0.9.4 (OK)
matplotlib >=1.0:  1.4.3 (OK)
sympy >=0.7.0   :  0.7.5 (OK)
pylint >=0.25   :  1.2.1 (OK)



Discussion:
Also having this issue... completion in Master seems to be kinda of broken... it takes too long (when it works) @blink1073 

Yikes!  I'm on it. 


Resolving patch:
diff --git a/spyderlib/utils/introspection/plugin_manager.py b/spyderlib/utils/introspection/plugin_manager.py
--- a/spyderlib/utils/introspection/plugin_manager.py
+++ b/spyderlib/utils/introspection/plugin_manager.py
@@ -158,7 +158,7 @@ def __init__(self, name, source_code, position, filename=None,
                     break
                 position -= 1
         else:
-            self.docstring = None
+            self.docstring = ''
 
         self.position = position
 
@@ -167,8 +167,8 @@ def __init__(self, name, source_code, position, filename=None,
             self.column = 0
             self.line_num = 0
             self.line = ''
-            self.obj = None
-            self.full_obj = None
+            self.obj = ''
+            self.full_obj = ''
         else:
             self._get_info()
 
@@ -229,6 +229,7 @@ def _get_docstring(self):
             right += 1
         if left and right < len(self.source_code):
             return self.source_code[left: right]
+        return ''
 
     def __eq__(self, other):
         try:


Test patch: