I have the following python classes:
class Coordinates:
def __init__(self, x, y, z):
self.x = x
self.y = y
self.z = z
class Properties:
def __init__(self, w, h, d):
self.w = w
self.h = h
self.d = d
class Objects(Properties, Coordinates):
def __init__(self, x, y, z, w, h, d):
Coordinates.__init__(self, x, y, z)
Properties.__init__(self, w, h, d)
I would like to have an incremental unique ID of Objects class in each time I call the class in the main. This ID is got to be generated automatically while creating the class instance.
I have thought to use the function id() but it's only when creation of the object.
a = Objects(1, 2, 3, 4, 5, 6)
b = Objects(1, 2, 3, 4, 5, 6)
print (id(a),id(b)) #(2400452, 24982704)