UK & world technology
Sign inJoin us
TechBlastTechnology. Unpacked.UK & world technology
← Latest news

From Dev.to

My Python function remembered data from the last call. The bug was a mutable default argument

I called the same function twice and the second call returned the first call's data. No global variable, no cache, nothing obvious. The cause was one line in the function signature. def add_item(item,...

Read the full report at Dev.to ↗