From: Bartosz Sławecki Date: Fri, 23 Jan 2026 16:34:21 +0000 (+0100) Subject: Programming FAQ: fix some punctuaction typos (GH-144058) X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=03e651d601c7d54ffe93ef1bbd4f66fafb89eded;p=thirdparty%2FPython%2Fcpython.git Programming FAQ: fix some punctuaction typos (GH-144058) Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com> --- diff --git a/Doc/faq/programming.rst b/Doc/faq/programming.rst index 6f9dfa8616ed..138a5ca7a751 100644 --- a/Doc/faq/programming.rst +++ b/Doc/faq/programming.rst @@ -1226,13 +1226,13 @@ This converts the list into a set, thereby removing duplicates, and then back into a list. -How do you remove multiple items from a list --------------------------------------------- +How do you remove multiple items from a list? +--------------------------------------------- As with removing duplicates, explicitly iterating in reverse with a delete condition is one possibility. However, it is easier and faster to use slice replacement with an implicit or explicit forward iteration. -Here are three variations.:: +Here are three variations:: mylist[:] = filter(keep_function, mylist) mylist[:] = (x for x in mylist if keep_condition)