removeall() in list

castironpi at gmail.com castironpi at gmail.com
Sat Jan 12 00:43:36 CET 2008


On Jan 11, 5:26 pm, Paul Rubin <http://phr...@NOSPAM.invalid> wrote:
> castiro... at gmail.com writes:
> > This function just wants X out of the list.  It doesn't matter if this
> > happens before, during, or after something else; so long as it happens.
>
> 2. Associate a lock with the list.  Anything wanting to access the
> list should acquire the lock, do its stuff, then release the lock.
> This gets confusing after a while.

To keep it generic, how about:

listA.op( insert, x )
listA.op( remove, x )



More information about the Python-list mailing list