Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-136535: Tests: CorrectPy_TPFLAGS_MANAGED_DICT intest_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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
ever0de wants to merge5 commits intopython:main
base:main
Choose a base branch
Loading
fromever0de:fix-issue-136535

Conversation

ever0de
Copy link

@ever0deever0de commentedJul 11, 2025
edited by bedevere-appbot
Loading

ThePy_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

@python-cla-bot
Copy link

python-cla-botbot commentedJul 11, 2025
edited
Loading

All commit authors signed the Contributor License Agreement.

CLA signed

@bedevere-appbedevere-appbot added awaiting review testsTests in the Lib/test dir labelsJul 11, 2025
@bedevere-app
Copy link

Most changes to Pythonrequire a NEWS entry. Add one using theblurb_it web app or theblurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply theskip news label instead.

ever0de reacted with eyes emoji

…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) fromobject.h.
Copy link
Member

@corona10corona10 left a comment
edited
Loading

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:

#definePy_TPFLAGS_MANAGED_DICT (1 << 4)

I am waiting@Fidget-Spinner or@markshannon 's review also.

ever0de reacted with heart emoji
Copy link
Member

@corona10corona10 left a 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 isPy_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.

ever0de reacted with eyes emoji
@bedevere-app
Copy link

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 phraseI have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@corona10corona10 added needs backport to 3.13bugs and security fixes needs backport to 3.14bugs and security fixes labelsJul 13, 2025
@ever0de
Copy link
Author

ever0de commentedJul 13, 2025
edited
Loading

Hi would you like to improve the test if the isPy_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.

Hello. I thought the test I added would prevent regression issues, but it didn't.
I think I can prevent this problem by checkingPy_TPFLAGS_INLINE_VALUES (1 << 2 flag) in NoManagedDict. Would it be better to add it this way?
If you have any other better improvement suggestions, could you please propose them? Thank you!

corona10 reacted with thumbs up emoji


class TestInlineValues(unittest.TestCase):

def test_flags(self):
Copy link
Member

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.

Copy link
Member

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 :(

Copy link
Author

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?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Yeah, please revertb39ca1a

Copy link
Member

@corona10corona10 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

lgtm!

ever0de reacted with hooray emoji
@@ -873,12 +877,31 @@ def __init__(self):
self.c = 3
self.d = 4

class VarSizedSubclass(tuple):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Suggested change
classVarSizedSubclass(tuple):
classVarSizedSubclass(tuple):

Py_TPFLAGS_MANAGED_DICT = (1 << 4)

class NoManagedDict:
__slots__ = ('a',)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Suggested change
__slots__= ('a',)
__slots__= ('a',)

pep 8

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

ever0de reacted with eyes emoji
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@corona10corona10corona10 approved these changes

@markshannonmarkshannonAwaiting requested review from markshannon

@Fidget-SpinnerFidget-SpinnerAwaiting requested review from Fidget-Spinner

Assignees
No one assigned
Labels
awaiting mergeneeds backport to 3.13bugs and security fixesneeds backport to 3.14bugs and security fixesskip newstestsTests in the Lib/test dir
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@ever0de@corona10@StanFromIreland

[8]ページ先頭

©2009-2025 Movatter.jp