title: When using a list comprehension, is there a way to mention it in itself?
body: <p>Hi guys I'm using a list comprehension for a very simple task, is there a way to mention its own list in itself, what I mean by this, is... if for example I have the following code:</p>
  
  <pre><code>def intersection(list_1, list_2):
      return [item for item in list_1 if item in list_2]
  </code></pre>
  
  <p>The code is basically returning a list with all the items that both <code>list_1</code> and <code>list_2</code> have, it works, but I want it to also check if the item is not already stored in itself, so then that way there is no duplicates, I want to keep the order so that is why <code>set()</code> is not an option, something to note is that I want to know if there is a way of doing something like this: </p>
  
  <pre><code> [item for item in list_1 if item in list_2 and not in 'itself']
  </code></pre>
  
  <p>I would love to learn other ways of achieving the same, but my main question is if that is possible or not. I also want to mention I am aware that is achievable using a for loop.</p>