-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
gh-136535: Tests: Correct Py_TPFLAGS_MANAGED_DICT
in test_class.py
#136538
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
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 |
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, I also double checked with the original reference:
Line 551 in 47b01da
#define Py_TPFLAGS_MANAGED_DICT (1 << 4) |
I am waiting @Fidget-Spinner or @markshannon 's review also.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please revive test_flags also.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ever0de Oh it was my miss, you don't have to revive :(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I see, Should I drop this commit then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, please revert b39ca1a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
@@ -873,12 +877,31 @@ def __init__(self): | |||
self.c = 3 | |||
self.d = 4 | |||
|
|||
class VarSizedSubclass(tuple): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
class VarSizedSubclass(tuple): | |
class VarSizedSubclass(tuple): |
Py_TPFLAGS_MANAGED_DICT = (1 << 4) | ||
|
||
class NoManagedDict: | ||
__slots__ = ('a',) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
__slots__ = ('a',) | |
__slots__ = ('a',) | |
pep 8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This reverts commit b39ca1a.
The
Py_TPFLAGS_MANAGED_DICT
constant inLib/test/test_class.py
was incorrectly set to (1 << 2) instead of the correct (1 << 4) from object.h.issue: #136535
Py_TPFLAGS_MANAGED_DICT
inLib/test/test_class.py
#136535