0

If I have a class

class Foo(object):
    def __init__(self, a, b):
        self.a = a
        self.b = b

And two objects

bar = Foo(1, 2)
baz = Foo(1, 3)

How does Python determine whether or not baz should be added to a set that already holds bar? Is there a way to control this behaviour?

Moses Koledoye
  • 77,341
  • 8
  • 133
  • 139
Batman
  • 8,571
  • 7
  • 41
  • 80

0 Answers0