Menu

📰
0

Spent two days on a bug that turned out to be a mutable default argument.

Reddit r/learnpython·u/Smart_Tool247·about 1 month ago
#2biyQ9NJ
#days#turned#default#argument#spent#article
Reading 0:00
15s threshold

Spent two days on a bug that turned out to be a mutable default argument. No errors. no warnings. just wrong output in production that never showed up in any of my tests. turned out a list in my default argument was being shared across every call instead of resetting. one line fix. two days of my life gone. anyone else get hit by this one?

Read More