News for hackers. Stuff that matters.
Re:Python's Mutable Default Problem by pedro3005 on Sunday February 20, 2011 @01:13PM (#2242558)
You can use this trick for memoization. Example: http://paste.pocoo.org/show/341849/
Re:Python's Mutable Default Problem by code_duck on Sunday February 20, 2011 @03:23PM (#2242914)
The article is right, though, in stating that later viewers of your code may not be expecting this behavior, and it culd lead to problems.
Re:Python's Mutable Default Problem by underwater on Sunday February 20, 2011 @09:18PM (#2243969)
Memorization is an implementation detail and shouldn't be part of the arguments list.