1
0
forked from VimPlug/jedi

Start implementing overload function

This commit is contained in:
Dave Halter
2018-08-26 03:37:26 +02:00
parent 4daa73d487
commit ac7ce7c481
8 changed files with 27 additions and 15 deletions

View File

@@ -48,7 +48,7 @@ class StdlibPlugin(BasePlugin):
def execute(self, callback):
def wrapper(context, arguments):
if isinstance(context, BoundMethod):
return callback(context, arguments)
return callback(context, arguments=arguments)
debug.dbg('execute: %s %s', context, arguments)
try:
@@ -69,8 +69,8 @@ class StdlibPlugin(BasePlugin):
except KeyError:
pass
else:
return func(self._evaluator, context, arguments)
return callback(context, arguments)
return func(self._evaluator, context, arguments=arguments)
return callback(context, arguments=arguments)
return wrapper

View File

@@ -311,7 +311,8 @@ class StubModuleContext(_StubContextFilterMixin, ModuleContext):
class StubClassContext(_StubContextFilterMixin, ClassContext):
def __getattribute__(self, name):
if name == ('py__getitem__', 'py__simple_getitem__', 'py__bases__'):
if name in ('py__getitem__', 'py__simple_getitem__', 'py__bases__',
'execute_annotation'):
# getitem is always done in the stub class.
return getattr(self.stub_context, name)
return super(StubClassContext, self).__getattribute__(name)