Pythonicity
Pythonistas take pride in the Pythonicity of their code. PEP 20 is a manifesto of "Pythonic" principles:
- Beautiful is better than ugly.
- Explicit is better than implicit.
- Simple is better than complex.
- Complex is better than complicated.
- Flat is better than nested.
- Sparse is better than dense.
- Readability counts.
- Special cases aren't special enough to break the rules.
- Although practicality beats purity.
- Errors should never pass silently.
- Unless explicitly silenced.
- In the face of ambiguity, refuse the temptation to guess.
- There should be one — and preferably only one — obvious way to do it.
- Although that way may not be obvious at first unless you're Dutch.
- Now is better than never.
- Although never is often better than right now.
- If the implementation is hard to explain, it's a bad idea.
- If the implementation is easy to explain, it may be a good idea.
- Namespaces are one honking great idea — let's do more of those!
The language is designed so that there are usually one (or just a few) good way to express the code (#13), and the culture of the Python community embraces that. I might go as far as to say that every question about how to write something in Python carries an implicit desire for Pythonicity.
Code Review
Speaking as a moderator for Code Review…
Code Review is a Stack Exchange community that helps programmers improve their code. On Code Review, we promote many of those principles listed above. Therefore, it may be tempting to refer more-idiomatic-version requests to Code Review.
However, before you even think about referring users to Code Review or flagging questions for migration, please take care to consider whether the question is actually on-topic for Code Review, as we have rather stringent requirements for questions.
Since many migrations from Stack Overflow to Code Review are rejected, we have prepared a checklist for migration. Many of the same criteria would also apply to cross-posting.
The cited question would be a poor question for Code Review because it is a completely generic how-to question. Code Review critiques actual code from a real project, in its natural habitat, so that we can offer custom-tailored advice.
It wouldn't take much of a change to make the question on-topic for Code Review, but that initiative has to come from the author. Completing the for-loop to make it working code, and providing a realistic motivating context would suffice.
Stack Overflow
As I noted above, the characteristics that make code Pythonic are laid out in PEP 20, so asking for Pythonicity is "good subjective", not primarily opinion-based. As evidenced by the current leading answer, there is indeed a Pythonic way to write it:
from itertools import chain
for j in chain(range(i), range(i+1, k)):
# ...
Since every Python question inherently seeks Pythonicity, it would be nonsense to close all such questions on Stack Overflow as primarily opinion-based.
Furthermore, you could also retitle and strip down the question to
For loop over integers 0 to k-1 except i in Python
I want to create a for loop that will go through the integers 0 to k-1, except for integer i. (I'm comparing some lists of k items, and I don't need to compare item i in one list with item i in another list.)
That question is clearly on-topic for Stack Overflow. It would be essentially an identical question. The responses would be exactly the same as the current ones. It makes no sense that adding a bit of code and text to clarify the request would make it off-topic for Stack Overflow.