title: Python lambda with regex
body: <p>When using re.sub() part of re for python, a function can be used for sub if I am not mistaken. To my knowledge it passes in the match to whatever function is passed for example:</p>
  
  <pre><code>r = re.compile(r'([A-Za-z]')
  r.sub(function,string)
  </code></pre>
  
  <p>Is there a smarter way to have it pass in a second arg other than with a lambda that calls a method?</p>
  
  <pre><code>r.sub(lambda x: function(x,arg),string)
  </code></pre>