title: How can i chek if two list contained surface pygame object are equal?
body: <p>I have programmed a game that finished when two list contained <a href="https://www.pygame.org/docs/ref/surface.html" rel="nofollow noreferrer"><code>Sufaces</code></a> objects are equal but with operator <code>==</code> don't work</p>
  <p>The goal of this code is cut an image in 9 part for view it as a grid</p>
  <p>This a piece of code</p>
  <pre class="lang-py prettyprint-override"><code>
  def resize_image(img,left,top,right,bottom):
      size=(left,top,right,bottom)
      subimg=img.crop(size)
      # transform PIL image in suface for work in pygame
      subimg=pygame.image.fromstring(subimg.tobytes(),subimg.size,subimg.mode)
      return subimg
  
  def build_Image(N):
      images=laod_images() #function that loads two images
      img=images[0]
      img1=images[1]
      left=0
      top=0
      right=100
      bottom=100
  
  
      tab=emptyMatrix(N) #function that create a empty matrix
      for i in range(N):
          for j in range(N):
              if i==N-1 and j==N-1:
                  img1 = resize_image(img1, left, top, right, bottom)
                  tab[i][j] = img1
  
                  pos[i][j]=(left,top) matrix that save coordinate of surface objects
  
              else:
                  subimg = resize_immagine(img1, left, top, right, bottom)
                  tab[i][j] =subimg
  
                  pos[i][j]=(left,top)
  
              left += 100
              right += 100
  
          top+=100
          bottom+=100
          left=0
          right=100
      return tab
  
  tab=build_Image()
  tab1=build_Image()
  print(tab==tab1) #print False
  </code></pre>