title: Why is calling register() required for tkinter input validation?
body: <pre><code>def check_the_input_only_allows_digits_only(inp):
      # A function for validating the input, the purpose of this is to let
      # the user enter only digits.
      if inp.isdigit() or inp is "" or inp == "\b" or inp is None:
          return True
      else:
          return False
  
  
  reg = creditor.register(check_the_input_only_allows_digits_only)
  amount.config(validate = "key",validatecommand =  (reg,"%P"))
  </code></pre>
  
  <p>I have understood that the function  <code>check_the_input_only_allows_digits_only</code> is registered and for every character the user enters, the function is called and the input is  validated. But why is the <code>.register</code> required, couldn't the function be called without <code>.register</code> every time the user enters something? What exactly is happening beneath the hood?</p>