Uh oh!
There was an error while loading. Please reload this page.
gh-125783: Add tests to prevent regressions with the combination of ctypes and metaclasses. - #125881
Conversation
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
ZeroIntensity
commented
Oct 24, 2024
This is an internal-only change, I don't think it needs a NEWS entry. |
Such an implementation is used in `IUnknown` of `comtypes`.
Such an implementation is used in `CoClass` of `comtypes`.
1f4eecd to
cf81f03Compare
ZeroIntensity
left a comment
There was a problem hiding this comment.
I would really rather not use _ in local names here, it makes it unclear that we're testing something public.
ZeroIntensity
left a comment
There was a problem hiding this comment.
Thank you! Take my review as provisional--I am concerned about the use of _pointer_type_cache, as that's private, but it looks like it's not terribly abused in this case (I think?)
junkmd
commented
Oct 24, 2024
This was also discussed in #125783, and it seems that these implementations were made with careful consideration, as the originator of both |
encukou
left a comment
There was a problem hiding this comment.
Thank you for the test! I'd only like to change the names and add some comments.
The main thing we're testing here instantiation of a class in its own __new__, not the early return, that's there to avoid recursion.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
encukou
commented
Oct 25, 2024
I plan to commit the suggestions and merge next week, if there are no objections. |
Co-authored-by: Petr Viktorin <encukou@gmail.com>
junkmd
commented
Oct 25, 2024
Can we apply needs backport to 3.12 and needs backport to 3.13 labels to this PR? |
ZeroIntensity
commented
Oct 25, 2024
I'm not sure if we backport increased test coverage. |
encukou
commented
Oct 25, 2024
We generally do, mostly to make it easier to backport later changes that need tests. |
…n of `ctypes` and metaclasses. (pythonGH-125881) (cherry picked from commit 1384409) Co-authored-by: Jun Komoda <45822440+junkmd@users.noreply.github.com>
…n of `ctypes` and metaclasses. (pythonGH-125881) (cherry picked from commit 1384409) Co-authored-by: Jun Komoda <45822440+junkmd@users.noreply.github.com>
GH-125987 is a backport of this pull request to the 3.13 branch. |
GH-125988 is a backport of this pull request to the 3.12 branch. |
…on of `ctypes` and metaclasses. (GH-125881) (GH-125988) cherry picked from commit 1384409 by Jun Komoda Also: Add test_ctypes/_support.py from 3.13+ This partially backports be89ee5 (#113727) by AN Long Co-authored-by: Jun Komoda <45822440+junkmd@users.noreply.github.com> Co-authored-by: AN Long <aisk@users.noreply.github.com> Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
…n of `ctypes` and metaclasses. (pythonGH-125881)
I would like to backport this to 3.12 and 3.13 as well.
ctypesand metaclasses. #125783