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:
@@ -296,7 +296,9 @@ class NameFinder(object):
|
|||||||
|
|
||||||
cls = func.parent.get_parent_until((pr.Class, pr.Function))
|
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
|
# This is where we add self - if it has never been
|
||||||
# instantiated.
|
# instantiated.
|
||||||
if isinstance(self.scope, er.InstanceElement):
|
if isinstance(self.scope, er.InstanceElement):
|
||||||
|
|||||||
@@ -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):
|
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:
|
if default_arguments == 0:
|
||||||
before = 'exactly '
|
before = 'exactly '
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ class RecursionDetector(object):
|
|||||||
def push_stmt(self, stmt):
|
def push_stmt(self, stmt):
|
||||||
self.current = _RecursionNode(stmt, self.current)
|
self.current = _RecursionNode(stmt, self.current)
|
||||||
check = self._check_recursion()
|
check = self._check_recursion()
|
||||||
if check: # TODO remove False!!!!
|
if check:
|
||||||
debug.warning('catched stmt recursion: %s against %s @%s', stmt,
|
debug.warning('catched stmt recursion: %s against %s @%s', stmt,
|
||||||
check.stmt, stmt.start_pos)
|
check.stmt, stmt.start_pos)
|
||||||
self.pop_stmt()
|
self.pop_stmt()
|
||||||
|
|||||||
13
test/static_analysis/descriptors.py
Normal file
13
test/static_analysis/descriptors.py
Normal 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')
|
||||||
Reference in New Issue
Block a user