title: Operate on part of sequence while returning whole sequence
body: <p>I want to shorten a python class name by truncating all but the last part ie: <code>module.path.to.Class</code> => <code>mo.pa.to.Class</code>.</p>
  
  <p>This could be accomplished by splittin the string and storing the list in a variable and then operating on all but the last part and joining them back.</p>
  
  <p>I would like to know if there is a way to do this in one step ie:</p>
  
  <ul>
  <li>split to parts</li>
  <li>create two copies of sequence (<code>tee</code> ?)</li>
  <li>apply truncation to one sequence and not the other</li>
  <li>join selected parts of sequence</li>
  </ul>
  
  <p>Something like:</p>
  
  <pre><code>'.'.join( [chain(map(lambda x: x[:2], foo[:-1]), bar[-1]) for foo, bar in tee(name.split('.'))] )
  </code></pre>
  
  <p>But I'm unable to figure out working with <code>...foo, bar in tee(...</code> </p>