Removing None objects from a sequence

Steven D'Aprano steve at
Sat Dec 13 17:13:24 CET 2008

On Sat, 13 Dec 2008 11:07:53 +0000, Steven D'Aprano wrote:

> Now, sure, most of the work in Tim's version is executed in fast C code
> instead of slow Python code.

Say what???

I'm sorry, I must have been smoking crack when I wrote that. It does 
nothing of the sort. Tim's version is pure Python.

def deNone2(alist):
    alist[:] = [x for x in alist if x is not None]


More information about the Python-list mailing list