Fix the last remaining issues of the first part of the NamePart switch.

This commit is contained in:
Dave Halter
2014-09-09 15:58:20 +02:00
parent 45e033c50e
commit b68a59daef
5 changed files with 9 additions and 2 deletions
-1
View File
@@ -305,7 +305,6 @@ class FakeImport(pr.Import):
class FakeName(pr.Name):
def __init__(self, name_or_names, parent=None, start_pos=(0, 0)):
start_pos = 0, 0
if isinstance(name_or_names, list):
names = [(n, start_pos) for n in name_or_names]
else:
+6
View File
@@ -291,6 +291,12 @@ class InstanceElement(use_metaclass(CachedMetaClass, pr.Base)):
return [get_instance_el(self._evaluator, self.instance, command, self.is_class_var)
for command in self.var.expression_list()]
@property
@underscore_memoization
def name(self):
name = self.var.name
return helpers.FakeName(unicode(name), self, name.start_pos)
def __iter__(self):
for el in self.var.__iter__():
yield get_instance_el(self._evaluator, self.instance, el,