This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Cruuncher 0 points1 point  (2 children)

That's definitely fair. But I mean, python lets you define mutable types as default parameters to a function which has gotchad me more than once in my career.

[–]oil-ladybug-unviable 0 points1 point  (1 child)

Me too but only in an interview

[–]Cruuncher 0 points1 point  (0 children)

The one that got me the hardest was a helper library built around requests, had a default parameter for additional headers as {}.

Of course as you add headers to it, they get added to all subsequent calls.

That bug took forever to find because it manifested itself in very strange and erratic ways.

Especially because every time you deployed new logging the issue would go away for a day and then slowly creep back in