title: Python: Is it possible to unpack a sequence type inline in a "with" statement
body: <p>Is there any way to do inline unpacking in a with statement in python?</p>
  
  <p>Right now, I have a custom context manager that returns a <code>sqlalchemy</code> <code>row</code> object, and the associated <code>session</code> needed to potentially delete it as a 2-tuple, and handles the necessary database manipulations on context exit:</p>
  
  <pre><code>with self.row_sess_context(dbid=relid) as tup:
      row, sess = tup
  
      ...[manipulation code]...
  </code></pre>
  
  <p>Now, it seems to me like it'd be particularly "pythonic" to be able to do something like:</p>
  
  <pre><code>    with self.row_sess_context(dbid=relid) as row, sess:
  
      ...[manipulation code]...
  </code></pre>
  
  <p>Particularly as python already supports sequence unpacking in most other contexts (<code>for</code>, list comprehension, normal assignment, etc...). </p>
  
  <p>Experimenting with things <strike>like trying to put <code>row, sess</code> is invalid</strike> <a href="https://github.com/sublimehq/Packages/issues/1467" rel="nofollow noreferrer">confuses the sublime text syntax highlighter</a>, and I'm apparently not smart enough to understand if this is just flat out not possible from the formal grammar definition.</p>
  
  <p>Is there a better way then having to manually unpack the tuple?</p>