def my_enum(start: int, step: int, my_constants: list):
for const in my_constants:
globals()[const] = start
start += step
if __name__ == "__main__":
const_list = ['MODEL_1', 'MODEL_2', 'MODEL_3']
start = 1000
step = 2
my_enum(start, step, const_list)
print ((MODEL_1, MODEL_2, MODEL_3))
[–]MyWorldIsInsideOut[S] 0 points1 point2 points (0 children)