mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-08 06:44:46 +08:00
Fix an issue with named args goto.
This commit is contained in:
@@ -472,7 +472,10 @@ class Class(use_metaclass(CachedMetaClass, Wrapper)):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def params(self):
|
def params(self):
|
||||||
return self.get_subscope_by_name('__init__').params
|
try:
|
||||||
|
return self.get_subscope_by_name('__init__').params
|
||||||
|
except KeyError:
|
||||||
|
return [] # object.__init__
|
||||||
|
|
||||||
def names_dicts(self, search_global, is_instance=False):
|
def names_dicts(self, search_global, is_instance=False):
|
||||||
if search_global:
|
if search_global:
|
||||||
@@ -491,7 +494,7 @@ class Class(use_metaclass(CachedMetaClass, Wrapper)):
|
|||||||
for s in self.py__mro__():
|
for s in self.py__mro__():
|
||||||
for sub in reversed(s.subscopes):
|
for sub in reversed(s.subscopes):
|
||||||
if sub.name.value == name:
|
if sub.name.value == name:
|
||||||
return sub
|
return sub
|
||||||
raise KeyError("Couldn't find subscope.")
|
raise KeyError("Couldn't find subscope.")
|
||||||
|
|
||||||
def __getattr__(self, name):
|
def __getattr__(self, name):
|
||||||
|
|||||||
@@ -102,6 +102,13 @@ def f(t=None):
|
|||||||
#! 9 ['t=None']
|
#! 9 ['t=None']
|
||||||
t = t or 1
|
t = t or 1
|
||||||
|
|
||||||
|
|
||||||
|
class X():
|
||||||
|
pass
|
||||||
|
|
||||||
|
#! 3 []
|
||||||
|
X(foo=x)
|
||||||
|
|
||||||
# -----------------
|
# -----------------
|
||||||
# imports
|
# imports
|
||||||
# -----------------
|
# -----------------
|
||||||
|
|||||||
Reference in New Issue
Block a user