¡@

Home 

python Programming Glossary: dosomestuff

Python: Memory usage and optimization when modifying lists

http://stackoverflow.com/questions/2631053/python-memory-usage-and-optimization-when-modifying-lists

index 0 while index len somelist item somelist index dosomestuff item if somecondition item del somelist index else index 1 This.. while processingdata for i in xrange len somelist 1 1 1 dosomestuff item if somecondition somelist i somelist.pop i This avoids.. cost as the original version. It also breaks the logic of dosomestuff item that wishes to process them in the same order as they appear..