<br>
<div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">I would approach that with<br>
<br>
numbers = (int(m.group()) for m in re.finditer(r"\b\d+\b"))<br>
numbers = [n for n in numbers if 1 <= n <= 10]<br></blockquote><div><br>To follow up on this: he has pointed out an existing way of doing something that fully covers the goal of your addition. The current way is both straightforward, elegant, and self-describes what it is doing, I believe. I think if we have an obvious way to do it, we usually want to be consistent with our normal attempt of having one obvious way to do it.<br>
<br>If his way wasn't obvious, you may not be Dutch.<br></div></div>