def touching(self, bubble, bubbles):
for bubble1 in bubbles:
bubble_old = bubble1
if self.color == bubble_old.color and dist(bubble.pos, bubble_old.pos) <= 2 * BUBBLE_RADIUS:
bubbles.remove(bubble_old)
self.touching(bubble1, bubbles)
for example like this