Shi Mu wrote:

> I used the following method to remove duplicate items in a list and
> got confused by the error.
>
> >>> a
> [[1, 2], [1, 2], [2, 3]]
> >>> noDups=[ u for u in a if u not in locals()['_[1]'] ]

that's not portable, relies on CPython 2.4 implementation details, and
shouldn't be used unless you understand exactly why it shouldn't be
used.  please pick another solution from the cookbook page.

(fwiw, this shows why the activestate cookbook needs an editor, and
why "user-annotated documention" means that the documentation will
be no better than the dumbest contributor)

</F>



-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to