[Patches] [ python-Patches-1443865 ] gc.get_count() and other changes

SourceForge.net noreply at sourceforge.net
Tue Mar 7 06:19:14 CET 2006


Patches item #1443865, was opened at 2006-03-05 20:09
Message generated for change (Comment added) made by nnorwitz
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1443865&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Core (C code)
Group: Python 2.5
Status: Open
Resolution: None
Priority: 5
Submitted By: Barry A. Warsaw (bwarsaw)
Assigned to: Skip Montanaro (montanaro)
Summary: gc.get_count() and other changes

Initial Comment:
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.


----------------------------------------------------------------------

>Comment By: Neal Norwitz (nnorwitz)
Date: 2006-03-06 21:19

Message:
Logged In: YES 
user_id=33168

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.

----------------------------------------------------------------------

Comment By: Barry A. Warsaw (bwarsaw)
Date: 2006-03-06 19:26

Message:
Logged In: YES 
user_id=12800

All good points.  Here's a revised patch, with test cases
and doc updates.

----------------------------------------------------------------------

Comment By: Neal Norwitz (nnorwitz)
Date: 2006-03-06 15:42

Message:
Logged In: YES 
user_id=33168

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 ?


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1443865&group_id=5470


More information about the Patches mailing list