SF patch #1443865; gc.get_count() added and optional argument 'generation'
added to gc.collect(). Updated docs, unit test, and NEWS entry.
(Also, fixed a typo in NEWS.)
diff --git a/Doc/lib/libgc.tex b/Doc/lib/libgc.tex
index e53e2a8..54ca26c 100644
--- a/Doc/lib/libgc.tex
+++ b/Doc/lib/libgc.tex
@@ -32,9 +32,13 @@
Returns true if automatic collection is enabled.
\end{funcdesc}
-\begin{funcdesc}{collect}{}
-Run a full collection. All generations are examined and the
-number of unreachable objects found is returned.
+\begin{funcdesc}{collect}{\optional{generation}}
+With no arguments, run a full collection. The optional argument
+\var{generation} may be an integer specifying which generation to collect
+(from 0 to 2). A ValueError is raised if the generation number is invalid.
+The number of unreachable objects found is returned.
+
+\versionchanged[The optional \var{generation} argument was added]{2.5}
\end{funcdesc}
\begin{funcdesc}{set_debug}{flags}
@@ -76,6 +80,12 @@
\code{1} before collecting generation \code{2}.
\end{funcdesc}
+\begin{funcdesc}{get_count}{}
+Return the current collection counts as a tuple of
+\code{(\var{count0}, \var{count1}, \var{count2})}.
+\versionadded{2.5}
+\end{funcdesc}
+
\begin{funcdesc}{get_threshold}{}
Return the current collection thresholds as a tuple of
\code{(\var{threshold0}, \var{threshold1}, \var{threshold2})}.