title: Tkinter's .after() and recursion
body: <p>To update a widget in time I use the <code>.after()</code> method, usually in the following form:</p>
  
  <pre><code>def update():
      do_something()
      &lt;widget&gt;.after(&lt;delay&gt;, update)
  </code></pre>
  
  <p>It is my understanding that the widget waits for a certain amount of time and then executes the <code>update()</code> function, at the end of which the widget waits once again before re-executing the function and so on.</p>
  
  <p>This seems to me a lot like recursion. So, the question is: Does <code>.after()</code> actually work by means of recursion or not?</p>
  
  <p>If it does, then there is a limit to the depth of recursion, but the following example should prove that such limit is never reached:</p>
  
  <pre><code>from tkinter import *
  
  counter = 0
  
  def count():
      global counter
      counter += 1
      lbl.config(text=counter)
      root.after(10, count)
  
  root = Tk()
  lbl = Label(root, text='0')
  lbl.pack()
  Button(root, text='Start count', command=count).pack()
  root.mainloop()
  </code></pre>
  
  <p>In my system the limit to the depth of recursion is 1000, but this example goes far beyond that value in a few seconds until I stop it.</p>