This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: gc.get_count() and other changes
Type: Stage:
Components: Interpreter Core Versions: Python 2.5
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: skip.montanaro Nosy List: barry, nnorwitz, skip.montanaro
Priority: normal Keywords: patch

Created on 2006-03-06 04:09 by barry, last changed 2022-04-11 14:56 by admin. This issue is now closed.

File name Uploaded Description Edit
gcpatch.diff barry, 2006-03-07 03:26
Messages (5)
msg49655 - (view) Author: Barry A. Warsaw (barry) * (Python committer) Date: 2006-03-06 04:09
This patch adds gc.get_count() as a companion to
gc.get_threshold().  It also adds an optional argument
to  gc.collect() to allow you to specify the generation
to collect.

This patch also fixes a couple of gcc warnings.
msg49656 - (view) Author: Neal Norwitz (nnorwitz) * (Python committer) Date: 2006-03-06 23:42
Logged In: YES 

I fixed the 2 warnings with %ld, so that part of the patch
isn't necessary any longer.

Instead of setting genarg = -999, can't you just set it to
NUM_GENERATIONS - 1 and get rid of the check for -999?

Doesn't ValueError make more sense than an IndexError? 
Isn't ValueError typically used for invalid args?

Should gc_collect be:  METH_VARARGS | METH_KEYWORDS ?
msg49657 - (view) Author: Barry A. Warsaw (barry) * (Python committer) Date: 2006-03-07 03:26
Logged In: YES 

All good points.  Here's a revised patch, with test cases
and doc updates.
msg49658 - (view) Author: Neal Norwitz (nnorwitz) * (Python committer) Date: 2006-03-07 05:19
Logged In: YES 

Oooooo, tests and doc, very nice.  Don't forget to add a
NEWS entry.  Also the doc should have \versionadded,
\versionchanged for the new method/added param.  Neil was
fine with the concept and no one else objected, so I'd say
check it in.
msg49659 - (view) Author: Barry A. Warsaw (barry) * (Python committer) Date: 2006-03-07 09:46
Logged In: YES 

Thanks!  Committed in r42880.
Date User Action Args
2022-04-11 14:56:15adminsetgithub: 42983
2006-03-06 04:09:36barrycreate