mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-08 14:54:47 +08:00
nested classes may have caused problems
This commit is contained in:
@@ -163,6 +163,8 @@ class Instance(Executable):
|
||||
# This loop adds the names of the self object, copies them and removes
|
||||
# the self.
|
||||
for sub in self.base.subscopes:
|
||||
if isinstance(sub, parsing.Class):
|
||||
continue
|
||||
# Get the self name, if there's one.
|
||||
self_name = self.get_func_self_name(sub)
|
||||
if self_name:
|
||||
|
||||
@@ -209,3 +209,25 @@ def a():
|
||||
A().b()
|
||||
#? str()
|
||||
A().a()
|
||||
|
||||
# -----------------
|
||||
# nested classes
|
||||
# -----------------
|
||||
class A():
|
||||
class B():
|
||||
pass
|
||||
def b(self):
|
||||
return 1.0
|
||||
|
||||
#? float()
|
||||
A().b()
|
||||
|
||||
class A():
|
||||
def b(self):
|
||||
class B():
|
||||
def b(self):
|
||||
return []
|
||||
return B().b()
|
||||
|
||||
#? list()
|
||||
A().b()
|
||||
|
||||
Reference in New Issue
Block a user