Bug report
Testing out 3.12.0rc1 on NumPy, we came across numpy/numpy#24399. I have distilled this down to a reproducer that fails on 3.12.0rc1, but passes on previous versions.
Checklist
A clear and concise description of the bug
fromctypesimportStructure, pointer, c_int16, cast, POINTERclassStruct(Structure):
_fields_= [('a', c_int16)]
Struct3=3*Structc_array= (2*Struct3)(
Struct3(Struct(a=1), Struct(a=2), Struct(a=3)),
Struct3(Struct(a=4), Struct(a=5), Struct(a=6))
)
assertc_array[0][0].a==1p_obj=cast(pointer(c_array), POINTER(pointer(c_array)._type_))
obj=p_obj.contents# Works on 3.12, obj is 2dassertobj[0][0].a==1p_obj=cast(pointer(c_array[0]), POINTER(pointer(c_array)._type_))
obj=p_obj.contents# Fails on 3.12.0rc1, but works on 3.11 and earlier: obj is not 2dassertobj[0][0].a==1Your environment
- CPython versions tested on: 3.12rc1
- Operating system and architecture: ubuntu 22.04
Edit: 3.12rc1 -> 3.12.0rc1
Linked PRs
Bug report
Testing out 3.12.0rc1 on NumPy, we came across numpy/numpy#24399. I have distilled this down to a reproducer that fails on 3.12.0rc1, but passes on previous versions.
Checklist
A clear and concise description of the bug
Your environment
Edit: 3.12rc1 -> 3.12.0rc1
Linked PRs
_type_of the container #108222