News for hackers. Stuff that matters.
Re:Python: Common Newbie Mistakes, Part 1 by bryanh on Sunday July 07, 2013 @03:10AM (#6001346)
A safe pattern for this without the None check is keyword expansion which will define defaults when a function is called.

    def foo(**kwargs):
        numbers = kwargs.pop('numbers', [])
        numbers.append(9)
        print numbers

There are no comments on this comment yet.