gh-146086: Clarify sys.getsizeof() docstring regarding additional overhead#146087
gh-146086: Clarify sys.getsizeof() docstring regarding additional overhead#146087merkulovlad wants to merge 1 commit intopython:mainfrom
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 |
|
I'm not sure it is worth doing. Added message doesn't no clarify the difference IMO, because there can be more extra data, that not calculated. cc @picnixz |
|
Thanks for the feedback! I see your point that additional overhead is not limited to the garbage collector and that both My intention was mainly to reduce the potential confusion from the short help text, where Would it make sense either to:
Happy to adjust the wording based on your preference. |
This change clarifies the short built-in documentation for
sys.getsizeof().The full documentation already explains that
getsizeof()calls__sizeof__()and may add additional overhead (e.g., for the garbage collector). However, this distinction is not visible from the short help output (help()/pydoc).This change adds a short clarification to reduce potential confusion.
This is a documentation-only change and does not affect runtime behavior. No NEWS entry is needed.