three argument filtering
<p>Lets assume I have defined function:</p>

<pre><code>def threeArgs(x,y,z):
  return ... # Returns True or False
</code></pre>

<p>I also have a list of elements:</p>

<pre><code>a = [elem1, elem2, ..., elemN]
</code></pre>

<p>I would like to construct another list b containing first and last element form list a and those elements Xn in between for which threeArgs(Xn-1,Xn, Xn+1) returns true.</p>

<p>How to do it in elegant pythonic way? </p>
