title: Python: Checking if a 'Dictionary' is empty doesn't seem to work
body: <p>I am trying to check if a dictionary is empty but it doesn't behave properly. It just skips it and displays <strong>ONLINE</strong> without anything except of display the message. Any ideas why ?</p>
  <pre><code>def isEmpty(self, dictionary):
      for element in dictionary:
          if element:
              return True
          return False
  
  def onMessage(self, socket, message):
      if self.isEmpty(self.users) == False:
          socket.send(&quot;Nobody is online, please use REGISTER command&quot; \
                   &quot; in order to register into the server&quot;)
      else:
          socket.send(&quot;ONLINE &quot; + ' ' .join(self.users.keys()))    
  </code></pre>