Describe the bug
For better or worse, the PyDict_Update() C-API function differs from dict.update() in that it only accepts mappings and rejects sequences of key-value 2-tuples.
https://docs.python.org/3/c-api/dict.html#c.PyDict_Update
In GraalPython, it doesn't reject them.
Operating system
Linux
CPU architecture
x86_64
GraalPy version
3.12-25.2.4
JDK version
No response
Context configuration
No response
Steps to reproduce
Call PyDict_Update() on a list of 2-tuples, or anything iterable that doesn't have a .keys() method.
Expected behavior
The result should be a TypeError.
Stack trace
Additional context
No response
Describe the bug
For better or worse, the
PyDict_Update()C-API function differs fromdict.update()in that it only accepts mappings and rejects sequences of key-value 2-tuples.https://docs.python.org/3/c-api/dict.html#c.PyDict_Update
In GraalPython, it doesn't reject them.
Operating system
Linux
CPU architecture
x86_64
GraalPy version
3.12-25.2.4
JDK version
No response
Context configuration
No response
Steps to reproduce
Call
PyDict_Update()on a list of 2-tuples, or anything iterable that doesn't have a.keys()method.Expected behavior
The result should be a
TypeError.Stack trace
Additional context
No response