I decided to get know the Python data model and mutability concept, and after that "gotta" moment one test crashed my happiness.
I am completely ok with this example:
x = ['1']
def func(a):
b = 'new value'
a.append(b)
func(x)
print(x) # expected ['1', 'new value']
BUT ! What is hapenning here ?
x = ['1']
def func(a):
b = 'new value'
a = b
print(a)
# expected 'new value'
# factual 'new value'
func(x)
print(x)
# expected 'new value'
# factual ['1'] !!!
Why x does not equal to 'new value' ?