What is the most Pythonic way to provide a fall-back value in an assignment?
<p>In Perl, it's often nice to be able to assign an object, but specify some fall-back value if the variable being assigned from is 'undef'.  For instance:</p>

<pre><code>my $x = undef;
my $y = 2;
my $a = $x || $y;
</code></pre>

<p>After this,</p>

<pre><code>$a == 2
</code></pre>

<p>Is there a concise way to achieve this in Python if the value x is None, or would a full-on ...</p>

<pre><code>if x is not None
    a = x
else
    a = y
</code></pre>

<p>... be the most Pythonic way to achieve this?</p>

<p>EDIT: Apologies, as has been pointed out by several commenters, I wasn't really talking about the value being undefined, but 'undef' in Perl, which is not really the same thing.  But the question as originally worded didn't make this clear.</p>
