operations (+, *, etc) shouldn't be InstanceElements, fixes #246

This commit is contained in:
David Halter
2013-07-18 12:31:48 +02:00
parent 075c60de29
commit 9348feb8bf
2 changed files with 8 additions and 0 deletions

View File

@@ -217,6 +217,7 @@ class InstanceElement(use_metaclass(cache.CachedMetaClass)):
def get_commands(self):
# Copy and modify the array.
return [InstanceElement(self.instance, command, self.is_class_var)
if not isinstance(command, unicode) else command
for command in self.var.get_commands()]
def __getattr__(self, name):

View File

@@ -119,6 +119,13 @@ strs.second
#? ['var_class']
TestClass.var_class.var_class.var_class.var_class
# operations (+, *, etc) shouldn't be InstanceElements - #246
class A():
def __init__(self):
self.addition = 1 + 2
#? int()
A().addition
# -----------------
# inheritance
# -----------------