News for hackers. Stuff that matters.
Re:Python's Mutable Default Problem by dilap on Sunday February 20, 2011 @04:59PM (#2243258)
It's sad that such a common and concise idiom as "x or y" is so perniciously, subtly broken in Python, and that there is no satisfyingly concise equivalent.

If I were being cavalier and had an extra wish to burn, I'd request

  x else y
to mean x unless x is None.
Re:Python's Mutable Default Problem by eru on Sunday February 20, 2011 @05:18PM (#2243322)
Make yourself a function.
Re:Python's Mutable Default Problem by dilap on Sunday February 20, 2011 @06:20PM (#2243484)
Not so helpful in a strict language (since you want y to be evaluated only when x is None)
Re:Python's Mutable Default Problem by eru on Monday February 21, 2011 @04:28AM (#2244840)
Yes, that's true. You would need to wrap it in a lambda, but then that's looks horrible and you might as well use an if.