3 ms·
Wow I have been using Python for years and didn't realize default values were only created when defined. I don't think I have ever been bitten by it, but it wou
by smegel 13y ago
Wow I have been using Python for years and didn't realize default values were only created when defined. I don't think I have ever been bitten by it, but it would have been one helluva bug to track down.
- gizmo686 13y agoI've been bitten by that exactly once. In order to track it down, I had to tear out pieces of my program to issolate where it is, to the point where I was working with a single function that did nothing other than mutate a dict that was a default value and print said value; and code that called it twice.