Skip to content

[Bug]: PyDict_Update() accepts sequence of tuples #1084

Description

@scoder

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions