Increase the last element in a tuple
<p>I want to implement a function that takes a <code>tuple</code> of <code>int</code>s and increases the last element by 1:</p>

<pre><code>inc((0,0,0,1))==(0,0,0,2)
inc((1,2,3))==(1,2,4)
</code></pre>

<p>This is what I came up with:</p>

<pre><code>def inc(t):
   l=list(t)
   l[-1]+=1
   return tuple(l)
</code></pre>

<p>Can this be done in a more compact way (and maybe without the conversion to list) ?</p>