0

In my code I have the following function

def construction(ins,obj=0,my_list=[[]]):
    first_try = obj == 0

    if first_try and my_list!= [[]]:
        print("ERROR", obj, my_list)
        input()
    #in the function I do a lot of calculations to modify obj and my_list
    return obj, my_list

At some other function in my code i call obj, my_list = construction(ins) and the ERROR gets printed, printing also 0 and a my_list that's different from the default. That shouldn't happen, am I wrong? If not, what are the possibilities for this to happen?

I think my_list is not a name in the global namespace("my_list" in globals().keys() == False in my code) so I don't know what may be causing this.

Victor Hugo
  • 181
  • 9

0 Answers0