mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 14:04:26 +08:00
operations (+, *, etc) shouldn't be InstanceElements, fixes #246
This commit is contained in:
@@ -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):
|
||||
|
||||
@@ -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
|
||||
# -----------------
|
||||
|
||||
Reference in New Issue
Block a user