title: Getting the return value of __setitem__() and length of dictionary
body: <p>I have the following dictionary:</p>
  
  <pre><code>class Only5Items(dict):
      def __setitem__(self, key, value):
          if len(self) &lt; 5:
              super(Only5Items, self).__setitem__(key, value)
  </code></pre>
  
  <p>I want to return true, if I success to add an item. Any ideas?</p>
  
  <p>I'll explain it a little more.
  For example:</p>
  
  <pre><code>items = Only5Items()
  items["hi1"] = "asdf1"
  items["hi2"] = "asdf2"
  items["hi3"] = "asdf3"
  items["hi4"] = "asdf4"
  items["hi5"] = "asdf5"
  items["hi6"] = "asdf6"
  </code></pre>
  
  <p><code>items["hi6"] = "asdf6"</code> won't insert. And i want to print a message about it.</p>
  
  <p>edit: len(self) works. And to be more specific, i don't want to print a message about it, i want to return true/false if i success to add it. Something external to the class.</p>