nested classes may have caused problems

This commit is contained in:
David Halter
2012-07-17 10:31:53 +02:00
parent 2feef20dc5
commit 6e8510b2bd
2 changed files with 24 additions and 0 deletions

View File

@@ -163,6 +163,8 @@ class Instance(Executable):
# This loop adds the names of the self object, copies them and removes # This loop adds the names of the self object, copies them and removes
# the self. # the self.
for sub in self.base.subscopes: for sub in self.base.subscopes:
if isinstance(sub, parsing.Class):
continue
# Get the self name, if there's one. # Get the self name, if there's one.
self_name = self.get_func_self_name(sub) self_name = self.get_func_self_name(sub)
if self_name: if self_name:

View File

@@ -209,3 +209,25 @@ def a():
A().b() A().b()
#? str() #? str()
A().a() 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()