title: using diff util with --show-function-line for Python files
body: <p>I like to compare Python sources with <code>diff</code> util and I have seen that <code>git diff</code> shows me the function name (for some files, but also not for Python) in the hunk or chunk? header. Thats why I searched to do the same with normal <code>diff</code>.</p>
  <p>Then I found that there is a <code>-p, --show-c-function</code> param, which don't work well with Python files (I only get the class name). So I also found in the man page the param: <code>-F, --show-function-line=RE</code></p>
  <p>Now I searched for a nice RE to match python functions to include them in my diff output without luck.</p>
  <p>I know we have <code>def myname():</code> or <code>async def myname():</code> ... and maybe more?</p>
  <p>Has someone a good RegEx for it?</p>
  <p>I <a href="https://stackoverflow.com/questions/10164137/regular-expression-to-match-function-name-and-all-arguments-in-python">found this one</a>, but it don't work with diff util (the output has no function names):</p>
  <pre><code>diff -Nru -F '(?P&lt;function&gt;\w+)\s?\((?P&lt;arg&gt;(?P&lt;args&gt;\w+(,\s?)?)+)\)' modules/websocket/__init__.py.old modules/websocket/__init__.py
  </code></pre>
  <p>Regards,
  Thomas</p>