true, and i can’t think of a legitimate case where it would have tripped me up. but if someone, a novice perhaps, wrote
def some_func(foo, bar=[1, 2, 3]):
bar.reverse() # for whatever reason
print(bar)
some_func('hello') # output [3,2,1]
some_func('hello') # output [1,2,3]
i think they would be within their rights to be surprised that calling this function twice has different results. that’s what i was surprised by; it feels like bar would be re initialised each time with a scope of the function but apparenty not
My first week at a major fund company I was assigned to an internal business tool used by thousands. I noticed all the company email addresses in the sandbox weren’t correct, so I ran a script to correct them. Cue a call from C-level to my boss asking why he got a “email changed notification”. Followed by another… And another… And another…
I went out to lunch
Had to contact support this week because (on top of an already infuriating week of marketing cloud bullcrap) an exit criteria in Journey Builder was firing when it shouldn’t. Basically amounted to a string comparison of A = B? But one was from Contact Data and the other from Journey Data. And you know what their response was? “Yeah… that won’t work, you have to do B = A”. I kid you not. What’s worse is that actually fixed it! What a joke of a platform. How shit do you have to be at coding to end up making a string comparison non-commutative? Like…I don’t even know how you’d screw up that badly accidentally. It’s a veritable kaleidoscope of shitty infuriating bugs.
Oh it won’t end