gh-136535: Tests: Correct Py_TPFLAGS_MANAGED_DICT in test_class.py#136538
gh-136535: Tests: Correct Py_TPFLAGS_MANAGED_DICT in test_class.py#136538corona10 merged 5 commits intopython:mainfrom
Py_TPFLAGS_MANAGED_DICT in test_class.py#136538Conversation
|
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 |
665ca05 to
6050223
Compare
…ass.py` The `Py_TPFLAGS_MANAGED_DICT` constant in `Lib/test/test_class.py` was incorrectly set to (1 << 2) instead of the correct (1 << 4) from object.h.
30edb78 to
407de3c
Compare
There was a problem hiding this comment.
LGTM, I also double checked with the original reference:
Line 551 in 47b01da
I am waiting @Fidget-Spinner or @markshannon 's review also.
corona10
left a comment
There was a problem hiding this comment.
Hi would you like to improve the test if the is Py_TPFLAGS_MANAGED_DICT wrongly set?
With my local change it is passed if I modify the value into 1 << 2, I prefer to prevent regression in the future.
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
Hello. I thought the test I added would prevent regression issues, but it didn't. |
|
|
||
| class TestInlineValues(unittest.TestCase): | ||
|
|
||
| def test_flags(self): |
There was a problem hiding this comment.
Please revive test_flags also.
There was a problem hiding this comment.
@ever0de Oh it was my miss, you don't have to revive :(
There was a problem hiding this comment.
Ah, I see, Should I drop this commit then?
| self.c = 3 | ||
| self.d = 4 | ||
|
|
||
| class VarSizedSubclass(tuple): |
There was a problem hiding this comment.
| class VarSizedSubclass(tuple): | |
| class VarSizedSubclass(tuple): |
| Py_TPFLAGS_MANAGED_DICT = (1 << 4) | ||
|
|
||
| class NoManagedDict: | ||
| __slots__ = ('a',) |
There was a problem hiding this comment.
| __slots__ = ('a',) | |
| __slots__ = ('a',) | |
pep 8
There was a problem hiding this comment.
This reverts commit b39ca1a.
|
Is there any feedback or are there any requested changes I should be aware of? |
|
I completely forgot how the managed dict works as it's been a few years, so I don't think I can review this. Sorry! |
…ass.py` (pythongh-136538) (cherry picked from commit aa4b5a7) Co-authored-by: Jiseok CHOI <[email protected]>
…ass.py` (pythongh-136538) (cherry picked from commit aa4b5a7) Co-authored-by: Jiseok CHOI <[email protected]>
|
GH-140532 is a backport of this pull request to the 3.14 branch. |
|
GH-140533 is a backport of this pull request to the 3.13 branch. |
|
The
Py_TPFLAGS_MANAGED_DICTconstant inLib/test/test_class.pywas incorrectly set to (1 << 2) instead of the correct (1 << 4) from object.h.issue: #136535
Py_TPFLAGS_MANAGED_DICTinLib/test/test_class.py#136535