title: Looping data: maximum recursion depth exceeded in cmp
body: <p>I'm using Django that iterate through items to see if they exists using get_or_create. Right now I'm having this problem </p>
  
  <pre><code>def insert_titles(self):
      game = None
      title = None
      for k,v in self.data.items():
  
  
          game_exists = Game.objects.all().get_or_create(game_name=v['title']) #will get RuntimeError: maximum recursion depth exceeded in cmp
          print game_exists
  </code></pre>
  
  <p>Basically, this is an script that will run as a cron job, so I kind of have to iterate through a bunch of items to get to the point I want</p>
  
  <pre><code>            while True:
              try:
  
                  data = strategy.process()
                  filter = FilterGames(data, link) 
  </code></pre>
  
  <p>Filter Games code: </p>
  
  <pre><code>def __init__(self, data):
      self.data = data
      self.insert_titles()
      print "init"
  </code></pre>
  
  <p>I've done this in the past with Play Framework, maybe since I'm still inexperienced in Python I'm looking at it the wrong way, not sure how to proceed when it gives me this type of error. I have tried change the structure a bit to no avail. Weird thing is that if I use a <code>string</code> in <code>game_name</code> it will work as expected, but if I use data gathered from a loop, it starts throwing that error.</p>
  
  <p>Finally, I want to know how to correct this type of error, and hopefully understand a bit more of why it does that.</p>