Skip to content

Commit 7005bab

Browse files
timfelfangerer
authored andcommitted
be conservative and say that mappings cannot be accessed by index
1 parent 8a4bfcd commit 7005bab

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/PythonAbstractObject.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,9 @@ public Object readMember(String key,
203203
@ExportMessage
204204
public boolean hasArrayElements(
205205
@Shared("isSequenceNode") @Cached IsSequenceNode isSequenceNode,
206+
@Shared("isMapping") @Cached IsMappingNode isMapping,
206207
@Shared("isIterableNode") @Cached IsIterableNode isIterableNode) {
207-
return isSequenceNode.execute(this) || isIterableNode.execute(this);
208+
return (isSequenceNode.execute(this) && !isMapping.execute(this)) || isIterableNode.execute(this);
208209
}
209210

210211
@ExportMessage

0 commit comments

Comments
 (0)