NamePart is now no str subclass anymore. They are separated, which makes us save a lot of dicts

This commit is contained in:
Dave Halter
2014-02-13 19:22:36 +01:00
parent 660a29ef93
commit 600371632f
7 changed files with 34 additions and 18 deletions
+1
View File
@@ -348,6 +348,7 @@ class Evaluator(object):
def filter_private_variable(scope, call_scope, var_name):
"""private variables begin with a double underline `__`"""
var_name = str(var_name) # var_name could be a NamePart
if isinstance(var_name, (str, unicode)) and isinstance(scope, er.Instance)\
and var_name.startswith('__') and not var_name.endswith('__'):
s = call_scope.get_parent_until((pr.Class, er.Instance, compiled.CompiledObject))
+1
View File
@@ -63,6 +63,7 @@ class ImportPath(pr.Base):
self.import_path.append(import_stmt.namespace.names[0])
else:
self.import_path += import_stmt.namespace.names
self.import_path = [str(name_part) for name_part in self.import_path]
for i in range(kill_count + int(is_like_search)):
self.import_path.pop()