Passing Function tests now.

This commit is contained in:
Dave Halter
2014-09-22 14:06:38 +02:00
parent c4e45916c6
commit 8f3301f281
3 changed files with 5 additions and 6 deletions
+1 -1
View File
@@ -145,7 +145,7 @@ class NameFinder(object):
evaluation, so remove them already here!
"""
for n in names:
definition = n.parent.parent
definition = n.parent
if isinstance(definition, (pr.Function, pr.Class, pr.Module)):
yield er.wrap(self._evaluator, definition).name
else:
+1 -2
View File
@@ -193,14 +193,13 @@ class Array(use_metaclass(CachedMetaClass, IterableWrapper)):
def scope_names_generator(self, position=None):
"""
This method generates all `ArrayMethod` for one pr.Array.
It returns e.g. for a list: append, pop, ...
"""
# `array.type` is a string with the type, e.g. 'list'.
scope = self._evaluator.find_types(compiled.builtin, self._array.type)[0]
scope = self._evaluator.execute(scope)[0] # builtins only have one class
for _, names in scope.scope_names_generator():
yield self, [ArrayMethod(n) for n in names]
yield self, [helpers.FakeName(n.get_code(), self) for n in names]
@common.safe_property
def parent(self):