Is it possible to use an inline function in a Thread call?
<p>The documentation for <a href="https://docs.python.org/3.5/library/threading.html#thread-objects" rel="noreferrer"><code>threading.Thread(target=...)</code></a> states that</p>

<blockquote>
  <p><code>target</code> is the callable object to be invoked by the run() method.
  Defaults to None, meaning nothing is called.</p>
</blockquote>

<p>I usually use it like this:</p>

<pre><code>import threading

def worker():
    a = 3
    print("bonjour {a}".format(a=a))

threading.Thread(target=worker).start()
</code></pre>

<p><strong>Is there a way to chain the function elements in <code>target</code> so that a new one does not need to be defined?</strong> Something like (pseudocode obviously)</p>

<pre><code>threading.Thread(target=(a=3;print("bonjour {a}".format(a=a))).start()
</code></pre>

<p>I have a bunch of very short calls to make in the <code>Thread</code> call and would like to avoid multiplication of function definitions.</p>