# Conditional loop filtering

**URL:** <https://discuss.python.org/t/conditional-loop-filtering/27317>\
**Category:** Ideas\
**Created:** [June 1, 2023, 11:56am UTC](https://discuss.python.org/t/conditional-loop-filtering/27317 "2023-06-01T11:56:47Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![b11c](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/b11c/32/2350_2.png) [@b11c](https://discuss.python.org/u/b11c)\
**Post date:** [June 1, 2023, 2:34pm UTC](https://discuss.python.org/t/conditional-loop-filtering/27317/6 "2023-06-01T14:34:59Z")

</div>

OK, reading through these threads I realise that the damage has already been done by allowing `if` expressions to have different syntax in comprehensions from the basic loops. So we can’t implement this idea without breaking backward compatibility, even taking into account that `if..else` is extremely rarely used in `for` loops.

---

_[View the full topic](https://discuss.python.org/t/conditional-loop-filtering/27317)._
