Commits

Neil Muller  committed c2c14a0

Use comparisons other than is or integer comparison

  • Participants
  • Parent commits 13a9e92

Comments (1)

Files changed (1)

File lib/sprite.py

 
     def remove_internal(self, sprite):
         r = self.spritedict[sprite]
-        if r is not 0:
+        if r != 0:
             self.lostsprites.append(r)
         del self.spritedict[sprite]
 
             for r in self.lostsprites:
                 bgd(surface, r)
             for r in self.spritedict.values():
-                if r is not 0:
+                if r != 0:
                     bgd(surface, r)
         else:
             surface_blit = surface.blit
             for r in self.lostsprites:
                 surface_blit(bgd, r, r)
             for r in self.spritedict.values():
-                if r is not 0:
+                if r != 0:
                     surface_blit(bgd, r, r)
 
     def empty(self):
        for s in self.sprites():
            r = spritedict[s]
            newrect = surface_blit(s.image, s.rect)
-           if r is 0:
+           if r == 0:
                dirty_append(newrect)
            else:
                if newrect.colliderect(r):
         for spr in self.sprites():
             rec = spritedict[spr]
             newrect = surface_blit(spr.image, spr.rect)
-            if rec is 0:
+            if rec == 0:
                 dirty_append(newrect)
             else:
                 if newrect.colliderect(rec):