Skip to content
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

gh-128762: Include inline values in sys.getsizeof() #128763

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

hashbrowncipher
Copy link
Contributor

@hashbrowncipher hashbrowncipher commented Jan 12, 2025

inline_values_size = 32

linked_list = None
for i in range(28):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I find that it needs this many iterations to "stabilize". Is there a right way to do this?

@@ -1475,6 +1479,16 @@ def test_gc_head_size(self):
# but lists are
self.assertEqual(sys.getsizeof([]), vsize('Pn') + gc_header_size)

def test_inline_values(self):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have overall low confidence that this is the right way to test this, and I'm open to suggestions.

@hashbrowncipher hashbrowncipher changed the title gh-128762: Include inline values in sys.getsizeof gh-128762: Include inline values in sys.getsizeof() Jan 12, 2025
@hashbrowncipher hashbrowncipher marked this pull request as ready for review January 12, 2025 21:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant