Uh oh!
There was an error while loading. Please reload this page.
[_cffi_backend] Improve CField, CType, _CDataBase, buffer - #15530
[_cffi_backend] Improve CField, CType, _CDataBase, buffer#15530mildsunrise wants to merge 4 commits into
Conversation
the implementation really doesn't allow other objects being passed, and I see other stubs doing this, so I presume it's okay?
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
srittau
commented
Mar 20, 2026
LGTM, I'll merge this when you undraft. |
mildsunrise
commented
Mar 28, 2026
@srittau the CType class exposes different sets of attributes depending on the |
srittau
commented
Mar 30, 2026
I suggest we merge this PR as is, as it's a clear improvement on the status quo. Then we can experiment with the protocol-based approach in a targeted PR. I'm especially interested in the primer output. |
brianschubert
commented
Jun 7, 2026
This has conflicts now, @mildsunrise can you take a look? |
these were verified against implementation code. the docs are not very precise on some of these things, but I think it's clear all this is intended to be public facing API. CType in particular will be documented better as part of python-cffi/cffi#231.
draft because I still need to resolve the style issues (so far I can only see (1) replacing
Optionalwith| None, and (2) importingSelffrom _typing_extensions).I also need to see if Python/typeshed allows structural typing (because available CType fields vary depending on the value of
kind)