◐ Shell
clean mode source ↗

gh-103092: Isolate _ctypes, part 1 by erlend-aasland · Pull Request #103893 · python/cpython

@bedevere-bot

🤖 New build scheduled with the buildbot fleet by @erlend-aasland for commit a276753 🤖

If you want to schedule another build, you need to add the 🔨 test-with-refleak-buildbots label again.

kumaraditya303

@swt2c

Hi @erlend-aasland, as part of this, it seems that CArgObject moved from builtins to _ctypes. Just confirming that was intentional?

3.11:

>>> import ctypes
>>> type(ctypes.byref(ctypes.c_int(0)))
<class 'CArgObject'>

3.12

>>> import ctypes
>>> type(ctypes.byref(ctypes.c_int(0)))
<class '_ctypes.CArgObject'>

@erlend-aasland

CArgsObject still belongs to ctypes, just as it does in 3.11. What changed was its fully qualified name only. That change is deliberate because it is needed to be able to look up the module the heap type belongs to.

EDIT: Thinking about it, I think the last sentence I wrote above is not right; I'm pretty sure module lookup would work anyways (but I don't intend to pursue this right now).