Python does this:
t = (1, 2)
x, y = t
# x = 1
# y = 2
How can I implement my class so to do
class myClass():
def __init__(self, a, b):
self.a = a
self.b = b
mc = myClass(1, 2)
x, y = mc
# x = 1
# y = 2
Is there a magic function I could implement in order to achieve this?