xxxxxxxxxx
MyList:
def __init__(self,my_list= None, levels = None):
if my_list is None:
my_list= []
self.my_list= my_list
if levels is None:
levels = []
self.levels = levels
MyDict:
def __init__(self,my_dict= None, levels = None):
if my_dictis None:
my_dict= {}
for lvl in levels:
my_dict[lvl] = []
self.my_dict = my_dict
if levels is None:
levels = []
self.levels = levels
MyElem:
def __init__(self,my_attribute):
self.my_attribute = my_attribute
xxxxxxxxxx
Programming is like a "choose your
own adventure game" except every
path leads you to a StackOverflow
question from 2013 describing the
same bug, with no answer.
So, you're searching for the holy grail?
xxxxxxxxxx
https://stackoverflow.com/
Here it is. I hope you dont mind me drinking out of it first
Dont only copy the code, try to understand it!