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.

Author eli.bendersky
Recipients eli.bendersky, eric.araujo, eric.smith, giampaolo.rodola, rhettinger, terry.reedy
Date 2010-11-27.10:09:01
SpamBayes Score 1.4890004e-08
Marked as misclassified No
Message-id <1290852543.2.0.914201704126.issue10516@psf.upfronthosting.co.za>
In-reply-to
Content
Objects/listobject.c has a static function named list_clear used internally. Is it possible to just expose this function as a clear() method? 

One problem is that it has this strange comment in the end:

    /* Never fails; the return value can be ignored.
       Note that there is no guarantee that the list is actually empty
       at this point, because XDECREF may have populated it again! */

However, looking at the code I'm not sure the list can be cleared any more than the function does, and it actually deallocates the ob_item field of the list.
History
Date User Action Args
2010-11-27 10:09:03eli.benderskysetrecipients: + eli.bendersky, rhettinger, terry.reedy, eric.smith, giampaolo.rodola, eric.araujo
2010-11-27 10:09:03eli.benderskysetmessageid: <1290852543.2.0.914201704126.issue10516@psf.upfronthosting.co.za>
2010-11-27 10:09:01eli.benderskylinkissue10516 messages
2010-11-27 10:09:01eli.benderskycreate