Add an access abstraction (only array tests work, yet)
The access abstraction will be the new way of accessing builtin objects. This way it will be easier to move that to another process
This commit is contained in:
1 parent
52bc1be84e
commit
7263d8565b
10 files changed
+408
-235
No files matched your search
@@ -306,7 +306,7 @@ class BoundMethod(FunctionContext):
|
||||
class CompiledBoundMethod(compiled.CompiledObject):
|
||||
def __init__(self, func):
|
||||
super(CompiledBoundMethod, self).__init__(
|
||||
func.evaluator, func.obj, func.parent_context, func.tree_node)
|
||||
func.evaluator, func.access, func.parent_context, func.tree_node)
|
||||
|
||||
def get_param_names(self):
|
||||
return list(super(CompiledBoundMethod, self).get_param_names())[1:]
|
||||
|
||||
@@ -300,7 +300,7 @@ class SequenceLiteralContext(ArrayMixin, AbstractIterable):
|
||||
for key, value in self._items():
|
||||
for k in self._defining_context.eval_node(key):
|
||||
if isinstance(k, compiled.CompiledObject) \
|
||||
and index == k.obj:
|
||||
and index == k.get_safe_value(default=None):
|
||||
return self._defining_context.eval_node(value)
|
||||
raise KeyError('No key found in dictionary %s.' % self)
|
||||
|
||||
|
||||
Reference in new issue
Block a user