]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-43977: Use tp_flags for collection matching (GH-25723)
authorMark Shannon <mark@hotpy.org>
Fri, 30 Apr 2021 08:50:28 +0000 (09:50 +0100)
committerGitHub <noreply@github.com>
Fri, 30 Apr 2021 08:50:28 +0000 (09:50 +0100)
commit069e81ab3da46c441335ca762c4333b7bd91861d
tree02716907f4513a812cf2c72309cc4e6f133b3ab3
parent2abbd8f2add5e80b86a965625b9a77ae94a101cd
bpo-43977: Use tp_flags for collection matching (GH-25723)

* Add Py_TPFLAGS_SEQUENCE and Py_TPFLAGS_MAPPING, add to all relevant standard builtin classes.

* Set relevant flags on collections.abc.Sequence and Mapping.

* Use flags in MATCH_SEQUENCE and MATCH_MAPPING opcodes.

* Inherit Py_TPFLAGS_SEQUENCE and Py_TPFLAGS_MAPPING.

* Add NEWS

* Remove interpreter-state map_abc and seq_abc fields.
16 files changed:
Include/internal/pycore_interp.h
Include/object.h
Lib/_collections_abc.py
Misc/NEWS.d/next/Core and Builtins/2021-04-29-17-40-25.bpo-43977.FrQhge.rst [new file with mode: 0644]
Modules/_abc.c
Modules/_collectionsmodule.c
Modules/arraymodule.c
Objects/descrobject.c
Objects/dictobject.c
Objects/listobject.c
Objects/memoryobject.c
Objects/rangeobject.c
Objects/tupleobject.c
Objects/typeobject.c
Python/ceval.c
Python/pystate.c