Author ezio.melotti
Recipients brian.curtin, chris.jerdonek, ezio.melotti
Date 2013-03-06.19:29:42
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1362598183.05.0.0896828726406.issue17323@psf.upfronthosting.co.za>
In-reply-to
Content
Here's a proof of concept that defines a new _print_total_refs() function and calls it through the PRINT_TOTAL_REFS macro, disables printing the refs by default, and adds a "-X showrefcount" option to reenable it.  This can also be achieved at runtime by adding/removing 'showrefcount' from the sys._xoptions dict.

Things that should be done/decided before the final version:
 1) the function and/or prototype should probably be moved to a better place;
 2) the 'showrefcount' name sounds ok to me, but I'm open to suggestions if you can come up with something better;
 3) the function could do the equivalent of "if sys._xoptions.get('showrefcount', False):" instead of "if 'showrefcount' in sys._xoptions:";
 4) now that this can be enabled/disabled at runtime, we might make it available to non-debug builds too (unless there are other negative side-effects);
History
Date User Action Args
2013-03-06 19:29:43ezio.melottisetrecipients: + ezio.melotti, brian.curtin, chris.jerdonek
2013-03-06 19:29:43ezio.melottisetmessageid: <1362598183.05.0.0896828726406.issue17323@psf.upfronthosting.co.za>
2013-03-06 19:29:43ezio.melottilinkissue17323 messages
2013-03-06 19:29:42ezio.melotticreate