News for hackers. Stuff that matters.
Re:Python: Common Newbie Mistakes, Part 1 by smegel on Saturday July 06, 2013 @06:28PM (#6000296)
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.
Re:Python: Common Newbie Mistakes, Part 1 by gizmo686 on Saturday July 06, 2013 @08:31PM (#6000556)
I'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.