1
0
forked from VimPlug/jedi

ExecutedParams should never be additionally faked, even if they are the first params. They have been legitimately created by a caller.

This commit is contained in:
Dave Halter
2014-06-30 15:22:53 +02:00
parent 0d3ea4dfb4
commit 0b99473886
4 changed files with 18 additions and 3 deletions

View File

@@ -296,7 +296,9 @@ class NameFinder(object):
cls = func.parent.get_parent_until((pr.Class, pr.Function))
if isinstance(cls, pr.Class) and param.position_nr == 0:
from jedi.evaluate.param import ExecutedParam
if isinstance(cls, pr.Class) and param.position_nr == 0 \
and not isinstance(param, ExecutedParam):
# This is where we add self - if it has never been
# instantiated.
if isinstance(self.scope, er.InstanceElement):

View File

@@ -356,7 +356,7 @@ def _gen_param_name_copy(func, var_args, param, keys=(), values=(), array_type=N
def _error_argument_count(func, actual_count):
default_arguments = sum(1 for p in func.params if p.assignment_details)
default_arguments = sum(1 for p in func.params if p.assignment_details or p.stars)
if default_arguments == 0:
before = 'exactly '

View File

@@ -39,7 +39,7 @@ class RecursionDetector(object):
def push_stmt(self, stmt):
self.current = _RecursionNode(stmt, self.current)
check = self._check_recursion()
if check: # TODO remove False!!!!
if check:
debug.warning('catched stmt recursion: %s against %s @%s', stmt,
check.stmt, stmt.start_pos)
self.pop_stmt()

View File

@@ -0,0 +1,13 @@
# classmethod
class TarFile():
@classmethod
def open(cls, name, **kwargs):
return cls.taropen(name, **kwargs)
@classmethod
def taropen(cls, name, **kwargs):
return name
# should just work
TarFile.open('hallo')