What is the most Pythonic way to use an empty dictionary as a default argument?
<p>Using default arguments of the form <code>x={}</code> usually does not accomplish the intended purpose in Python, since default arguments are bound when a function is defined, not called.</p>

<p>The convention seems to be to set mutable objects as default arguments with <code>x=None</code> and then check <code>x is None</code> to assign the proper default when the function is called.</p>

<p>So if I would like to cast <code>x</code> to a dictionary that is by default empty, I would use something like the following:</p>

<pre><code>def f(x=None):
    x = dict(x) if x is not None else {}
</code></pre>

<p>However, since <code>dict</code> can take any iterable, I could also write this more succinct version:</p>

<pre><code>def f(x=()):
    x = dict(x)
</code></pre>

<p>Which of these is the "right" approach?</p>
