Working with atom's autocomplete-python which uses jedi I've found that there are incorrect suggestions for multiprocessing
module in python3
. Here is an example:
>>> import jedi
>>> source = '''
... import multiprocessing as mp
... mp.Pro'''
>>> script = jedi.Script(source, 3, len('mp.Pro'), 'example.py')
>>> script.completions()
[<Completion: process>]
Module actually has process
package but also it has Process
class inside of module scope:
>>> import multiprocessing as mp
>>> [n for n in mp.__all__ if n.endswith('rocess')]
['Process', 'current_process']
Comparing python2's and python3's multiprocessing
module I've found that they are slightly different. Modern version imports namespace of the default context's namespace:
globals().update((name, getattr(context._default_context, name))
for name in context._default_context.__all__)
__all__ = context._default_context.__all__
Unfortunately, I don't have any ideas how to resolve this problem or workaround it. Do you have any suggestions?